Get Half Data through StartNotification() on Android 14 (API Level 34). #682
Replies: 1 comment 2 replies
-
BLE has a maximum notification size that can vary between iOS and Android, and between different phones even... but it's usually in the range of 20 bytes up to only about 512 bytes. If the payload you're trying to send via the notification exceeds this... it depends on what the underlying peripheral library does as to what your application will see. To send larger payloads, you'll potentially need to use Indications rather than Notifications (see this link for a short discussion on the differences), and likely do some reassembly of the fragmented payload in your application. Alternatively, if you can find a way to reduce the notification size to be below the minimum MTU size the phones you're targeting supports... this is a neater and often simpler approach. |
Beta Was this translation helpful? Give feedback.
-
When I scan and connect to the device and initiate communication, my messages are successfully sent to the device. However, when the device responds with a large data payload (such as a JSON object with 50 key-value pairs), I only receive the last portion of the data that the device sends.
Beta Was this translation helpful? Give feedback.
All reactions