cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any reason Characteristic notification is limited to 20 bytes?

Mickael1
Associate II

Hello,

Working with a custom template BLE server, I face a situation where a characteristic of 40 bytes need to be notified. However on 2 different BLE master the characteristic is always truncated at 20 bytes on notification. Reading another characteristic does not truncate!

Everything seems correct on custom_stm.c and custom_app.c files. The custom server works properly. The function aci_gatt_update_char_value is properly called with good variable length.

Watching live expression, the full buffer is updated and length variable is correct.

Watching down to hci_send_req (in ble_gatt_hci.c file), rq.cparam as well as rq.clen, everything seems correct.

Using 2 different BLE Master, there is no way to get more than 20 bytes of data notified.

Result it is not possible to notify larger than 20 bytes.

Do you have any clue?

1 ACCEPTED SOLUTION

Accepted Solutions
Mickael1
Associate II

In fact the default MTU size is set to 23 at connection time.

The peripheral (server) is able to handle MTU from 23 to CFG_BLE_MAX_ATT_MTU (defaults to 156).

To be able to notify a complete characteristic larger than 20 bytes, an MTU auto-negotiation should be performed with the BLE Master (client).

Take care than all BLE masters are not compatible with MTU greater than 23.

View solution in original post

1 REPLY 1
Mickael1
Associate II

In fact the default MTU size is set to 23 at connection time.

The peripheral (server) is able to handle MTU from 23 to CFG_BLE_MAX_ATT_MTU (defaults to 156).

To be able to notify a complete characteristic larger than 20 bytes, an MTU auto-negotiation should be performed with the BLE Master (client).

Take care than all BLE masters are not compatible with MTU greater than 23.