Peripheral.java 文件源码

java
阅读 47 收藏 0 点赞 0 评论 0

项目:react-native-blue-manager 作者:
@Override
public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) {
    super.onCharacteristicWrite(gatt, characteristic, status);

    if (writeCallback != null) {

        if (writeQueue.size() > 0){
            byte[] data = writeQueue.get(0);
            writeQueue.remove(0);
            doWrite(characteristic, data);
        } else {

            if (status == BluetoothGatt.GATT_SUCCESS) {
                writeCallback.invoke();
            } else {
                Log.e(LOG_TAG, "Error onCharacteristicWrite:" + status);
                writeCallback.invoke("Error writing status: " + status);
            }

            writeCallback = null;
        }
    }else
        Log.e(LOG_TAG, "No callback on write");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号