2022-12-08 06:22 AM
HI,
I'm currently struggling to add new characteristics and characteristic descriptors to my BLE profile. Unfortunately it seems that CubeMX does not support adding more than five characteristics and has no support for adding descriptors.
This is the main code where I am trying implement a new descriptor (all in custom_stm.c file generated by CubeMX):
And here is the return value I get (72) from the aci_gatt_add_char_desc():
Unfortunately I can't find any definition for what this value means. I found the following in a document online for another ST board (I am using an STM32WB5MM):
Unfortunately none of these fit the bill. There is also no definition for this particular return value in "ble_defs.h", this is where the other BLE return values are defined.
Apologies for the messy code, I have been trying everything I can to get rid of this error but haven't been able to figure anything out.
Greatly appreciate any input on this issue. Thanks very much!
2023-01-05 09:21 AM
Hello,
The limitation to 5 characteristics for 1 service comes from STM32CubeMX tool, indeed you can add more characteristics or descriptors with the aci_gatt_add_char()/aci_gatt_add_char_desc() functions, to do this you should increase the Max_Attribute_Records parameter used in aci_gatt_add_service() function. To calculate this parameter follows this formula:
Max_Attribute_Records = 1
+ 2*no_of_char
+ 1*no_of_char_with_notify_or_indicate_property
+ 1*no_of_char_with_broadcast_property
The error code 0x48 means Out of memory.
Best Regards