You are viewing an older revision! See the latest version
API Development
API Development¶
Change Requests¶
Main header file name (cacu)¶
<ble.h> or <bledevice.h> rather than <nRF51822n.h>. That way if one day the developer switches chips he does not have to change the source
Main stack instance (cacu)¶
Currently it is "nRF51822n nrf;", I suggest "BLEDevice ble;" instead
Repo Layout and Code sharing across multiple chipsets (cacu)¶
Currently the repo layout looks like this:
|-- BLE_API_Native | |-- hw | | |-- nRF51822n | | | |-- btle | | | |-- common | | | |-- nordic | | | | nRF51Gap.cpp | | | | nRF51Gap.h | | | | [...] | | | | projectconfig.h | | | | | | BLEDevice.h | | | Gap.h | | | GapEvents.h | | | GattServer.h | | | GattServerEvents.h | |-- mbed-src-Nordic | | blecommon.h | GapAdvertisingData.cpp | GapAdvertisingData.h | [...] |UUID.h |
I think this layout does not split the common vs the chip-specific code clearly.
Instead I would suggest something along these lines:
|-- BLE_API_Native | |-- public // the public API that app developers are going to use, those are the only files they need to include | | | BLEDevice.h | | | Gap.h | | | GapEvents.h | | | GattServer.h | | | GattServerEvents.h | |-- common | | |-- hwapi // internal API for the hardware, isolates the chip-specific code from the common classes | | | | HwBLEDevice.h | | | | ??? // depending on how this internal API is split there may be more interface files headers | | | | [...] | | | blecommon.h // all files on this level are common to all chips, they include the implementation to the "public" folder | | | GapAdvertisingData.cpp | | | GapAdvertisingData.h | | | [...] | | | UUID.h | | | BLEDevice.cpp // this implements the API in public/ | | | Gap.cpp | | | GapEvents.cpp | | | GattServer.cpp | | | GattServerEvents.cpp | |-- hw | | |-- nRF51822n | | | |-- btle | | | |-- common | | | |-- nordic | | | | nRF51BLEDevice.cpp // this implements the API in common/hwapi | | | | nRF51Gap.cpp | | | | nRF51Gap.h | | | | [...] | | | | projectconfig.h | | | | |-- mbed-src-Nordic | |
Feature Requests¶
Additional functionality not currently covered by the API
- Description (request author)