Trying to use the new BLE api with 1.3.0-rc.1 (on a Boron). My application needs a custom BLE service with 10 characteristics. Adding the 8th characteristic with
BLE.addCharacteristic() and higher logs this error:
[hal.ble] ERROR: characteristics_.size() < 10 failed: -200
This error seems to come from here: https://github.com/particle-iot/device-os/blob/v1.3.0-rc.1/hal/src/nRF52840/ble_hal.cpp#L2188
CHECK_TRUE(characteristics_.size() < BLE_MAX_CHAR_COUNT, SYSTEM_ERROR_LIMIT_EXCEEDED);
BLE_MAX_CHAR_COUNT is defined as 10 in https://github.com/particle-iot/device-os/blob/v1.3.0-rc.1/hal/src/nRF52840/ble_hal_impl.h#L112
If the limit is 10, why can I add no more than 7? Using the nRF connect Android app shows a Particle BLE service with already 3 characteristics. So
#define BLE_MAX_CHAR_COUNT 10 seems to be the limit for the overall characteristic count of all services.
Changing the define lets create me more characteristics, but I’m not sure about any side effects.
Is there a reason for limiting the user generated characteristic count to only 7?