CF出现这个字母lol出现unknown error_error-2

常见异常_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
上传于||文档简介
&&java常见异常
阅读已结束,如果下载本文需要使用0下载券
想免费下载更多文档?
定制HR最喜欢的简历
下载文档到电脑,查找使用更方便
还剩12页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢ios - CoreBluetooth[WARNING] Unknown error: 2 - Stack Overflow
to customize your list.
Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
J it only takes a minute:
I'm developing a BLE app in iOS6. I got CoreBluetooth[WARNING] Unknown error: 2 when I call readValueForCharacteristic on a characteristic after it's set to notifying state.
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error`
The delegate callback gets called with an unknown error from NSLog: `Error updating value for characteristic Unknown (&fef2&) error: Error Domain=CBErrorDomain Code=0 "Unknown error." UserInfo=0x1dd3b7e0 {NSLocalizedDescription=Unknown error.}
Please give some advice.
18.8k75188
From what I can tell, you cannot read the value of a characteristic that is set to notify.
You need to "subscribe" to notifications for that characteristic:
[peripheral setNotifyValue:YES forCharacteristic:characteristic];
The value can then be read in your delegate method:
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
The BLE docs for iOS are quite poor in this regard.
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .24719
Stack Overflow works best with JavaScript enabled

参考资料

 

随机推荐