ios - 如何使 CBCharacteristic Property Indicate 的特征发挥作用?

标签 ios objective-c core-bluetooth bluetooth-lowenergy

在 CoreBluetooth 应用程序中,我想从通知切换到指示,以便我可以确保另一端收到数据。

在Apple的示例代码中BTLE Central Peripheral Transfer ,我尝试用 CBCharacteristicPropertyIndi​​cate 替换 CBCharacteristicPropertyNotify。那行不通。外设记录:

2013-03-24 18:50:34.412 BTLE Transfer[15346:907] self.peripheralManager powered on.
2013-03-24 18:50:38.436 BTLE Transfer[15346:907] Central subscribed to characteristic
2013-03-24 18:50:38.440 BTLE Transfer[15346:907] Sent: Here is a bunch of s
2013-03-24 18:50:38.442 BTLE Transfer[15346:907] Sent: ample text. Hold ano
2013-03-24 18:50:38.444 BTLE Transfer[15346:907] Sent: ther device close to
2013-03-24 18:50:38.446 BTLE Transfer[15346:907] Sent:  see the transfer ha
2013-03-24 18:50:38.448 BTLE Transfer[15346:907] Sent: ppen.
2013-03-24 18:50:38.450 BTLE Transfer[15346:907] Sent: EOM

中央记录:

2013-03-24 18:50:19.209 BTLE Transfer[7331:c07] Scanning started
2013-03-24 18:50:37.998 BTLE Transfer[7331:c07] Discovered iPhone at -34
2013-03-24 18:50:37.999 BTLE Transfer[7331:c07] Connecting to peripheral <CBConcretePeripheral: 0x7591840 UUID = <CFUUID 0x7590780> 6A73BF68-01C9-B751-31D5-916297EC1932, Name = "iPhone", IsConnected = NO>
2013-03-24 18:50:38.001 BTLE Transfer[7331:c07] Discovered iPhone at -34
2013-03-24 18:50:38.030 BTLE Transfer[7331:c07] Peripheral Connected
2013-03-24 18:50:38.032 BTLE Transfer[7331:c07] Scanning stopped
2013-03-24 18:50:39.069 BTLE Transfer[7331:c07] Notification began on <CBConcreteCharacteristic: 0x75868a0>
2013-03-24 18:50:39.071 BTLE Transfer[7331:c07] Received: Here is a bunch of s

看来中央只收到了第一条消息,然后就没有了。 你们有人知道我做错了什么,以及如何让指示起作用吗?

最佳答案

嗯,也许您需要承认您已阅读过它,然后才能收到更多内容?一次只能进行 1 笔转账。

关于ios - 如何使 CBCharacteristic Property Indicate 的特征发挥作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15621245/

相关文章:

ios - 如何在 Storyboard 创建的标签栏 Controller 上编写代码?

javascript - 我可以使用Safari移动用户代理自动执行Apple Pay吗

ios - iOS 上的低功耗蓝牙数据传输

iOS:低功耗蓝牙:一个物理设备,不同连接的不同服务 -> 麻烦?

iOS 7 TableView 在 ViewController 和 NavigationBar 中的模糊效果

html - 表单不会缩小到我的 iPhone 屏幕的宽度

ios - 在不使用位置服务IOS的情况下获取后台位置

iphone - UIDatePicker 语言环境什么都不做?

iphone - 如何在iOS5中使用CIColorMatrix?

iOS Core 蓝牙状态保存和恢复问题