Last two bytes missing in notifications but not in reads

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
Ulf Söderberg
Offline
Last seen:4 months 1 week ago
加入:2014-02-14 20:16
Last two bytes missing in notifications but not in reads

I'm having some weird problem when sending 64 bytes of data to a characteristic.
When the client just performs a read operation after the data has been sent all of the 64 bytes are received correctly.
When the client has subscribed to notifications only 62 bytes are received with the notification, but if an extra read is performed then all the 64 bytes are there. So, for some reason the last two bytes gets lost in notifications.

What can cause this behaviour?

Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Ulf Soderberg,

Hi Ulf Soderberg,

有关通知,古物古迹办事处unt of bytes that a device can send over notification of a characteristic is limited by the MTU (Maximum Transfer Unit), the MTU by default is limited in 23 bytes including the ATT layer overhead, so the payload of a notification is 20 bytes. By increasing the MTU size that means that you can send more bytes over one notification, so in your case the maximum transfer unit should be the amount of bytes you would like to send + 3 extra bytes. The reading procedure (when the host is reading a value from the peripheral) is not limited by the MTU size and that is why you are able to read as many bytes as your characteristic is.

Thanks MT_dialog

Ulf Söderberg
Offline
Last seen:4 months 1 week ago
加入:2014-02-14 20:16
Ah. Thank you very much. That

Ah. Thank you very much. That explains it.