首页 > 系统服务 > 详细

Characteristics with cached values must be read-only

时间:2014-11-11 18:01:53      阅读:151      评论:0      收藏:0      [点我收藏+]

在用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

Characteristics with cached values must be read-only

原文:http://www.cnblogs.com/1oo1/p/4089697.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!