8 years, 10 months ago.

Why GattService.h restrict Characteristics to 5

I opened GaatService.h and noticed

//Some other code
GattCharacteristic* characteristics[BLE_SERVICE_MAX_CHARACTERISTICS];

Why characteristics are limited max to 5?

I am using nordic nRF51822 mbed mkit board. I also searched on nordic forum.


Which clearly indicates that there is no limit characteristics per service.

Question relating to:

High level Bluetooth Low Energy API and radio abstraction layer

1 Answer

8 years, 10 months ago.

It's an arbitrary limit to cap memory usage, but with some trial and error you are free to change the number depending on how much SRAM the rest of your program uses.

Accepted Answer

I didn't want to change API code. This would obstruct any future updates of the library in my project. I wish mBed BLE team could implement something like this in the GattService constructor.

GattService::GattService(uint8_t base_uuid[16], GattCharacteristic[] charArray)

posted by Jigar Patel 21 May 2014

Just my two cents:

I think it's better to put this as comment on code itself, to avoid confusion.


posted by devsar devsar 21 May 2014