BLE Characteristics Limitation

This post is to save others the agonizing time I had trying to solve an issue I had with a BLE application.

The Arduino BLE library is amazing but there are a few aspects that are not obvious that can cause problems and the solutions are not easy to find. This one has to do with the number of characteristics that can be attached to a service.

In example shown, creating a service looks like this...

//  Create Device Service
BLEService* pMyService = VMRRBLEServer->createService(TheUUIDGoes Here);

In that example, you will be limited to SEVEN characteristics. My application needed nine. It took me forever to figure this out. I was using custom UUIDs and figured I was doing that wrong. Turned out I was not.

To have more that seven characteristics, this is how you do it...

//  Create Device Service
BLEService* pMyService = VMRRBLEServer->createService(TheUUIDGoes Here, 30);

Note the additional ",30" at the end. This creates the additional handles that are required for the additional characteristics.

Hope this helps.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.