Пример #1
0
QBluetoothAddress HciManager::addressForConnectionHandle(quint16 handle) const
{
    if (!isValid())
        return QBluetoothAddress();

    hci_conn_info *info;
    hci_conn_list_req *infoList;

    const int maxNoOfConnections = 20;
    infoList = (hci_conn_list_req *)
            malloc(sizeof(hci_conn_list_req) + maxNoOfConnections * sizeof(hci_conn_info));

    if (!infoList)
        return QBluetoothAddress();

    QScopedPointer<hci_conn_list_req, QScopedPointerPodDeleter> p(infoList);
    p->conn_num = maxNoOfConnections;
    p->dev_id = hciDev;
    info = p->conn_info;

    if (ioctl(hciSocket, HCIGETCONNLIST, (void *) infoList) < 0) {
        qCWarning(QT_BT_BLUEZ) << "Cannot retrieve connection list";
        return QBluetoothAddress();
    }

    for (int i = 0; i < infoList->conn_num; i++) {
        if (info[i].handle == handle)
            return QBluetoothAddress(convertAddress(info[i].bdaddr.b));
    }

    return QBluetoothAddress();
}
int QDeclarativeBluetoothServicePrivate::listen() {

    if (m_protocol == "l2cap") {
        QL2capServer *server = new QL2capServer();

        server->setMaxPendingConnections(1);
        server->listen(QBluetoothAddress(), m_port);
        m_port = server->serverPort();
        m_listen = server;
    }
    else if (m_protocol == "rfcomm") {
        QRfcommServer *server = new QRfcommServer();

        server->setMaxPendingConnections(1);
        server->listen(QBluetoothAddress(), m_port);
        m_port = server->serverPort();
        m_listen = server;
    }
    else {
        qDebug() << "Unknown protocol, can't make service" << m_protocol;
    }

    return m_port;

}
void tst_QBluetoothAddress::tst_comparison_data()
{
    QTest::addColumn<QBluetoothAddress>("address1");
    QTest::addColumn<QBluetoothAddress>("address2");
    QTest::addColumn<bool>("result");

    QTest::newRow("invalid == invalid") << QBluetoothAddress() << QBluetoothAddress() << true;
    QTest::newRow("valid != invalid") << QBluetoothAddress(Q_UINT64_C(0x112233445566)) << QBluetoothAddress() << false;
    QTest::newRow("valid == valid") << QBluetoothAddress(Q_UINT64_C(0x112233445566)) << QBluetoothAddress(Q_UINT64_C(0x112233445566)) << true;
}
Пример #4
0
void tst_QL2capServer::tst_listen_data()
{
    QTest::addColumn<QBluetoothAddress>("address");
    QTest::addColumn<quint16>("port");

    QTest::newRow("default") << QBluetoothAddress() << quint16(0);
    QTest::newRow("specified address") << QBluetoothAddress("00:11:B1:08:AD:B8") << quint16(0);
    QTest::newRow("specified port") << QBluetoothAddress() << quint16(24160);
    QTest::newRow("specified address/port") << QBluetoothAddress("00:11:B1:08:AD:B8") << quint16(10);
}
QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const
{
    if (!remoteDevice.isValid())
        return QBluetoothAddress();

    const QString address = remoteDevice.callObjectMethod("getAddress",
                                                          "()Ljava/lang/String;").toString();

    return QBluetoothAddress(address);
}
void tst_QBluetoothLocalDevice::tst_pairingStatus_data()
{
    QTest::addColumn<QBluetoothAddress>("deviceAddress");
    QTest::addColumn<QBluetoothLocalDevice::Pairing>("pairingExpected");

    QTest::newRow("UnPaired Device: DUMMY") << QBluetoothAddress("11:00:00:00:00:00") << QBluetoothLocalDevice::Unpaired;
#ifdef Q_OS_SYMBIAN
    QTest::newRow("UNPAIR Device: BH-604") << QBluetoothAddress("00:0d:3c:b0:77:1c") << QBluetoothLocalDevice::Unpaired;
    QTest::newRow("Paired Device: TESTMACHINE") << QBluetoothAddress("00:09:DD:50:93:DD") << QBluetoothLocalDevice::Paired;
#endif // Q_OS_SYMBIAN
}
Пример #7
0
QBluetoothAddress QBluetoothLocalDevice::address() const
{
    if (!d_ptr)
        return QBluetoothAddress();

    QDBusPendingReply<QVariantMap> reply = d_ptr->adapter->GetProperties();
    reply.waitForFinished();
    if (reply.isError())
        return QBluetoothAddress();

    return QBluetoothAddress(reply.value().value(QLatin1String("Address")).toString());
}
Пример #8
0
QBluetoothAddress QBluetoothLocalDevicePrivate::address()
{
    TBuf<20> bluetoothAddress;
    TPckgBuf<TBTDevAddr> addressPackage;

    TInt error = RProperty::Get(KUidSystemCategory, KPropertyKeyBluetoothGetLocalDeviceAddress, addressPackage);

    if (error != KErrNone)
        return QBluetoothAddress();

    addressPackage().GetReadable(bluetoothAddress, KNullDesC, _L(":"), KNullDesC);

    return QBluetoothAddress(s60DescToQString(bluetoothAddress));
}
static PyObject *meth_QBluetoothServiceInfo_registerService(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = NULL;

    {
        const QBluetoothAddress& a0def = QBluetoothAddress();
        const QBluetoothAddress* a0 = &a0def;
        QBluetoothServiceInfo *sipCpp;

        static const char *sipKwdList[] = {
            sipName_localAdapter,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, NULL, "B|J9", &sipSelf, sipType_QBluetoothServiceInfo, &sipCpp, sipType_QBluetoothAddress, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->registerService(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QBluetoothServiceInfo, sipName_registerService, doc_QBluetoothServiceInfo_registerService);

    return NULL;
}
Пример #10
0
void QBluetoothServerPrivate::controlReply(ppsResult result)
{
    Q_Q(QBluetoothServer);

    if (result.msg == QStringLiteral("register_server")) {
        qCDebug(QT_BT_QNX) << "SPP: Server registration succesfull";

    } else if (result.msg == QStringLiteral("get_mount_point_path")) {
        qCDebug(QT_BT_QNX) << "SPP: Mount point for server" << result.dat.first();

        int socketFD = ::open(result.dat.first().toStdString().c_str(), O_RDWR | O_NONBLOCK);
        if (socketFD == -1) {
            m_lastError = QBluetoothServer::InputOutputError;
            emit q->error(m_lastError);
            qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "RFCOMM Server: Could not open socket FD" << errno;
        } else {
            if (!socket) { // Should never happen
                qCWarning(QT_BT_QNX) << "Socket not valid";
                m_lastError = QBluetoothServer::UnknownError;
                emit q->error(m_lastError);
                return;
            }

            socket->setSocketDescriptor(socketFD, QBluetoothServiceInfo::RfcommProtocol,
                                           QBluetoothSocket::ConnectedState);
            socket->connectToService(QBluetoothAddress(nextClientAddress), m_uuid);
            activeSockets.append(socket);
            socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol, this);
            socket->setSocketState(QBluetoothSocket::ListeningState);
            emit q->newConnection();
        }
    }
}
Пример #11
0
void QBluetoothServerPrivate::setBtCallbackParameters(int receivedSocket)
{
    Q_Q(QBluetoothServer);
    if (receivedSocket == -1) {
        qCDebug(QT_BT_QNX) << "Socket error: " << qt_error_string(errno);
        m_lastError = QBluetoothServer::InputOutputError;
        emit q->error(m_lastError);
        return;
    }
    socket->setSocketDescriptor(receivedSocket, QBluetoothServiceInfo::RfcommProtocol,
                                QBluetoothSocket::ConnectedState,
                                QBluetoothSocket::ReadWrite);
    char addr[18];
    if (bt_spp_get_address(receivedSocket, addr) == -1) {
        qCDebug(QT_BT_QNX) << "Could not obtain the remote address. "
                           << qt_error_string(errno);
        m_lastError = QBluetoothServer::InputOutputError;
        emit q->error(m_lastError);
        return;
    }
    socket->d_ptr->m_peerAddress = QBluetoothAddress(addr);
    activeSockets.append(socket);
    socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol, this);
    socket->setSocketState(QBluetoothSocket::ListeningState);
    emit q->newConnection();
}
Пример #12
0
BluetoothMultiplexer::BluetoothMultiplexer(const QString &address, const QString &service_uuid, QObject *parent)
    : QObject(parent)
    , m_socket(NULL)
    , m_connections()
    , m_connections_nextid(1)
    , m_buffer_in_required(0)
    , m_buffer_in_data()
    , m_buffer_in_version(0)
    , m_buffer_in_type(0)
    , m_buffer_out_data()
{
    qDebug() << this << "Creating";

    m_buffer_out_data.clear();

    m_socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol, this);

    connect(m_socket, &QBluetoothSocket::connected, this, &BluetoothMultiplexer::_connected);
    connect(m_socket, &QBluetoothSocket::disconnected, this, &BluetoothMultiplexer::_disconnected);
    connect(m_socket, &QBluetoothSocket::readyRead, this, &BluetoothMultiplexer::_read);
    connect(m_socket, &QBluetoothSocket::stateChanged, this, &BluetoothMultiplexer::_stateChanged);
    connect(m_socket, static_cast<void(QBluetoothSocket::*)(QBluetoothSocket::SocketError)>(&QBluetoothSocket::error),
            this, &BluetoothMultiplexer::_error);

    processNext(2, &BluetoothMultiplexer::_processInHeader);

    m_socket->connectToService(QBluetoothAddress(address), QBluetoothUuid(service_uuid));
}
/*!
    Returns the remote device address. If setRemoteAddress is not called, the function
    will return default QBluetoothAddress.

*/
QBluetoothAddress QBluetoothServiceDiscoveryAgent::remoteAddress() const
{
    if (d_ptr->singleDevice == true)
        return d_ptr->deviceAddress;
    else
        return QBluetoothAddress();
}
Пример #14
0
void tst_QBluetoothServiceInfo::tst_construction()
{
    const QString serviceName("My Service");
    const QBluetoothDeviceInfo deviceInfo(QBluetoothAddress("001122334455"), "Test Device", 0);

    {
        QBluetoothServiceInfo serviceInfo;

        QVERIFY(!serviceInfo.isValid());
        QVERIFY(!serviceInfo.isComplete());
    }

    {
        QBluetoothServiceInfo serviceInfo;
        serviceInfo.setServiceName(serviceName);
        serviceInfo.setDevice(deviceInfo);

        QVERIFY(serviceInfo.isValid());

        QCOMPARE(serviceInfo.serviceName(), serviceName);
        QCOMPARE(serviceInfo.device().address(), deviceInfo.address());

        QBluetoothServiceInfo copyInfo(serviceInfo);

        QVERIFY(copyInfo.isValid());

        QCOMPARE(copyInfo.serviceName(), serviceName);
        QCOMPARE(copyInfo.device().address(), deviceInfo.address());
    }
}
Пример #15
0
bool ppsReadRemoteDevice(int fd, pps_decoder_t *decoder, QBluetoothAddress *btAddr, QString *deviceName)
{
    char buf[ppsBufferSize * 2];
    char addr_buf[18];

    addr_buf[17] = '\0';

    if (qt_safe_read(fd, &buf, sizeof(buf)) == -1) {
        qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Could not qt_safe_read from pps remote device file";
        return false;
    }

    qCDebug(QT_BT_QNX) << "Remote device" << buf;

    //the address of the BT device is stored at the beginning of the qt_safe_read
    if (buf[0] != '-') {
        memcpy(&addr_buf, &buf[1], 17);
    } else { //The device was removed
        memcpy(&addr_buf, &buf[2], 17);
        return false;
    }

    *btAddr = QBluetoothAddress(QString::fromUtf8(addr_buf));

    if (pps_decoder_parse_pps_str(decoder, buf) == PPS_DECODER_OK) {
        const char* name;
        pps_decoder_push(decoder, 0);

        if (pps_decoder_get_string(decoder, "name", &name) == PPS_DECODER_OK)
            (*deviceName) = QString::fromUtf8(name);

        return true;
    }
    return false;
}
Пример #16
0
//! [Connect to remote service]
void Chat::connectClicked()
{
    ui->connectButton->setEnabled(false);

    // scan for services
    const QBluetoothAddress adapter = localAdapters.isEmpty() ?
                                           QBluetoothAddress() :
                                           localAdapters.at(currentAdapterIndex).address();

    RemoteSelector remoteSelector(adapter);
    remoteSelector.startDiscovery(QBluetoothUuid(serviceUuid));
    if (remoteSelector.exec() == QDialog::Accepted) {
        QBluetoothServiceInfo service = remoteSelector.service();

        qDebug() << "Connecting to service 2" << service.serviceName()
                 << "on" << service.device().name();

        // Create client
        qDebug() << "Going to create client";
        ChatClient *client = new ChatClient(this);
qDebug() << "Connecting...";

        connect(client, SIGNAL(messageReceived(QString,QString)),
                this, SLOT(showMessage(QString,QString)));
        connect(client, SIGNAL(disconnected()), this, SLOT(clientDisconnected()));
        connect(client, SIGNAL(connected(QString)), this, SLOT(connected(QString)));
        connect(this, SIGNAL(sendMessage(QString)), client, SLOT(sendMessage(QString)));
qDebug() << "Start client";
        client->startClient(service);

        clients.append(client);
    }

    ui->connectButton->setEnabled(true);
}
Пример #17
0
QList<QBluetoothHostInfo> QBluetoothLocalDevice::allDevices()
{
    QList<QBluetoothHostInfo> localDevices;

    OrgBluezManagerInterface manager(QLatin1String("org.bluez"), QLatin1String("/"),
                                     QDBusConnection::systemBus());

    QDBusPendingReply<QList<QDBusObjectPath> > reply = manager.ListAdapters();
    reply.waitForFinished();
    if (reply.isError())
        return localDevices;


    foreach (const QDBusObjectPath &path, reply.value()) {
        QBluetoothHostInfo hostinfo;
        OrgBluezAdapterInterface adapter(QLatin1String("org.bluez"), path.path(),
                                         QDBusConnection::systemBus());

        QDBusPendingReply<QVariantMap> reply = adapter.GetProperties();
        reply.waitForFinished();
        if (reply.isError())
            continue;

        hostinfo.setAddress(QBluetoothAddress(reply.value().value(QLatin1String("Address")).toString()));
        hostinfo.setName(reply.value().value(QLatin1String("Name")).toString());

        localDevices.append(hostinfo);
    }

    return localDevices;
}
void tst_QBluetoothTransferRequest::tst_construction_data()
{
    QTest::addColumn<QBluetoothAddress>("address");
    QTest::addColumn<QMap<int, QVariant> >("parameters");

    QMap<int, QVariant> inparameters;
    inparameters.insert((int)QBluetoothTransferRequest::DescriptionAttribute, "Desciption");
    inparameters.insert((int)QBluetoothTransferRequest::LengthAttribute, QVariant(1024));
    inparameters.insert((int)QBluetoothTransferRequest::TypeAttribute, "OPP");

    QTest::newRow("0x000000 COD") << QBluetoothAddress("000000000000") << inparameters;
    QTest::newRow("0x000100 COD") << QBluetoothAddress("000000000000") << inparameters;
    QTest::newRow("0x000104 COD") << QBluetoothAddress("000000000000") << inparameters;
    QTest::newRow("0x000118 COD") << QBluetoothAddress("000000000000") << inparameters;
    QTest::newRow("0x000200 COD") << QBluetoothAddress("000000000000") << inparameters;
}
QBluetoothAddress QBluetoothSocketPrivate::localAddress() const
{
    QString result;
    if (adapter.isValid())
        result = adapter.callObjectMethod("getAddress", "()Ljava/lang/String;").toString();

    return QBluetoothAddress(result);
}
void tst_QBluetoothLocalDevice::tst_pairingStatus_data()
{
    QTest::addColumn<QBluetoothAddress>("deviceAddress");
    QTest::addColumn<QBluetoothLocalDevice::Pairing>("pairingExpected");

    QTest::newRow("UnPaired Device: DUMMY") << QBluetoothAddress("11:00:00:00:00:00")
            << QBluetoothLocalDevice::Unpaired;
}
Пример #21
0
QBluetoothAddress QBluetoothServer::serverAddress() const
{
    Q_D(const QBluetoothServer);
    if (d->socket)
        return d->socket->localAddress();
    else
        return QBluetoothAddress();
}
Пример #22
0
QBluetoothLocalDevice::QBluetoothLocalDevice(const QBluetoothAddress &address, QObject *parent) :
    QObject(parent)
{
    this->d_ptr = new QBluetoothLocalDevicePrivate(this);

    // works since we assume a single local device on QNX
    this->d_ptr->isValidDevice = (QBluetoothLocalDevicePrivate::address() == address
                                  || address == QBluetoothAddress());
}
Пример #23
0
//! [Transfer-1]
void FileTransfer::initTransfer(QString address, QString fileName)
{
    qDebug() << "Begin sharing file: " << address << fileName;
    QBluetoothAddress btAddress = QBluetoothAddress(address);
    QBluetoothTransferRequest request(btAddress);
    QFile *file = new QFile(fileName);
    reply = manager.put(request, file);
    connect(reply, SIGNAL(transferProgress(qint64,qint64)), this, SLOT(updateProgress(qint64,qint64)));
}
void tst_QBluetoothLocalDevice::tst_construction()
{
    QBluetoothLocalDevice localDevice;
    QVERIFY(localDevice.isValid());

    QBluetoothLocalDevice anotherDevice = new QBluetoothLocalDevice(QBluetoothAddress(000000000000));
    QVERIFY(anotherDevice.isValid());
    QVERIFY(anotherDevice.address().toUInt64() != 0);

}
Пример #25
0
/*!
    Finds the path for the local adapter with \a wantedAddress or an empty string
    if no local adapter with the given address can be found.
    If \a wantedAddress is \c null it returns the first/default adapter or an empty
    string if none is available.

    If \a ok is false the lookup was aborted due to a dbus error and this function
    returns an empty string.
 */
QString findAdapterForAddress(const QBluetoothAddress &wantedAddress, bool *ok = 0)
{
    OrgFreedesktopDBusObjectManagerInterface manager(QStringLiteral("org.bluez"),
                                                     QStringLiteral("/"),
                                                     QDBusConnection::systemBus());

    QDBusPendingReply<ManagedObjectList> reply = manager.GetManagedObjects();
    reply.waitForFinished();
    if (reply.isError()) {
        if (ok)
            *ok = false;

        return QString();
    }

    typedef QPair<QString, QBluetoothAddress> AddressForPathType;
    QList<AddressForPathType> localAdapters;

    ManagedObjectList managedObjectList = reply.value();
    for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) {
        const QDBusObjectPath &path = it.key();
        const InterfaceList &ifaceList = it.value();

        for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) {
            const QString &iface = jt.key();

            if (iface == QStringLiteral("org.bluez.Adapter1")) {
                AddressForPathType pair;
                pair.first = path.path();
                pair.second = QBluetoothAddress(ifaceList.value(iface).value(
                                          QStringLiteral("Address")).toString());
                if (!pair.second.isNull())
                    localAdapters.append(pair);
                break;
            }
        }
    }

    if (ok)
        *ok = true;

    if (localAdapters.isEmpty())
        return QString(); // -> no local adapter found

    if (wantedAddress.isNull())
        return localAdapters.front().first; // -> return first found adapter

    foreach (const AddressForPathType &pair, localAdapters) {
        if (pair.second == wantedAddress)
            return pair.first; // -> found local adapter with wanted address
    }

    return QString(); // nothing matching found
}
Пример #26
0
QBluetoothAddress QBluetoothSocketPrivate::peerAddress() const
{
    TBTSockAddr address;
    if(!iSocket)
        {
        // need to return something anyway
        return QBluetoothAddress();
        }
    iSocket->RemoteName(address);
    return qTBTDevAddrToQBluetoothAddress(address.BTAddr());
}
Пример #27
0
void BtLocalDevice::startServiceDiscovery(bool isMinimalDiscovery)
{
    if (serviceAgent) {
        serviceAgent->setRemoteAddress(QBluetoothAddress());

        qDebug() << "###### Starting service discovery process";
        serviceAgent->start(isMinimalDiscovery
                            ? QBluetoothServiceDiscoveryAgent::MinimalDiscovery
                            : QBluetoothServiceDiscoveryAgent::FullDiscovery);
    }
}
void tst_QBluetoothTransferRequest::tst_assignment()
{
    QFETCH(QBluetoothAddress, address);
    QFETCH(tst_QBluetoothTransferRequest_QParameterMap, parameters);

    QBluetoothTransferRequest transferRequest(address);

    foreach (int key, parameters.keys()) {
        transferRequest.setAttribute((QBluetoothTransferRequest::Attribute)key, parameters[key]);
    }

    {
        QBluetoothTransferRequest copyRequest = transferRequest;

        QCOMPARE(copyRequest.address(), address);
        QCOMPARE(transferRequest, copyRequest);
    }

    {
        QBluetoothTransferRequest copyRequest(QBluetoothAddress("000000000001"));

        copyRequest = transferRequest;

        QCOMPARE(copyRequest.address(), address);
        QCOMPARE(transferRequest, copyRequest);
    }

    {
        QBluetoothTransferRequest copyRequest1(QBluetoothAddress("000000000001"));
        QBluetoothTransferRequest copyRequest2(QBluetoothAddress("000000000001"));

        copyRequest1 = copyRequest2 = transferRequest;

        QCOMPARE(copyRequest1.address(), address);
        QCOMPARE(copyRequest2.address(), address);
        QCOMPARE(transferRequest, copyRequest1);
        QCOMPARE(transferRequest, copyRequest2);

    }
}
Пример #29
0
void Bluetooth::requestConnection(void)
{
    if (!m_socket) {
        return;
    }

    if (m_device->isValid()) {
        m_device->powerOn();

        qDebug() << "Connecting...";
        m_socket->connectToService(QBluetoothAddress(m_address), QBluetoothUuid(m_serviceUuid));
    }
}
Пример #30
0
void QBluetoothLocalDevicePrivate::controlEvent(ppsResult result)
{
    qCDebug(QT_BT_QNX) << Q_FUNC_INFO << "Control Event" << result.msg;
    if (result.msg == QStringLiteral("access_changed")) {
        if (__newHostMode == -1 && result.dat.size() > 1
            && result.dat.first() == QStringLiteral("level")) {
            QBluetoothLocalDevice::HostMode newHostMode = hostMode();
            qCDebug(QT_BT_QNX) << "New Host mode" << newHostMode;
            connectedDevices();
            emit q_ptr->hostModeStateChanged(newHostMode);
        }
    } else if (result.msg == QStringLiteral("pairing_complete")) {
        qCDebug(QT_BT_QNX) << "pairing completed";
        if (result.dat.contains(QStringLiteral("addr"))) {
            const QBluetoothAddress address = QBluetoothAddress(
                result.dat.at(result.dat.indexOf(QStringLiteral("addr")) + 1));

            QBluetoothLocalDevice::Pairing pairingStatus = QBluetoothLocalDevice::Paired;

            if (result.dat.contains(QStringLiteral("trusted"))
                && result.dat.at(result.dat.indexOf(QStringLiteral("trusted")) + 1)
                == QStringLiteral("true")) {
                pairingStatus = QBluetoothLocalDevice::AuthorizedPaired;
            }
            qCDebug(QT_BT_QNX) << "pairing completed" << address.toString();
            emit q_ptr->pairingFinished(address, pairingStatus);
        }
    } else if (result.msg == QStringLiteral("device_deleted")) {
        qCDebug(QT_BT_QNX) << "device deleted";
        if (result.dat.contains(QStringLiteral("addr"))) {
            const QBluetoothAddress address = QBluetoothAddress(
                result.dat.at(result.dat.indexOf(QStringLiteral("addr")) + 1));
            emit q_ptr->pairingFinished(address, QBluetoothLocalDevice::Unpaired);
        }
    } else if (result.msg == QStringLiteral("radio_shutdown")) {
        qCDebug(QT_BT_QNX) << "radio shutdown";
        emit q_ptr->hostModeStateChanged(QBluetoothLocalDevice::HostPoweredOff);
    }
}