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:
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
Ah. Thank you very much. That explains it.