zoukankan      html  css  js  c++  java
  • Characteristics with cached values must be read-only

    在用CoreBluetooth 做蓝牙数据传输时,把设备设为周边设备报此错误:

    Characteristics with cached values must be read-only

     

    经查询是因为在构造 Characteristic 时设置了 Value,根据官方说明,当Value 不是nil 时,只能设置为只读状态。

     

    Note: If you specify a value for the characteristic, the value is cached and its properties and permissions are set to be readable. Therefore, if you need the value of a characteristic to be writeable, or if you expect the value to change during the lifetime of the published service to which the characteristic belongs, you must specify the value to be nil. Following this approach ensures that the value is treated dynamically and requested by the peripheral manager whenever the peripheral manager receives a read or write request from a connected central

  • 相关阅读:
    Python-手动安装第三方包
    SQL SERVER-根据jobID查job
    python-包模块等概念
    锁表
    Python-try异常捕获
    胶水语言
    C++之多态性与虚函数
    android
    开源许可协议
    hal
  • 原文地址:https://www.cnblogs.com/1oo1/p/4089697.html
Copyright © 2011-2022 走看看