zoukankan      html  css  js  c++  java
  • CBCharacteristic

    Identifying a Characteristic

    @property(readonly, nonatomic) CBUUID *UUID
    @property(weak, readonly, nonatomic) CBService *service
    

    Accessing Characteristic Data

    @property(retain, readonly) NSData *value//例如体温检测服务,value为温度
    @property(retain, readonly) NSArray *descriptors//CBDescriptor对象数组,value外的其他值等
    @property(readonly, nonatomic) CBCharacteristicProperties properties//The properties of a characteristic determine how the characteristic’s value and descriptors can be used and accessed. 
    @property(readonly) BOOL isNotifying
    @property(readonly) BOOL isBroadcasted//IOS8以后不使用
    

    Constants

    typedef enum {
       CBCharacteristicPropertyBroadcast  = 0x01 ,
       CBCharacteristicPropertyRead  = 0x02 ,
       CBCharacteristicPropertyWriteWithoutResponse  = 0x04 ,
       CBCharacteristicPropertyWrite  = 0x08 ,
       CBCharacteristicPropertyNotify  = 0x10 ,
       CBCharacteristicPropertyIndicate  = 0x20 ,
       CBCharacteristicPropertyAuthenticatedSignedWrites  = 0x40 ,
       CBCharacteristicPropertyExtendedProperties  = 0x80 ,
       CBCharacteristicPropertyNotifyEncryptionRequired  = 0x100 ,
       CBCharacteristicPropertyIndicateEncryptionRequired  = 0x200 ,
    } CBCharacteristicProperties;
    

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

    1.read,调用readValueForCharacteristic方法,然后数据更新的时候会调用peripheral:didUpdateValueForCharacteristic:error:方法。此时读取value值即可。

    2.write,使用 writeValue:forCharacteristic:type:方法写数据。type值表明是否有response。(没有response的比有response的数值可以更长?)

  • 相关阅读:
    elment ui 日期限制
    javascript中的编码与解码
    vue3 px 转ref
    css 波浪线
    初始化css
    vue 3 的复制功能 vue-clipboard3
    二维数组转一维数组、对象数组互斥去重
    分享几个数组方法
    前端生成图形验证码
    rem自适应布局,移动版
  • 原文地址:https://www.cnblogs.com/zhongriqianqian/p/3983449.html
Copyright © 2011-2022 走看看