简体   繁体   English

如何将运动追踪器hrm(心率监测器)与iOS应用程序连接

[英]How to connect Sports tracker hrm(heart rate monitor) with iOS app

I need to develop an iOS app which can connect to any heart rate monitor ble device and measure heart rate. 我需要开发一个iOS应用程序,它可以连接任何心率监测设备并测量心率。 I have used core Bluetooth framework and CBCentral class for interacting to hrm device. 我使用了核心蓝牙框架和CBCentral类来与hrm设备进行交互。 I got success for measuring heart rate using "wahoo blue hr" hrm device but i am facing problem with sports tracker hrm device. 我使用“wahoo blue hr”hrm设备测量心率是成功的,但我面临运动追踪器hrm设备的问题。

When i scanned the hrm devices it was always giving me an error "Bluetooth is currently powered off" even if bluetooth switched on. 当我扫描hrm设备时,即使蓝牙开启,它总是给我一个错误“蓝牙当前已断电”。

So below are my queries, 以下是我的疑问,

  1. How can i scan and connect sports tracker hrm device? 如何扫描和连接运动追踪器hrm设备?

  2. What are the UUIDs of services for sports tracker hrm devices those can become useful for connecting to device and getting data from it? 运动跟踪器人力资源设备的UUID服务有哪些可用于连接设备和从中获取数据?

  3. Is there any api or blog available for developing sports tracker hrm iOS app? 是否有任何api或博客可用于开发体育跟踪器hrm iOS应用程序?

If any one have developed this kind of iOS app then please guide me. 如果有人开发了这种iOS应用程序,那么请指导我。

Thanks in advance 提前致谢

I have never heard of the Sports Tracker Heart Rate Monitor, but I highly suggest you check out the Apple Heart Rate Monitor sample app (yeah it's for osx, but the same principals apply for corebluetooth). 我从未听说过运动追踪器心率监测器,但我强烈建议您查看Apple Heart Rate Monitor样本应用程序 (是的,它适用于osx,但相同的原则适用于corebluetooth)。

As for the warning you're getting, you need to wait for the callback in centralManagerDidUpdateState: before you can call scan, retrieve, connect etc. 至于你得到的警告,你需要等待centralManagerDidUpdateState:的回调centralManagerDidUpdateState:然后才能调用扫描,检索,连接等。

Refer to this previous question: 请参阅上一个问题:

When would CBCentralManager's state ever be powered on but still give me a "not powered on" warning? 什么时候CBCentralManager的状态会启动,但仍然给我一个“未启动”警告?

As for figuring out what services the Heart Rate Monitor supports, you should simply connect to it and discover all services and characteristics. 至于确定Heart Rate Monitor支持哪些服务,您只需连接到它并发现所有服务和特征。 Assuming the device is connectable (and advertising), you only need to scan for nil, connect to the heart rate monitor, and then discover all services by once again supplying nil. 假设设备是可连接的(并且是广告),您只需要扫描nil,连接到心率监视器,然后再次提供nil来发现所有服务。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM