BLE peripheral: scanning while connected

谁都会走 提交于 2019-12-23 22:54:19

问题


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.

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


回答1:


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

For Bluetooth v4.0:

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

For Bluetooth v4.1 onwards:

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/proceedings/89/slides/slides-89-6lo-4.pdf

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.



来源:https://stackoverflow.com/questions/33988250/ble-peripheral-scanning-while-connected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!