Hi Dialog,
In my recent project, I have a 100-bytes characteristic and I want to send it to the client side through notification.
On the client side, I could receive only 20 bytes unless I change the MTU size. I searched my BLE book( Bluetooth Low Energy The Developer's Handbook) and did not find any place talking about notification data size is related to MTU size.
我有点想知道what's the relationship between notification data size and MTU size( to me it seems like we could only notify MTU size - 3 bytes of data)? Is that a BLE stack constrain or it is a Dialog constrain.
Thanks a lot,
Device:
According to the Bluetooth 4.0 specification Vol 3 Part F 3.4.7.1"If the attribute value is longer than (ATT_MTU–3) octets, then only the first (ATT_MTU–3) octets of this attributes value can be sent in a notification."
So you are correct. The maximum size is MTU size - 3 bytes.
Hi Joacimwe,
Thanks a lot for the information. I notice in the spec., section 3.4.4.5 "Read Blob Request", we could find "The Read Blob Request is used to request the server to read part of the value of an attribute at a given offset and return a specific part of the value in a Read Blob Response.". Is that possible to just read part of a characteristic using Dialog's SDK?
Thanks a lot
Yes the da14580 supports incoming read blob requests. It will automatically respond with the corresponding part of the characteristic value.
What kind of device are you using as central? A smartphone, computer or another da14580? If you can issue custom Read blob requests or not depends on the central. Normally sdks provides methods to read the whole characteristic and then it will issue multiple read blob requests to retrieve the whole characteristic value.
Hi Joacimwe,
Currently, I am using a pair of DA14580 as server and client.
I want to have a long characteristic(e.g. 255 bytes long). Every time server wants to send some data to client, it first send a notification of 20 bytes. On client side, it could get a "
length" from this 20 bytes notification and read only "length" byte of data of the characteristic.
e.g. server send a notification to client and tell it to read 50 bytes of data from it. Then, instead of reading the whole characteristic, client uses read blob command to read just 50 bytes of the 255 bytes characteristic. Is that possible?
Thanks a lot.
Can't you just use the notification and send the data you want to send? Just make sure you have a large MTU. Then you can for example send 50 bytes.
We could increase the MTU size to 50, but the data package could be any size from 8 to 255. So, it would be lots of better if we could read only part of the characteristic dynamically according to length information we sent in notification package.