BLE外围设备:连接时进行扫描 [英] BLE peripheral: scanning while connected

查看:225
本文介绍了BLE外围设备:连接时进行扫描的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在连接到中央服务器时是否可以对广告进行外围扫描?似乎正在扫描广告连接外围设备,但我需要同时进行这两项操作.外围设备应该能够从它收到的广告中报告RSSI测量值.

Is it possible to make a peripheral scan for advertisments while connected to a central? It seems like it is either scanning for advertisments or have your peripheral connected but I need to do both. The peripheral should be able to report RSSI measurements from advertisements it picks up.

我在外围设备上使用'bleno',在Linux机器(bluez)上使用'noble'扫描

I'm using 'bleno' for the peripheral and 'noble' for the scanning on a linux box (bluez)

推荐答案

答案取决于设备所使用的蓝牙版本.

The answer to this differs depending on the version of Bluetooth that your device is on.

对于蓝牙v4.0:

无论是否处于连接状态,外围设备都无法扫描.外设只能发送广告或接受传入的连接.有关更多信息,请参见第18页该文档:-

A peripheral cannot scan at all, whether in a connection or not. The peripheral can only send out adverts or accept incoming connections. For more information you can have a look at this document, page 18:-

http://chapters.comsoc.org/vancouver/BTLER3.pdf

从Bluetooth v4.1开始:

设备可以同时扮演中心角色和外围角色.言外之意,这意味着,如果外围设备连接到中央设备,它仍可以在中央模式"下扫描设备.有关更多信息,请参见第5页的链接:-

A device can be in central and peripheral role at the same time. By implication, this means that if a peripheral is connected to a central device, it can still scan for devices in it's "central mode". More information can be found in this link, page 5:-

http://www.ietf.org/议事录/89/slides/slides-89-6lo-4.pdf

因此,总而言之,如果您的设备是BT v4.1或更高版本,则取决于芯片制造商;如果它是v4.0,则取决于芯片制造商,因为蓝牙规范不允许这样做.

So in conclusion, if your device is BT v4.1 or newer, then this is dependant on the chip manufacturer, and if it is v4.0, then no, because the Bluetooth specification does not allow it.

这篇关于BLE外围设备:连接时进行扫描的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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