Unsolved QT bluetooth not working on Raspberry Pi
-
Hi,
I ran following code on Raspbian .
Hardware:- Raspberry Pi3#include <QCoreApplication>
#include <QBluetoothAddress>
//#include <QBluetoothLocalDevice>
#include <QDebug>
#include <qbluetoothlocaldevice.h>
int main(int argc, char *argv[])
{QCoreApplication a(argc, argv);
QBluetoothLocalDevice aa;
aa.powerOn();
qDebug()<<"name:"<<aa.name();
qDebug()<<aa.address().toString();qDebug()<<"hi";
}Output is:-
name: ""
"00:00:00:00:00:00"
hi--
Regards,
Avtansh Sharma -
@Avtansh-Sharma
Did you try to get a list of all local devices with http://doc.qt.io/qt-5/qbluetoothlocaldevice.html#allDevices ? -
@jsulm I tried using link
QBluetoothLocalDevice aa;
aa.powerOn();
QList<QBluetoothHostInfo> b;b=aa.allDevices();
b had zero count. i.e QT was unable to detect any device.