QT蓝牙外围设备和中央设备可能有作用吗? [英] QT Bluetooth Peripheral and Central role possible?

查看:83
本文介绍了QT蓝牙外围设备和中央设备可能有作用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在基于QT的Raspberry Pie上运行一个程序,该程序使用蓝牙适配器作为中心角色连接到某些外围设备.我还有另一台设备,该设备只能用作中央蓝牙设备,需要连接到我的Raspberry.

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.

QT是否可以通过宣传自己并充当外围设备来首先建立与第二台设备的连接,然后再转换为中央模式以连接到其他设备?

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.

推荐答案

您要执行的操作与Qt/软件无关,而是与硬件相关的事情,具体取决于硬件的蓝牙版本.如果设备支持在蓝牙v4.1中添加的"LE Dual Mode Topology"(请参见下图),则该设备可以同时做广告(充当外围设备)并扫描/连接(充当中央设备).

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).

因此,如果这是Raspberry Pi 3 Model B或B +,则它内置了Bluetooth v4.1或v4.2(分别),并且应该能够同时充当中央和外围设备.如果是较旧的Raspberry Pi,则取决于您连接到它的Bluetooth加密狗.

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.

我希望这会有所帮助.

这篇关于QT蓝牙外围设备和中央设备可能有作用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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