当前位置: 首页>>代码示例>>C++>>正文


C++ QBluetoothLocalDevice::address方法代码示例

本文整理汇总了C++中QBluetoothLocalDevice::address方法的典型用法代码示例。如果您正苦于以下问题:C++ QBluetoothLocalDevice::address方法的具体用法?C++ QBluetoothLocalDevice::address怎么用?C++ QBluetoothLocalDevice::address使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QBluetoothLocalDevice的用法示例。


在下文中一共展示了QBluetoothLocalDevice::address方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QDialog

ServiceDiscoveryDialog::ServiceDiscoveryDialog(const QString &name,
                                               const QBluetoothAddress &address, QWidget *parent)
:   QDialog(parent), ui(new Ui_ServiceDiscovery)
{
    ui->setupUi(this);

    //Using default Bluetooth adapter
    QBluetoothLocalDevice localDevice;
    QBluetoothAddress adapterAddress = localDevice.address();

    /*
     * In case of multiple Bluetooth adapters it is possible to
     * set which adapter will be used by providing MAC Address.
     * Example code:
     *
     * QBluetoothAddress adapterAddress("XX:XX:XX:XX:XX:XX");
     * discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress);
     */

    discoveryAgent = new QBluetoothServiceDiscoveryAgent(adapterAddress);

    discoveryAgent->setRemoteAddress(address);

    setWindowTitle(name);

    connect(discoveryAgent, SIGNAL(serviceDiscovered(QBluetoothServiceInfo)),
            this, SLOT(addService(QBluetoothServiceInfo)));
    connect(discoveryAgent, SIGNAL(finished()), ui->status, SLOT(hide()));

    discoveryAgent->start();
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:31,代码来源:service.cpp

示例2: sendBluetoothService

void Handover::sendBluetoothService()
{
    QBluetoothLocalDevice localDevice;
    const QString data = localDevice.address().toString() + QLatin1Char(' ') +
                         QString::number(m_localServerPort);

    m_remote->write(data.toUtf8());
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:8,代码来源:handover.cpp

示例3: tst_address

void tst_QBluetoothLocalDevice::tst_address()
{
    if (!QBluetoothLocalDevice::allDevices().count())
        QSKIP("Skipping test due to missing Bluetooth device");

    QBluetoothLocalDevice localDevice;
    QVERIFY(!localDevice.address().toString().isEmpty());
}
开发者ID:lainwir3d,项目名称:qtconnectivity,代码行数:8,代码来源:tst_qbluetoothlocaldevice.cpp

示例4: tst_construction

void tst_QBluetoothLocalDevice::tst_construction()
{
    QBluetoothLocalDevice localDevice;
    QVERIFY(localDevice.isValid());

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

}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:10,代码来源:tst_qbluetoothlocaldevice.cpp

示例5: readBluetoothService

void Handover::readBluetoothService()
{
    QByteArray rawData = m_client->readAll();
    QString data = QString::fromUtf8(rawData.constData(), rawData.size());
    QStringList split = data.split(QLatin1Char(' '));

    QBluetoothAddress address = QBluetoothAddress(split.at(0));
    quint16 port = split.at(1).toUInt();

    QBluetoothLocalDevice localDevice;
    QBluetoothAddress localAddress = localDevice.address();

    if (localAddress < address) {
        m_address = address;
        m_serverPort = port;
        emit bluetoothServiceChanged();
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:18,代码来源:handover.cpp

示例6: tst_address

void tst_QBluetoothLocalDevice::tst_address()
{
    QBluetoothLocalDevice localDevice;
    QVERIFY(!localDevice.address().toString().isEmpty());
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:5,代码来源:tst_qbluetoothlocaldevice.cpp

示例7: localAddress

QBluetoothAddress QBluetoothSocketPrivate::localAddress() const
{
    QBluetoothLocalDevice ld;
    return ld.address();
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:5,代码来源:qbluetoothsocket_qnx.cpp


注:本文中的QBluetoothLocalDevice::address方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。