Android 4.4 Ble Indication Data More Than 20 Byte
Solution 1:
Try negotiating a bigger GATT MTU. The default is 23 bytes. The (G)ATT protocol takes up 3 bytes for the header per Notification / Indication. So 20 - 3 = 20 bytes left by default.
On iOS 8, the maximum MTU that iOS will allow is 158 bytes. I'm not sure about what Android allows.
Solution 2:
I had exactly the same problem - 20 bytes it is a limitation applied to both indications and notifications. It is defined in the Spec, however I am yet to find it.
If your characteristic is not using either indications or notifications then this constraint doesn't apply and all your data will be sent in chunks of MTU-5 see section section 3.4.6.1 of the BT4.0 spec.
Solution 3:
The data is sent in chunks of 20 bytes each. So if you want to receive all 80 bytes, then divide the data in 20 byte chunks and send it in a loop. Refer to Android: Sending data >20 bytes by BLE for clarification.
Remember to add Thread.sleep(200) in the loop so that the characteristic is not overwritten.
Post a Comment for "Android 4.4 Ble Indication Data More Than 20 Byte"