简体   繁体   English

Iphone(ios 5.0)低功耗蓝牙:无法从设备获取数据

[英]Iphone(ios 5.0) Bluetooth Low Energy: can not get data from the device

I got the bluetooth low energy Heart Rate Monitor working using corebluetooth.framework on IOS 5.0. 我在IOS 5.0上使用corebluetooth.framework获得了蓝牙低功耗心率监测器。 But some times I get the following problems. 但是有时候我会遇到以下问题。

1) Sometimes when I start the scan (with scanForPeripheralsWithServices method), It can not discover any BLE(Bluetooth Low Energy) devices until I turn off and turn on the Iphone Bluetooth manually. 1)有时,当我开始扫描时(使用scanForPeripheralsWithServices方法),直到我关闭并手动打开Iphone蓝牙后,它才能发现任何BLE(低功耗蓝牙)设备。 Occasionaly I had to reboot the phone also if the bluetooth turn off and turn on did not work. 有时,如果蓝牙关闭然后再打开也不起作用,我也不得不重启手机。

2) Sometimes When I try to connect to the device for which I have stored the UUID previously, I was able to connect to the device, ie, didConnectPeripheral delegate method was called but It never discovers any services even though I call [peripheral discoverServices:nil] ie, I am not getting any data from the device in the delegate method didDiscoverServices . 2)有时,当我尝试连接到之前为其存储UUID的设备时,我能够连接到该设备,即, 调用了didConnectPeripheral委托方法,但是即使我调用了[peripheral discoverServices: [nil],即在委托方法didDiscoverServices中没有从设备获取任何数据。 For this also I had to reboot the phone. 为此,我也不得不重启手机。

Try checking the archives here: http://lists.apple.com/archives/bluetooth-dev 尝试在此处检查档案: http : //lists.apple.com/archives/bluetooth-dev

and if you don't find it, send the question there. 如果找不到,请在此处发送问题。 Many Apple Bluetooth engineers answer questions on that mailing list. 许多Apple蓝牙工程师在该邮件列表中回答问题。

1) It has something to do with the pairing routine on bluetooth low energy and the iPhone. 1)与蓝牙低功耗和iPhone上的配对例程有关。 The iPhone changes its ID every interval, I don't know how often, but it does. iPhone会每隔一段时间更改一次ID,我不知道多久更改一次,但确实如此。 Have you tried just resetting/rebooting the slave device? 您是否尝试过仅重置/重启从设备? This often works for me. 这通常对我有用。 The slave device also has a limited broadcast period, eg 20-30 seconds. 从设备还具有有限的广播周期,例如20-30秒。

2) Again, check that you have reset the slave. 2)再次,检查是否已重置从站。 I don't know if you have built the device your self or bought a heart rate belt, but this is most often the solution. 我不知道您是自己构建设备还是购买心率传输带,但这通常是解决方案。 Oh and by the way, I had an issue where the didDiscoverServices actually jumped over an if-sentence, where I checked for a specific service. 哦,顺便说一句,我遇到了一个问题,那就是didDiscoverServices实际上跳过了if语句,在那儿我检查了特定的服务。 This did not fix it self until I rebooted the phone. 直到我重新启动手机后,它才能自行修复。 Really weird behaviour, but I haven't found any other solution to this yet. 确实很奇怪,但是我还没有找到其他解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以每 5 秒从 Android/iOS 设备广播蓝牙低功耗 20 KB 数据吗? - Can I broadcast bluetooth low energy 20 KB data every 5 seconds from Android/iOS device? 如何使用Qt从iOS连接到蓝牙低功耗设备? - How to connect to a Bluetooth low energy device from iOS with Qt? iOS蓝牙低功耗与外部设备的连接 - iOS Bluetooth Low Energy connection with external device 蓝牙低功耗作为iOS设备的要求? - Bluetooth Low Energy as an iOS device requirement? 如何从 swift 4 中的蓝牙低功耗设备获取广告和响应数据? - How to get advertisement and response data from a bluetooth low energy device in swift 4? 解释iOS代码以在Android上获取Bluetooth Low Energy数据 - Interpreting iOS code to get Bluetooth Low Energy data on Android 如何在iOS上使用BLE(蓝牙低功耗)从人体秤以CBPeripheral形式获取数据 - How to get data from body scale as CBPeripheral using BLE (Bluetooth Low Energy) on iOS iOS上的蓝牙低功耗数据传输 - Bluetooth Low Energy data transmission on iOS 您可以在没有应用程序的情况下将低功耗蓝牙设备连接到iPhone吗? - Can you have a Bluetooth Low Energy device connect to an iPhone without an App iOS:低能耗蓝牙设备的特性值错误? - iOS: wrong value for characteristic with low energy bluetooth device?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM