【发布时间】:2017-09-26 13:11:40
【问题描述】:
我正在编写一个针对 Android 和 iOS 的应用程序,它通过 BLE 使用 Nordic UART 服务和 TxD/RxD 特性与 Adafruit Bluefruit LE UART Friend 进行通信。
TxGattCharact: TBluetoothGattCharacteristic;
SelectedDevice: TBluetoothLEDevice;
TxGattCharact.SetValueAsString(myString, True); // UTF8 required
if BluetoothLE1.WriteCharacteristic(SelectedDevice, TxGattCharact) then
... // everything just fine
else
Log('Writing Characteristic denied or unsuccessfull');
按照 BLE 规则,我必须将字符串拆分为最多 20 个字符的块。 这是 90% 的时间 但是,有时,WriteCharacteristic 并不成功
有没有办法了解原因并采取可能的措施来防止这种情况? 我可以在发送另一个字符串之前刷新 BLE 缓冲区以清除所有内容吗?
提前感谢您的帮助
【问题讨论】:
标签: delphi bluetooth-lowenergy firemonkey android-bluetooth ios-bluetooth