- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using CYBLE-014008-EVAL for my development.
I have created a custom BLE service (Fields: 9x4 bytes == 36 bytes, Properties: Notify).
After linked with CySmart 1.2 and 'Enable All Notifications', I cannot get the notified data.
However, if I set the size of the 'Fields' data from 36 bytes to 12 bytes, I can get the notified data.
Is there any limitation on the data size of the notification?
Thanks!
Terry
Solved! Go to Solution.
- Labels:
-
BLE
-
ispn:40064:1:0
-
l1:314:1:0
- Tags:
- ble notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Terry,
Increase the MTU size to 39 and try again. Make sure that the MTU size is exchanged.
Please see Bluetooth 4.0 specification Vol 3 Part F 3.4.7.1. (Attribute Value size for notifications should be between 0 and MTU - 3)
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Terry,
Increase the MTU size to 39 and try again. Make sure that the MTU size is exchanged.
Please see Bluetooth 4.0 specification Vol 3 Part F 3.4.7.1. (Attribute Value size for notifications should be between 0 and MTU - 3)
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi cfmm,
Just want to confirm that is it ok for just to change the MTU in 'GAP settings'?
Do I need to change the 'L2CAP MTU' also?
Thanks,
Terry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Terry,
Yes in the GAP Settings tab.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
cfmm is correct. According to the BLE spec, the max size for a notification is MTU - 3. The default MTU size is 23 which means that the max notification payload can be 20 bytes. This is why 12 bytes work for you and not 36.
The GattsNotification() API will be returning an error when the length of the data is greater than MTU - 3. You can check this in your code.
If you want to send a notification of size 36 bytes, then change the MTU size to 36 + 3 = 39 bytes. You don't have to change the L2CAP MTU size. Change only the GATT MTU size.