我记得在“Guide and Hint”-doc中读到Samsung BLE API (archived page):
One of the most important concepts of the Samsung F/W and stack is
its synchronous nature. That is, if we call for example,writeCharacteristic
for a particular characteristic, if it returnstrue
, the next call to anyBluetoothGatt
orBluetoothGattServer
method
should be done after theonCharacteristicRead
callback is received.
This is because the stack is designed to support and process only one
GATT call at a time, and if, for example, you callwriteCharacteristic
orreadCharacteristic
on any characteristic soon
after the first one, it is ignored.
>这是否也适用于引入的BLE的本机实现
在Android 4.3?
> Samsung API一次只支持一个连接的GATT设备.
这在原生API中有变化吗?
解决方法:
三星最近在我在我的问题中链接的同一页面上发布了一个“迁移”文档.他们在将新的原生BLE API与Samsung BLE API进行比较时完全回答了我的问题:
The synchronous nature of the stack and F/W hasn’t been affected.
That is, if we call for example,writeCharacteristic
for a particular
characteristic, if it returns true, the next call to anyBluetoothGatt
orBluetoothGattServer
method should be done after theonCharacteristicRead
callback is received. This is because the stack is designed
to support and process only one GATT call at a time, and if, for
example, you callwriteCharacteristic
orreadCharacteristic
of anycharacteristic
soon after the first one, it is ignored.