Solved What is the correct way to create a bluetooth server?
-
Hi.
I am trying to follow the steps indicated in the following thread:
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:
Thanks for any help.
-
Hi! In C++ you need to declare a variable before you can use it. So, something like:
QBluetoothServer *rfcommServer = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this);
-
Ok. Thanks.
I must remember my C ++ classes from many years ago.
QBluetoothServer *rfcommServer; rfcommServer = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this);