How to handle characteristic sizes over 20 Bytes in BLE connection?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
PascalS
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hi,

   

I'm working for an application to transfer data from my Cypress BLE module (CYBLE-014008-00) to an iOS APP. I did some experience with BLE and iOS Apps, so there shouldn't be a problem to implement this feature to the cypress module and the iOS device.

   

My question aims to the maximum characteristic size. On the one hand BLE specification tells us that the maximum characteristic size is about 23 Bytes in version 4.1 but on the other hand I can choose a characteristic size up to 512 Bytes (see attached picture) without getting any error. So is this a valid characteristic size? And how does my mobile device interpret this value? Do I get more than one notification?

   

The other question is, why I am able to choose a MTU size up to 65488 Bytes? How does these two values (512 Bytes / 65488 Bytes) fit together?

   

 

   

Thanks in advance!

   

 

   

Pascal

0 Likes
1 Solution
Anonymous
Not applicable

You can increase the MTU size in the GAP Settings. But a negotiation should take place with the iPhone that the MTU has be increases to more than 23 bytes.

   

Refer to the 
CyBle_GattcExchangeMtuReq and CyBle_GattsExchangeMtuRsp APIs in the BLE Datasheet.

   

Though you have an option for choosing upto 65488, it is not possible practically. We need to get this fixed in the creator. 

   

Regards,

   

- Madhu Sudhan
 

View solution in original post

0 Likes
8 Replies
Anonymous
Not applicable

You can increase the MTU size in the GAP Settings. But a negotiation should take place with the iPhone that the MTU has be increases to more than 23 bytes.

   

Refer to the 
CyBle_GattcExchangeMtuReq and CyBle_GattsExchangeMtuRsp APIs in the BLE Datasheet.

   

Though you have an option for choosing upto 65488, it is not possible practically. We need to get this fixed in the creator. 

   

Regards,

   

- Madhu Sudhan
 

0 Likes
PascalS
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Gotcha! But do I have any guarantee that my mobile device (iOS and maybe Android) support these characteristic sizes up to 512 Bytes? So are characteristic sizes above 23 Bytes are specified anywhere in the Bluetooth Low Energy specification?

   

Thanks!

   

Pascal

0 Likes
Anonymous
Not applicable

Characteristic size over 23 bytes have to be negotiated. You should probably trigger the MTU exchange request from your App on Android/iOS to ensure that the data size is always set correctly. Android/iOS normally support higher MTU size.

PascalS
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Okay, thanks!

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

When you have a characteristic that doesn't fit in one MTU, BLE can execute a "long read". This means the read of this value is plit up into multiple packets. It should happen automatically IIRC.

0 Likes
Anonymous
Not applicable

Hi,

   

I am notifying >70 bytes of data from the PSoC BLE. I have set the MTU size to 100.

   

In my application I should receive the data in a linux device, So I am using GATTTOOL for that. If  I am receiving >20 bytes, then it is not getting notified. Is there any command to set the MTU size in linux??

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

I think for the notification the length is limited. A long read is only possible for normal attribute reads. So your notification would indicate what has changed, and the the device can decide to do a full attribute read.

0 Likes
LUBA_1714456
Level 3
Level 3
First solution authored 10 replies posted 5 replies posted

Sorry but I get quite confused...

   

I have to connect with an Android / iOs device, where "Embarcadero Development" suite seem to accept  long buffer characteristic write...

   

But on Psoc4-Ble, if I needed to send 100 bytes, do I have to split in 5 writes?

   

Or may be the Android Client device, reading my profile (100 bytes MTU), could allow this longer write?

   

Thanks to every one answering me.

   

B.R.

   

Luigi

0 Likes