2013-03-25 19 views
2

在CoreBluetooth應用程序中,我想從通知切換到指示,以便我可以確保數據在另一端接收。我如何獲得CBCharacteristicPropertyIndi​​cate的特性?

在Apple的示例代碼BTLE Central Peripheral Transfer中,我嘗試用CBCharacteristicPropertyIndicate代替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 

所以看起來中心只得到了第一個消息,然後僅此而已。 你們有沒有人知道我做錯了什麼,以及如何獲得適應症?

回答

0

嗯,也許你需要承認你已經閱讀它,然後才能收到更多?一次只能進行一次傳輸。

+0

我也檢查過,沒有API來確認收到價值更新。 – 2013-03-26 15:56:30