Notification data length & MTU size.

7 posts / 0 new
Last post
zwang308
Offline
Last seen:4 years 4 months ago
Master
加入:2014-07-02 14:15
Notification data length & MTU size.

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:
Joacimwe
Offline
Last seen:1 year 5 months ago
Guru
加入:2014-01-14 06:45
According to the Bluetooth 4

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.

zwang308
Offline
Last seen:4 years 4 months ago
Master
加入:2014-07-02 14:15
Hi Joacimwe,

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

Joacimwe
Offline
Last seen:1 year 5 months ago
Guru
加入:2014-01-14 06:45
Yes the da14580 supports

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.

zwang308
Offline
Last seen:4 years 4 months ago
Master
加入:2014-07-02 14:15
Hi Joacimwe,

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.

Joacimwe
Offline
Last seen:1 year 5 months ago
Guru
加入:2014-01-14 06:45
Can't you just use the

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.

zwang308
Offline
Last seen:4 years 4 months ago
Master
加入:2014-07-02 14:15
We could increase the MTU

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.