Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. What is the correct way to create a bluetooth server?
Forum Updated to NodeBB v4.3 + New Features

What is the correct way to create a bluetooth server?

Scheduled Pinned Locked Moved Solved C++ Gurus
3 Posts 2 Posters 1.0k 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.
  • DominusDRRD Offline
    DominusDRRD Offline
    DominusDRR
    wrote on last edited by
    #1

    Hi.

    I am trying to follow the steps indicated in the following thread:

    link text

    I am trying to create a bluetooth server as follows:

    #include <QBluetoothServer>
    
     rfcommServer = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this);
     connect(rfcommServer, SIGNAL(newConnection()), this, SLOT(clientConnected()));
     QBluetoothSocket *socket = rfcommServer->nextPendingConnection();
    

    But I get the following error:

    alt text

    Thanks for any help.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      Hi! In C++ you need to declare a variable before you can use it. So, something like:

      QBluetoothServer *rfcommServer = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this);
      
      1 Reply Last reply
      1
      • DominusDRRD Offline
        DominusDRRD Offline
        DominusDRR
        wrote on last edited by
        #3

        Ok. Thanks.

        I must remember my C ++ classes from many years ago.

        QBluetoothServer *rfcommServer; 
         rfcommServer = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this);
        
        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