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. Serial port connection and qt
Forum Updated to NodeBB v4.3 + New Features

Serial port connection and qt

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 5 Posters 6.9k 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.
  • K Offline
    K Offline
    ksiedzulek
    wrote on last edited by
    #1

    hi, i can't find example how to send datas over SPP:/

    now i have write simple console app:

    @#include <QtCore/QCoreApplication>
    #include <QtMobility/qmobilityglobal.h>
    #include <qbluetoothsocket.h>
    #include <QDebug>

    QTM_USE_NAMESPACE

    int main(int argc, char *argv[])
    {

    QCoreApplication a(argc, argv);
    
    
    QBluetoothSocket socket(QBluetoothSocket::RfcommSocket) ;
    socket.connectToService(QBluetoothAddress("00:12:6F:XX:XX:XX"),1);
    
    qDebug()<<socket.peerName() ;
    return a.exec&#40;&#41;;
    

    }@

    and this code connect me with my bluetooth module, but how to send datas? I have tried "socket.write(const char * data, qint64 maxSize) but it is not working:/

    1 Reply Last reply
    0
    • F Offline
      F Offline
      favoritas37
      wrote on last edited by
      #2

      The "Bluetooth Chat Example":http://doc.qt.nokia.com/qtmobility/btchat.html is en example on how to use the SPP since you send data to others through serial port.

      It is quite well written but if you still have any question just ask.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        ksiedzulek
        wrote on last edited by
        #3

        thx for reply. I started with Bluetooth Chat Example and btscanner:)..I implemented a simple code on my AVR which works as follows: I send "char" and microcontroller return "[char]" and my code works-I have checked it with minicom.

        ....and 3 minutes ago I have changed btchatexample and it works! I don't know why I had prooblem with that:) please follow these topic, because I think I will have some problem in near future:)...oh, i see one: some chars are not returned in longer words:/..but I thing I will deal with that.

        1 Reply Last reply
        0
        • - Offline
          - Offline
          -pZq-
          wrote on last edited by
          #4

          Hello, could you please share me your code.
          I have been playing around with QT quick components bluetooth that is very simple. I allthough seems that i can send a long string from N9 to PC terminal, from BluetoothModule (controlled by dsPic) to PC terminal, from Terminal to Bluetooth module BUT NOT FROM N9 to Bluetooth module. I haven't tried sending data from BT module to N9 since i do not need that for now. I read somewhere that the QT quick => QTconnectivity bluetooth component uses some data type that can be handled by most devices, but maybe there is something that either my dsPIC wont understand => Or the BT module that uses RN-41 chip.

          I have a working example for E72 (symbian 3rd) that works with the BT module but that code does not use any ready components (QT quick, connectivity etc...)

          If you are willing to share your code i would appreciate it. I tried once the BT chat example but it didn't work...
          either to peter@lydman.fi or in this forum...

          Br.
          pZq

          1 Reply Last reply
          0
          • P Offline
            P Offline
            praveen0991kr
            wrote on last edited by
            #5

            Hello All,
            I am working on the same part of Qt if some has done pls do help I will be thankful.
            My Email: praveen0991kr@gmail.com

            praveen

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cygnus2k
              wrote on last edited by
              #6

              Hi!
              I'm working on a project that need to capture data from a Bluethoot digital scale, which in theory send me the SPP protocol. Take the example of btchat, but do not understand how do you hear any connection. I tried with other applications bluetooth serial terminal type and receive data, but not how to implement it here. Thank you

              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