Exemple #1
0
void BTDiscovery::btDeviceDiscovered(const QBluetoothDeviceInfo &device)
{
	btPairedDevice this_d;
	this_d.address = markBLEAddress(&device);
	this_d.name = device.name();
	btPairedDevices.append(this_d);

	QList<QBluetoothUuid> serviceUuids = device.serviceUuids();
	foreach (QBluetoothUuid id, serviceUuids) {
		addBtUuid(id);
		qDebug() << id.toByteArray();
	}
void tst_QBluetoothDeviceInfo::tst_serviceUuids()
{
    QBluetoothDeviceInfo deviceInfo;
    QBluetoothDeviceInfo copyInfo = deviceInfo;

    QList<QBluetoothUuid> servicesList;
    servicesList.append(QBluetoothUuid::L2cap);
    servicesList.append(QBluetoothUuid::Rfcomm);
    QVERIFY(servicesList.count() > 0);

    deviceInfo.setServiceUuids(servicesList, QBluetoothDeviceInfo::DataComplete);
    QVERIFY(deviceInfo.serviceUuids().count() > 0);
    QVERIFY(!(deviceInfo == copyInfo));

    QVERIFY(deviceInfo.serviceUuidsCompleteness() == QBluetoothDeviceInfo::DataComplete);
}