digidotcom / xbee-csharp

C# library to interact with Digi International's XBee radio frequency modules from mobile devices.
Mozilla Public License 2.0
14 stars 8 forks source link

bluetooth: update the write process to slice the data based on the MT… #31

Closed daescalona closed 5 months ago

daescalona commented 8 months ago

…U size

It has been observed that, if a data packet bigger than the negotiated MTU size is sent using the Tx characteristic, the connection with the BLE device is lost after a small timeout.

This commit fixes this scenario as follows:

While on it, make the write_data method async by awaiting the inner write task. This avoids spurious micro-hangs while sending data to the BLE device.