Comments (4)
Hi Myles,
Which part of C++ is a showstopper for you?
If you study the demos, you'll find that there's hardly any C++ being used apart from instantiating a BLEDevice or a few BLE services; or perhaps classes which abstract the hardware. You're free to write the rest of your application in C if you prefer.
Is it the BLE API which you'd like to see written in C? Or is it the larger mbed API which you'd have in C? Please continue this discussion; your feedback could help us re-orient ourselves. thanks.
from ble.
Hi Rohit,
Thanks for the quick response.
I'm interested in using and extending the BLE API. Our project is written in C, and I'm worried that the necessary wrappers will add too much overhead in terms of size/execution time. C seems a lot easier to include in C++ than C++ is in C.
I'm working with an nRF51822, and I'd like to get to the point where the entire project is open source. It seems like it would be a much simpler road if BLE_API were in C. I'm open to suggestions, though.
Thanks,
Myles
from ble.
The C++ wrappers making up the BLE_API are very lightweight. Using them will not cause any performance or code bloat. C++ has come a long way in being efficient. Using C++ brings the benefit of much better compile-time checking and introduces near-zero run-time overhead.
Does your toolchain support C++?
If you really need everything to be C-only, you'll have to de-contruct every class BLE_API into a module and pass around extra pointers to structs. There are not too many classes in BLE_API, and this deconstruction can be achieved within a small amount of effort.
The Nordic SDK is in C. BLE_API only adds the benefit of being cross-platform. If you are not going to aim for portability, then you can also consider using the Nordic SDK directly.
from ble.
I agree. I didn't mean to imply that the C++ code in BLE_API were poorly written. My toolchain supports C++, but the project definition doesn't. I didn't want to use the Nordic API directly, because I wanted to support an open-source API. I was mostly surprised that C++ was chosen to wrap a C API. Presumably future APIs that you are targeting may be written in C++.
Thanks for your work. I agree that deconstructing the classes wouldn't be too much work. That may be the way forward for me.
from ble.
Related Issues (20)
- AdvertisementCallbackParams_t should include addressType for the peerAddr HOT 3
- GapState_t missing information? HOT 2
- GapAdvertisingData using deprecated type aliases HOT 1
- Time unit inconsistencies in GapScanningParams HOT 1
- Duplicated functionality in GapAdvertisingParams and GapScanningParams HOT 1
- BLE.h conflict with Nordic SDK ble.h HOT 5
- Using ANCS HOT 3
- Add error handling to GattClient procedures HOT 3
- Will we support BLE profiles? HOT 2
- "connection parameters update request" CALLBACK IS MISSING FROM MBED STACK HOT 12
- Possible Ticker BLE_API conflict causing problems with Nordic devices? HOT 7
- Link to documentation from README is broken
- NRF_52 Development Kit notification events don't fire on the central, when peripheral data changes HOT 24
- Linker error when using the Nordics Experimental Flash Data Storage API's. HOT 1
- NRF5: Byte order of characteristics with multi-byte data types incorrect HOT 4
- please implement missing key features HOT 1
- X-Nucleo-IDB05A1 Not Working HOT 4
- Can I control the channel the device is advertising on with this API?
- How to call BLE APIs from the board to host side using icetea?
- #include "mbed.h" where is it??? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ble.