Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt4 Bluetooth Rfcomm problem I
Forum Updated to NodeBB v4.3 + New Features

Qt4 Bluetooth Rfcomm problem I

Scheduled Pinned Locked Moved General and Desktop
16 Posts 3 Posters 7.0k Views 3 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.
  • C Offline
    C Offline
    cmosneang
    wrote on last edited by
    #1

    Hello,

    I am new to Qt, and I want to make an app on an embedded linux device in Qt4 that send and receives some data throw bluetooth from another device using SPP and RFOMM. I want to use theBT functions from #include<bluetooth/bluetooth.h> and #include<bluetooth/rfcomm.h> which are written in C, but I cannot compile them in Qt Creator.

    So my question is how do I compile these 2 includes in Qt or is there another way to use rfcomm and bluetooth?Thank you very much.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Since you are using linux, did you took a look at the Qt's bluetooth module ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cmosneang
        wrote on last edited by
        #3

        Hello,

        I am new to Qt and from what I have read for Qt 4 I would have to use Qt mobility 1.2 which contains the bluetooth module but I cannot find a valid link to download http://doc-snapshot.qt-project.org/qt-mobility/qtmobility-release-notes.html . I am using Qt 4.8.4 and QtCreator 2.7.1. Thank you

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You can clone it "here":https://qt.gitorious.org/qt-mobility

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • C Offline
            C Offline
            cmosneang
            wrote on last edited by
            #5

            Hello,

            Thanks for the link, I have made a clone, installed it using the steps from http://doc.qt.digia.com/qtmobility/installation.html but QtCreator doesn't recognize it.
            I had installed the Qt Mobility into the QtCreator folder, I see now there is a folder /lib and /include which contains all sort of librarys and headers for Qt Mobility.
            What could be the problem? Thank you

            Here is my .pro file content:

            @#-------------------------------------------------

            Project created by QtCreator 2014-04-27T09:10:17

            #-------------------------------------------------

            QT += core gui

            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

            TARGET = NewBlue
            TEMPLATE = app

            SOURCES += main.cpp
            dialog.cpp

            HEADERS += dialog.h

            FORMS += dialog.ui
            target.path+=/home/root
            INSTALLS+=target

            CONFIG += mobility
            MOBILITY = connectivity@

            And the main.cpp where I have just inserted #include<qbluetoothserviceinfo.h> and #include <qbluetoothsocket.h> from the bttennis example :

            @#include "dialog.h"
            #include <QApplication>
            #include <qbluetoothserviceinfo.h>
            #include <qbluetoothsocket.h>

            QTM_USE_NAMESPACE

            int main(int argc, char *argv[])
            {
            QApplication a(argc, argv);
            Dialog w;
            w.show();

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

            }@

            I get the following error:

            ../NewBlue/main.cpp:3:35: fatal error: qbluetoothserviceinfo.h: No such file or directory
            compilation terminated.
            make: *** [main.o] Error 1
            10:04:41: The process "/usr/bin/make" exited with code 2.
            Error while building/deploying project NewBlue (kit: Sitara AM335x)
            When executing step 'Make'
            10:04:41: Elapsed time: 00:00.

            And here is my .profile file where in the installation I have added the LD_LIBRARY_PATH using gedit from Linux.

            ~/.profile: executed by the command interpreter for login shells.

            This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login

            exists.

            see /usr/share/doc/bash/examples/startup-files for examples.

            the files are located in the bash-doc package.

            the default umask is set in /etc/profile; for setting the umask

            for ssh logins, install and configure the libpam-umask package.

            #umask 022

            if running bash

            if [ -n "$BASH_VERSION" ]; then
            # include .bashrc if it exists
            if [ -f "$HOME/.bashrc" ]; then
            . "$HOME/.bashrc"
            fi
            fi

            set PATH so it includes user's private bin if it exists

            if [ -d "$HOME/bin" ] ; then
            PATH="$HOME/bin:$PATH"
            fi

            QMAKESPEC=/home/claudiu/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/arm-arago-linux-gnueabi/usr/share/qtopia/mkspecs/linux-g++;export QMAKESPEC; # ADDED BY INSTALLER - DO NOT EDIT OR DELETE THIS COMMENT - AB1C36D0-2B62-930A-B1CF-1B15CF69BE47 90FD792D-9FFB-93E9-DFD8-E1F4A2589281

            LD_LIBRARY_PATH=/home/claudiu/qtcreator-2.7.1/lib:$LD_LIBRARY_PATH;export LD_LIBRARY_PATH;

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              For the include part your should use

              @#include <QBluetoothServiceInfo>@

              Did you correctly called "make install" after you have built Qt Mobility ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • C Offline
                C Offline
                cmosneang
                wrote on last edited by
                #7

                Hello,

                This are the exact steps I made:
                source /home/claudiu/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/environment-setup
                cd /home/claudiu/qt-mobility-cmosneangs-qt-mobility2
                ./configure -prefix /home/claudiu/qtcreator-2.7.1
                make
                make install
                cd /home/claudiu
                gedit .profile

                I changed dir to the folder where I have uncompressed the qt-mobility and then I run configure to the folder where the qtcreator is located and make and make install.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Are you cross-compiling it ?

                  You should not install Qt Mobility in Qt Creator, it's not its place

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    cmosneang
                    wrote on last edited by
                    #9

                    Hello,

                    Yes I am writing the application for an ARM Linux Device named Sitara AM335x, I am new to Qt and Linux so where should I install Qt Mobility?

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      Besides your cross-compiled Qt directory. If you have e.g. /usr/local/Trolltech/Qt-Embedded-4.8.6 then install Mobility in /usr/locat/Trolltech/Qt-Mobility-Embedded-4.8.6

                      If you are developing/testing on your computer before building for your ARM board, then you must also compile Qt Mobility for your desktop Qt

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        cmosneang
                        wrote on last edited by
                        #11

                        Hello,

                        So if I use /home/claudiu/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/ where I have the compilers for my ARM board I should install Qt-mobility there and put the LD_LIBRARY_PATH to point to that folder? Even if QtCreator folder is on /home/claudiu/qtcreator-2.7.1?
                        I am not testing on my computer, I am deploying on the board from Qt Creator.
                        Thank you.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Qt Creator is an IDE, it doesn't contain any Qt version to use for developing.

                          Like I said the best if to install it in the same folder where you have your Qt ARM version

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • Kamal BadiK Offline
                            Kamal BadiK Offline
                            Kamal Badi
                            wrote on last edited by Kamal Badi
                            #13

                            hello there,
                            i have the same problem with ti-sdk-am335x-evm-06.00.00.00, does it support qt mobility "Location & position"?? because it didn't work with me !! , the new ti-sdk-am335x-evm-08.00.00.00 is support until QT 5.5 but i need to know how to setup this lib with the ti-sdk-am335x-evm-0x.00.00.00 to enable qt creator to deploy my apps in the EVM, what should i do ??
                            thanks in advance ...

                            Dook

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              Qt Mobility is needed for Qt 4. Qt 5.5 has both Qt Location and Qt Positioning modules

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • Kamal BadiK Offline
                                Kamal BadiK Offline
                                Kamal Badi
                                wrote on last edited by
                                #15

                                hi @SGaist
                                thanks for replying, that mean if i need to use Qt location i must use qt5 rit ?
                                okay sorry but i need to ask this , did the QgeoMap support for offline map work or it just work online with the given servers providers !?

                                Dook

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  Qt Location is indeed a Qt 5 module.

                                  AFAIK, Qt 5 has currently no offline plugin.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  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