QT Bluetooth Peripheral and Central role possible?

只愿长相守 提交于 2021-01-29 05:17:45

问题


I'm running a programm on a Raspberry Pie which is based on QT and uses a bluetooth adapter to connect to some peripheral devices as a central role. I also have another device, which only can act as a Central bluetooth device and needs to be connected to my Raspberry.

Is it possible with QT to first build a connection to my second device by advertising itself and acting as a peripheral, and afterwards swaping to central mode, to connect to the other devices?

I didn't find any evidence for or against this. So i hope you guys can help me out.


回答1:


What you want to do is not related to Qt/software, but rather something that depends on the hardware, specifically the version of Bluetooth of your hardware. A device can advertise (act as a peripheral) and scan/connect (act as a central) at the same time if it supports the "LE Dual Mode Topology", which was added in Bluetooth v4.1 (please see figure below).

Therefore, if this is a Raspberry Pi 3 Model B or B+, then it has Bluetooth v4.1 or v4.2 (respectively) built-in and it should be capable of acting as both central and peripheral. If it is an older Raspberry Pi then this depends on the Bluetooth dongle that you attach to it.

I hope this helps.



来源:https://stackoverflow.com/questions/52969765/qt-bluetooth-peripheral-and-central-role-possible

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