本质上,本机Android BLE实现是同步的吗? [英] Is the native Android BLE implementation synchronous in nature?

查看:160
本文介绍了本质上,本机Android BLE实现是同步的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记得在中阅读 -doc到三星BLE API (存档页面)

I remember reading in the "Guide and Hint"-doc to the Samsung BLE API (archived page):


三星F / W和堆栈最重要的概念之一是
同步性质。也就是说,如果我们调用某个特定特征的
writeCharacteristic ,如果它返回
true ,对任何 BluetoothGatt BluetoothGattServer 方法
的下一次调用应在<$之后接收到c $ c> onCharacteristicRead 回调。
这是因为堆栈旨在一次仅支持和处理一次
GATT调用,例如,如果您调用
writeCharacteristic readCharacteristic 在第一个特征之后很快出现
,它将被忽略。

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 returns true, the next call to any BluetoothGatt or BluetoothGattServer method should be done after the onCharacteristicRead 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 call writeCharacteristic or readCharacteristic on any characteristic soon after the first one, it is ignored.




  1. 是否也适用于BLE在Android 4.3中引入的
    的本地实现?

  2. 三星API也仅支持一次连接一个GATT设备。
    原生API是否有此更改?


推荐答案

三星最近发布了迁移-我在问题中链接的同一页面上的文档。在将新的本机BLE API与三星BLE API进行比较时,他们确实回答了我的问题:

Samsung recently published a "migration"-document on the same page I linked in my question. They exactly answer my question while comparing the new native BLE API with the Samsung BLE API:


堆栈和F / W的同步特性并没有受到影响。
也就是说,例如,对于特定的
特征调用 writeCharacteristic ,如果返回true,则对任何<$ c $的下一个调用c> BluetoothGatt
BluetoothGattServer 方法应在 onCharacteristicRead 回调之后完成收到。这是因为堆栈被设计为
一次仅支持和处理一个GATT调用,并且,例如,对于
,您调用 writeCharacteristic 或第一个后不久的任何特征中的 readCharacteristic ,将被忽略。

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 any BluetoothGatt or BluetoothGattServer method should be done after the onCharacteristicRead 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 call writeCharacteristic or readCharacteristic of any characteristic soon after the first one, it is ignored.

这篇关于本质上,本机Android BLE实现是同步的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆