我可以衡量的iOS蓝牙信号强度? [英] Can I measure Bluetooth signal strength in iOS?

查看:779
本文介绍了我可以衡量的iOS蓝牙信号强度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道我能测量内我的iPhone内的蓝牙设备的信号强度。基本上我想要做的就是扫描范围内的设备列表,然后看看哪一个具有最高的信号强度。是否有可能在iOS和我会怎么做,如果这样呢?

I was wondering can I measure the signal strength of Bluetooth devices within range of my iPhone. Basically what I want to do is scan for a list of devices within range, and then see which one has the highest signal strength. Is it possible in iOS and how would I do it if so?

推荐答案

是的,有来衡量低功耗蓝牙(4.0)的信号强度是RSSI的数量的方法。当您扫描的外设,你会设置标志CBCentralManagerScanOptionAllowDuplicatesKey为YES,如下所示:

Yes there is a way to measure the signal strength for Bluetooth Low Energy (4.0) it is the RSSI number. When you scan for peripherals you will set the flag CBCentralManagerScanOptionAllowDuplicatesKey to YES as shown below:

NSDictionary * dictionary = [NSDictionary dictionaryWithObjectsAndKeys:@YES, CBCentralManagerScanOptionAllowDuplicatesKey, nil];

// Start scanning for peripherals
[cmanager scanForPeripheralsWithServices:nil options:dictionary];

如果你想看到的RSSI数工作,而无需编写任何code,你应该检查应用程序的 LightBlue 在iTunes中。当您连接到外设,它会显示你更新的数字RSSI每秒钟在连接时。

If you want to see the RSSI number work without writing any code you should check out the app LightBlue in iTunes. When you connect to a peripheral it will show you the updated RSSI number every second when it is connected.

这篇关于我可以衡量的iOS蓝牙信号强度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆