Interpret Characteristic Properties (iOS and BLE)

家住魔仙堡 提交于 2019-12-13 04:36:49

问题


I am reading characteristic properties from a BLE device from my iPhone.

However, some of the properties I am seeing (like 0xA, 0x22) are not in the enumerated list that Apple provides. Are these properties a combination of 2 or more enumerated values? Or are these custom properties from the manufacturer? Need guidance on this.


回答1:


As you can read in the documentation:

Values representing the possible properties of a characteristic. Since characteristic properties can be combined, a characteristic may have multiple property values set.

In other words, a characteristic may have more than one property. That makes sense as you can, for example, have a characteristic which can be read (CBCharacteristicPropertyRead) and written to (CBCharacteristicPropertyWrite).

In this case the value of CBCharacteristic's properties would be the bitwise OR of CBCharacteristicPropertyRead and CBCharacteristicPropertyWrite, which is 0xA.



来源:https://stackoverflow.com/questions/31768645/interpret-characteristic-properties-ios-and-ble

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!