我正在从我的 iPhone 读取 BLE 设备的特征属性。
但是,我看到的某些属性(如 0xA、0x22)不在 Apple 提供的枚举列表中。这些属性是 2 个或更多枚举值的组合吗?或者这些自定义属性来自制造商?需要这方面的指导。
最佳答案
正如您在 documentation 中所读到的那样:
Values representing the possible properties of a characteristic. Since characteristic properties can be combined, a characteristic may have multiple property values set.
换句话说,一个特性可能有多个属性。这是有道理的,例如,具有可以读取 (CBCharacteristicPropertyRead
) 和写入 (CBCharacteristicPropertyWrite
) 的特性。
在这种情况下,CBCharacteristic
的 properties
的值将是 CBCharacteristicPropertyRead
和 CBCharacteristicPropertyWrite
的按位或,即 0xA
。
关于ios - 解释特征属性(iOS 和 BLE),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31768645/