[Interest] Bluetooth for Linux

Shahzad Khan shahzad at gmail.com
Tue Oct 27 15:37:34 CET 2015


I am struggling with making bluetooth scanner demo work for linux. I have
installed BlueZ on my Ubuntu virtual machine via

sudo apt-get install libbluetooth-dev

But when I run the btscanner demo, the 'scan' button comes out disabled. I
don't get any warnings or errors but I can never scan.I have also tried the
following code in separate project but it doesn't find any bluetooth
devices.

void MyClass::startDeviceDiscovery(){

    // Create a discovery agent and connect to its signals
    QBluetoothDeviceDiscoveryAgent *discoveryAgent = new
QBluetoothDeviceDiscoveryAgent(this);
    connect(discoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)),
            this, SLOT(deviceDiscovered(QBluetoothDeviceInfo)));

    // Start a discovery
    discoveryAgent->start();

    //...}
// In your local slot, read information about the found devicesvoid
MyClass::deviceDiscovered(const QBluetoothDeviceInfo &device){
    qDebug() << "Found new device:" << device.name() << '(' <<
device.address().toString() << ')';}


My question is how can I make bluetooth work for linux? How do I wire up Qt
to use BlueZ? I hear about Qdbus as well but I don't know exactly how does
that fit in the picture since the demos don't seem to use it.

I am using Ubuntu 4.04 and BlueZ version 4.11 which I believe is supported
by Qt. I am new to linux world though.

Any tips would be greatly appreciated. Thanks

Shahzad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151027/a8a380ab/attachment.html>


More information about the Interest mailing list