1

I am having an issue concerning Bluetooth Low Energy. I am using an iPhone (iOS 6.1) and an Nordic board using the nRF51822 chip. I am currently developing a system where the iPhone and the nRF51822 connect using certain services, then disconnect and reconnect again. However, on the second connection, the nRF51822 uses different services from the first connection.

The problem is that on the second connection, the iPhone discovers the former services of the first connection. I have tested with a TI CC2540 development board and it discovers the new services well. The only solution I have found is to put the central manager to nil and allocate it again to make it work. Nevertheless, it seems kind of a dirty solution, is there a standard (clean) way to deal with this kind of situation?

4

2 回答 2

1

如果您不进行任何绑定,而仅进行配对,那么您将不会遇到此问题。

如果您确实需要绑定,那么解决此问题的最佳方法是使用 SDK 中的绑定管理器。如果您没有使用绑定管理器,您可以尝试使用Service Changed功能并将开始句柄设置为 0x000C,并将结束句柄设置为 0xFFFF。这很可能会触发 iOS 的重新发现,从而找到您的新服务和特性。iOS 将始终寻找服务更改,并在外围设备中启用此功能。

如果您有任何与北欧相关的问题,那么您可以将它们发布在位于https://devzone.nordicsemi.com/的问答论坛上

BR 帕尔

于 2013-11-12T14:20:19.030 回答
0

当您向 ble 设备发起配对请求并发现服务/特征时,服务和特征会缓存在 iOS 端。如果您对此感到担忧,请不要执行配对请求。然后只需传入您实际想要发现的服务数组(不是零)。

(旁注:让 ble 设备控制 iOS 设备可以看到哪些服务的整个事情似乎真的很混乱......你应该在 iOS 端控制它。)

于 2013-10-23T18:00:47.393 回答