po.pe
po.pe

Reputation: 1162

BLE STM BlueNrg characteristic max size and max characteristic per service

I have two issues with my BlueNRG-MS BLE module which I'm not really sure if this is intended design:

  1. The maximum size of a characteristic cannot exceed 20 bytes. If I create a characteristic that is e.g. 32 bytes long, although I can read the whole 32 bytes, when the characteristic is notified (updated) by the BLE, only 20 bytes are transmitted. I've found some references which confirm this, but I havent found a reasonable explanation.

  2. I can only add 2 characteristics to one service. This seems rather odd and I wonder if there's a limiting configuration parameter which I'm missing. If I add 3 characteristics to one service, only the first two get added. I'm using the STM LightBlue App for debugging.

Update: The return value of the aci_gatt_add_char() function is ERR_UNSPECIFIED_ERROR It seems like there are others having the same issue https://community.st.com/s/question/0D50X00009XkYh6/another-question-about-bluenrg-errunspecifiederror

Upvotes: 0

Views: 1018

Answers (2)

po.pe
po.pe

Reputation: 1162

Okay, seems like in my case the problem was caused by the max_attr_records parameter of the aci_gatt_add_serv() call. I haven't found a clear specification so far, but you seem to need 1 for the service itself and and my case (with the CHAR_PROP_NOTIFY flag set) +3 for each characteristic. So it works for now, still if someone has a clear insight in how to determine the max_attr_records please let me know. Also, setting it too high also doesn't work, but here I haven't found an explanation so far.

Upvotes: 0

Kirby
Kirby

Reputation: 1

Just face the same problem, don't know why ST make it so hard to use. I'm using Bluenrg-LP and BLE_SerialPort example project.

I Changed 5 to 7 and set .chr_count = 4. Now I can create 4 characteristic in serial_port_chars[]. Also checked with LightBlue App.

/* Number of characteristics attributes requests / #define NUM_APP_GATT_CHAR_ATTRIBUTES_CONF (7) / attributes for serial port service characteristics */

Upvotes: 0

Related Questions