本文整理汇总了C++中QBluetoothDeviceInfo::coreConfigurations方法的典型用法代码示例。如果您正苦于以下问题:C++ QBluetoothDeviceInfo::coreConfigurations方法的具体用法?C++ QBluetoothDeviceInfo::coreConfigurations怎么用?C++ QBluetoothDeviceInfo::coreConfigurations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QBluetoothDeviceInfo
的用法示例。
在下文中一共展示了QBluetoothDeviceInfo::coreConfigurations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addDevice
//! [les-devicediscovery-3]
void Device::addDevice(const QBluetoothDeviceInfo &info)
{
if (info.coreConfigurations() & QBluetoothDeviceInfo::LowEnergyCoreConfiguration) {
DeviceInfo *d = new DeviceInfo(info);
devices.append(d);
setUpdate("Last device added: " + d->getName());
}
}
示例2: tst_assignment
void tst_QBluetoothDeviceInfo::tst_assignment()
{
QFETCH(QBluetoothAddress, address);
QFETCH(QString, name);
QFETCH(quint32, classOfDevice);
QFETCH(QBluetoothDeviceInfo::ServiceClasses, serviceClasses);
QFETCH(QBluetoothDeviceInfo::MajorDeviceClass, majorDeviceClass);
QFETCH(quint8, minorDeviceClass);
QFETCH(QBluetoothDeviceInfo::CoreConfiguration, coreConfiguration);
QFETCH(QBluetoothUuid, deviceUuid);
QBluetoothDeviceInfo deviceInfo(address, name, classOfDevice);
deviceInfo.setDeviceUuid(deviceUuid);
deviceInfo.setCoreConfigurations(coreConfiguration);
QVERIFY(deviceInfo.isValid());
{
QBluetoothDeviceInfo copyInfo = deviceInfo;
QVERIFY(copyInfo.isValid());
QCOMPARE(copyInfo.address(), address);
QCOMPARE(copyInfo.name(), name);
QCOMPARE(copyInfo.serviceClasses(), serviceClasses);
QCOMPARE(copyInfo.majorDeviceClass(), majorDeviceClass);
QCOMPARE(copyInfo.minorDeviceClass(), minorDeviceClass);
QCOMPARE(copyInfo.coreConfigurations(), coreConfiguration);
QCOMPARE(copyInfo.deviceUuid(), deviceUuid);
}
{
QBluetoothDeviceInfo copyInfo;
QVERIFY(!copyInfo.isValid());
copyInfo = deviceInfo;
QVERIFY(copyInfo.isValid());
QCOMPARE(copyInfo.address(), address);
QCOMPARE(copyInfo.name(), name);
QCOMPARE(copyInfo.serviceClasses(), serviceClasses);
QCOMPARE(copyInfo.majorDeviceClass(), majorDeviceClass);
QCOMPARE(copyInfo.minorDeviceClass(), minorDeviceClass);
QCOMPARE(copyInfo.coreConfigurations(), coreConfiguration);
QCOMPARE(copyInfo.deviceUuid(), deviceUuid);
}
{
QBluetoothDeviceInfo copyInfo1;
QBluetoothDeviceInfo copyInfo2;
QVERIFY(!copyInfo1.isValid());
QVERIFY(!copyInfo2.isValid());
copyInfo1 = copyInfo2 = deviceInfo;
QVERIFY(copyInfo1.isValid());
QVERIFY(copyInfo2.isValid());
QVERIFY(QBluetoothDeviceInfo() != copyInfo1);
QCOMPARE(copyInfo1.address(), address);
QCOMPARE(copyInfo2.address(), address);
QCOMPARE(copyInfo1.name(), name);
QCOMPARE(copyInfo2.name(), name);
QCOMPARE(copyInfo1.serviceClasses(), serviceClasses);
QCOMPARE(copyInfo2.serviceClasses(), serviceClasses);
QCOMPARE(copyInfo1.majorDeviceClass(), majorDeviceClass);
QCOMPARE(copyInfo2.majorDeviceClass(), majorDeviceClass);
QCOMPARE(copyInfo1.minorDeviceClass(), minorDeviceClass);
QCOMPARE(copyInfo2.minorDeviceClass(), minorDeviceClass);
QCOMPARE(copyInfo1.coreConfigurations(), coreConfiguration);
QCOMPARE(copyInfo2.coreConfigurations(), coreConfiguration);
QCOMPARE(copyInfo1.deviceUuid(), deviceUuid);
QCOMPARE(copyInfo2.deviceUuid(), deviceUuid);
}
{
QBluetoothDeviceInfo testDeviceInfo;
QVERIFY(testDeviceInfo == QBluetoothDeviceInfo());
}
}
示例3: tst_construction
void tst_QBluetoothDeviceInfo::tst_construction()
{
{
QBluetoothDeviceInfo deviceInfo;
QVERIFY(!deviceInfo.isValid());
QVERIFY(deviceInfo.coreConfigurations()
== QBluetoothDeviceInfo::UnknownCoreConfiguration);
}
{
QFETCH(QBluetoothAddress, address);
QFETCH(QString, name);
QFETCH(quint32, classOfDevice);
QFETCH(QBluetoothDeviceInfo::ServiceClasses, serviceClasses);
QFETCH(QBluetoothDeviceInfo::MajorDeviceClass, majorDeviceClass);
QFETCH(quint8, minorDeviceClass);
QFETCH(QBluetoothDeviceInfo::CoreConfiguration, coreConfiguration);
QFETCH(QBluetoothUuid, deviceUuid);
QBluetoothDeviceInfo deviceInfo(address, name, classOfDevice);
QVERIFY(deviceInfo.isValid());
QCOMPARE(deviceInfo.address(), address);
QCOMPARE(deviceInfo.name(), name);
QCOMPARE(deviceInfo.serviceClasses(), serviceClasses);
QCOMPARE(deviceInfo.majorDeviceClass(), majorDeviceClass);
QCOMPARE(deviceInfo.minorDeviceClass(), minorDeviceClass);
QCOMPARE(deviceInfo.coreConfigurations(), QBluetoothDeviceInfo::UnknownCoreConfiguration);
deviceInfo.setCoreConfigurations(coreConfiguration);
QCOMPARE(deviceInfo.coreConfigurations(), coreConfiguration);
deviceInfo.setDeviceUuid(deviceUuid);
QCOMPARE(deviceInfo.deviceUuid(), deviceUuid);
QBluetoothDeviceInfo copyInfo(deviceInfo);
QVERIFY(copyInfo.isValid());
QCOMPARE(copyInfo.address(), address);
QCOMPARE(copyInfo.name(), name);
QCOMPARE(copyInfo.serviceClasses(), serviceClasses);
QCOMPARE(copyInfo.majorDeviceClass(), majorDeviceClass);
QCOMPARE(copyInfo.minorDeviceClass(), minorDeviceClass);
QCOMPARE(copyInfo.coreConfigurations(), coreConfiguration);
QCOMPARE(copyInfo.deviceUuid(), deviceUuid);
}
{
// Test construction from the device unique UUID, without an address.
QFETCH(QString, name);
QFETCH(quint32, classOfDevice);
QFETCH(QBluetoothDeviceInfo::ServiceClasses, serviceClasses);
QFETCH(QBluetoothDeviceInfo::MajorDeviceClass, majorDeviceClass);
QFETCH(quint8, minorDeviceClass);
QFETCH(QBluetoothDeviceInfo::CoreConfiguration, coreConfiguration);
QFETCH(QBluetoothUuid, deviceUuid);
QBluetoothDeviceInfo deviceInfo(deviceUuid, name, classOfDevice);
QVERIFY(deviceInfo.isValid());
QCOMPARE(deviceInfo.name(), name);
QCOMPARE(deviceInfo.serviceClasses(), serviceClasses);
QCOMPARE(deviceInfo.majorDeviceClass(), majorDeviceClass);
QCOMPARE(deviceInfo.minorDeviceClass(), minorDeviceClass);
QCOMPARE(deviceInfo.coreConfigurations(), QBluetoothDeviceInfo::UnknownCoreConfiguration);
deviceInfo.setCoreConfigurations(coreConfiguration);
QCOMPARE(deviceInfo.coreConfigurations(), coreConfiguration);
QBluetoothDeviceInfo copyInfo(deviceInfo);
QVERIFY(copyInfo.isValid());
QCOMPARE(copyInfo.name(), name);
QCOMPARE(copyInfo.serviceClasses(), serviceClasses);
QCOMPARE(copyInfo.majorDeviceClass(), majorDeviceClass);
QCOMPARE(copyInfo.minorDeviceClass(), minorDeviceClass);
QCOMPARE(copyInfo.coreConfigurations(), coreConfiguration);
QCOMPARE(copyInfo.deviceUuid(), deviceUuid);
}
}