Mik*_*ike 7 ios core-bluetooth
在iOS CBC特性类参考中,有一个用于返回特征属性的位图的描述.我正在寻找有关其中三个含义的信息.
文档列出如下:
CBCharacteristicProperties
特征的可能属性.
enum {
CBCharacteristicPropertyBroadcast = 0x01,
CBCharacteristicPropertyRead = 0x02,
CBCharacteristicPropertyWriteWithoutResponse = 0x04,
CBCharacteristicPropertyWrite = 0x08,
CBCharacteristicPropertyNotify = 0x10,
CBCharacteristicPropertyIndicate = 0x20,
CBCharacteristicPropertyAuthenticatedSignedWrites = 0x40,
CBCharacteristicPropertyExtendedProperties = 0x80,
};
Run Code Online (Sandbox Code Playgroud)
我找不到其他文档或这些属性的列表.
有些是显而易见的,如读,写和通知.广播记录在我发现的其他BLE文档中.
CBCharacteristicPropertyWriteWithoutResponse令人困惑.为什么这是旗帜?CBDevice调用writeValue:forCharacteristic:type:有一个接受以下内容的标志:
enum {
CBCharacteristicWriteWithResponse = 0,
CBCharacteristicWriteWithoutResponse,
};
Run Code Online (Sandbox Code Playgroud)
这些标志是多余的,还是必须提供writeValue类型:forCharacteristic:type:匹配CBCharacteristicProperties标志?
此外,CBCharacteristicPropertyIndicate和CBCharacteristicPropertyExtendedProperties是什么意思?
是否有比Apple解释这些内容的文档更好的参考?
我在Apple Developer论坛上得到了这个答案:
它有助于理解潜在的具体情况.如果您查看4.0规范主机卷中的GATT部分(可在此处获取:http://www.bluetooth.org/Technical/Specifications/adopted.htm),常量应该更清晰.
CBCharacteristicPropertyWriteWithoutResponse表示该特征支持"Write without Response"子过程.CBCharacteristicWriteWithoutResponse表示您实际上想要使用"无响应写入"子过程.据推测,尝试在不支持它的特性上使用"无响应写入"子程序将导致错误.希望有所帮助,本
作为后续工作,相关文档是Core Version 4.0.请参见3.3.1.1特性属性.
| 归档时间: |
|
| 查看次数: |
4172 次 |
| 最近记录: |