Pradip Sutariya
Pradip Sutariya

Reputation: 287

How can an iOS BLE central receive more than 182 bytes from a peripheral in notify mode?

I have a custom BLE peripheral that can send a notification data packet to a central. The device sends packets of 234 bytes at a time, and the central is expected to register for notification of characteristic updates on the device. Peripheral is sending the 234 bytes of data to central but iOS device receiving only 182 bytes of data in the didUpdateValueForCharacteristic function.

In android, The central software just works with no problems and the phone (central) receives 234 bytes in a single notify event. - this works just fine in Android but having an issue with iOS devices.

Is there any configuration required for the iOS device to receive the full length of data from the BLE peripheral? Any help would be appreciated!

Upvotes: 2

Views: 2120

Answers (1)

Youssif Saeed
Youssif Saeed

Reputation: 13285

iOS devices have a maximum ATT_MTU of 185 bytes, which means you can send a maximum of 182 data bytes per packet (the other 3 bytes are overhead for L2CAP). In the beginning iOS devices only supported 158 bytes and then this was increased to 185.

The way ATT_MTU works is that there's a negotiation upon connection where the central sends its maximum ATT_MTU (i.e. for iPhones it is 185) and the peripheral replies with its own ATT_MTU (i.e. in your case it is 237), and then the connection's ATT_MTU will be the minimum between the two (i.e. 185). So to answer your question, no there isn't a way to configure your iOS device to send the full length of data because this is a low level configuration that Apple don't allow access to.

Have a look at the following links for more information:-

Upvotes: 2

Related Questions