Example #1
0
void RfcommClient::connectSocket()
{
    QBluetoothAddress addr = QBluetoothRemoteDeviceDialog::getRemoteDevice(this);

    if (!addr.isValid()) {
        return;
    }

    connectAction->setVisible(false);
    waiter->setText(tr("Connecting..."));
    waiter->setCancelEnabled(true);

    connect(socket, SIGNAL(error(QBluetoothAbstractSocket::SocketError)),
            this, SLOT(connectFailed()));
    socket->connect(QBluetoothAddress::any, addr, 14);
    waiter->show();
}