748***28@qq.com 最新主题

推荐阅读

1 2174 2017-05-25
本帖最后由 748***28@qq.com 于 2017-05-25编辑

我使用 BrtBeacon 505, major  16160. 读取到 characteristic.properties 为 6, 和苹果官方定义的 properties 给定的数值不一样. 这是为什么? 然后, 如果我想要改变这个设备的 properties 为其他状态, 可以怎么修改?

0

1条回复

沙发
//这是苹果的特征的定义枚举,可以组合的,2+4=6
typedef NS_OPTIONS(NSUInteger, CBCharacteristicProperties) {
    CBCharacteristicPropertyBroadcast                                               = 0x01,
    CBCharacteristicPropertyRead                                                    = 0x02,
    CBCharacteristicPropertyWriteWithoutResponse                                    = 0x04,
    CBCharacteristicPropertyWrite                                                   = 0x08,
    CBCharacteristicPropertyNotify                                                  = 0x10,
    CBCharacteristicPropertyIndicate                                                = 0x20,
    CBCharacteristicPropertyAuthenticatedSignedWrites                               = 0x40,
    CBCharacteristicPropertyExtendedProperties                                      = 0x80,
    CBCharacteristicPropertyNotifyEncryptionRequired NS_ENUM_AVAILABLE(NA, 6_0)     = 0x100,
    CBCharacteristicPropertyIndicateEncryptionRequired NS_ENUM_AVAILABLE(NA, 6_0)   = 0x200
};


0