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. How to open /dev/rfcomm0
Forum Updated to NodeBB v4.3 + New Features

How to open /dev/rfcomm0

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 4.5k Views 1 Watching
  • 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.
  • N Offline
    N Offline
    Naouali
    wrote on last edited by
    #1

    Hi
    I want to get my location from a gps Bluetooth device . First i create a connexion with the device using Bluetooth manager which create a /dev/rfcomm0 then i tested this ode but it didn't seems to open the device :
    @
    #include <QtCore/QCoreApplication>
    #include <QFile>
    #include <QDebug>

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);
    QFile file("/dev/rfcomm0");
    if (file.open(QFile::ReadOnly)) {
    qDebug() << "yatta";
    }
    else qDebug() << ":(";

    return a.exec&#40;&#41;;
    

    }@
    this is the output i get :
    @Starting /home/morpheus/Qtproject/gps-build-desktop/gps...
    :( @
    I m planning on using the QNmeaPositionInfoSource class to get all necessary infos .

    Thanks in advance .

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      I have no idea on how to use the proposed API but as for the QFile problem, the first thing to do is check that your user has sufficient permissions to open /dev/rfcomm0.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • N Offline
        N Offline
        Naouali
        wrote on last edited by
        #3

        And if the user doesn't have permission is it possible to give him permission to open file using Qt?

        1 Reply Last reply
        0
        • H Offline
          H Offline
          harbaum
          wrote on last edited by
          #4

          I've once tried to feed the raw NMEA data of my BT GPS through QNmeaPositionInfoSource without much success. I recently wrote gpsdpositioninfosource as part of cacheme which you'll find "here":https://api.pub.meego.com/public/source/home:harbaum/cacheme/cacheme_0.7.1.tar.gz?rev=f6f5ba90aa3bf9e217cadc7d212e0291&

          This connects to gpsd which in turn can access your bluetooth gps via /dev/rfcomm

          1 Reply Last reply
          0
          • N Offline
            N Offline
            Naouali
            wrote on last edited by
            #5

            That's great , i m actually working on meego using BT GPS device , i hope it will help me :)

            1 Reply Last reply
            0

            • Login

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