Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT bluetooth not working on Raspberry Pi
Forum Updated to NodeBB v4.3 + New Features

QT bluetooth not working on Raspberry Pi

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Avtansh Sharma
    wrote on 28 Jun 2017, 10:06 last edited by Avtansh Sharma
    #1

    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

    J 1 Reply Last reply 28 Jun 2017, 10:46
    0
    • A Avtansh Sharma
      28 Jun 2017, 10:06

      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

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 28 Jun 2017, 10:46 last edited by
      #2

      @Avtansh-Sharma
      Did you try to get a list of all local devices with http://doc.qt.io/qt-5/qbluetoothlocaldevice.html#allDevices ?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply 28 Jun 2017, 11:26
      0
      • J jsulm
        28 Jun 2017, 10:46

        @Avtansh-Sharma
        Did you try to get a list of all local devices with http://doc.qt.io/qt-5/qbluetoothlocaldevice.html#allDevices ?

        A Offline
        A Offline
        Avtansh Sharma
        wrote on 28 Jun 2017, 11:26 last edited by
        #3

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

        1 Reply Last reply
        0

        1/3

        28 Jun 2017, 10:06

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved