本文整理汇总了C++中qbluetoothserviceinfo::Sequence::at方法的典型用法代码示例。如果您正苦于以下问题:C++ Sequence::at方法的具体用法?C++ Sequence::at怎么用?C++ Sequence::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qbluetoothserviceinfo::Sequence
的用法示例。
在下文中一共展示了Sequence::at方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: protocolServiceMultiplexer
/*!
This is a convenience function. Returns the protocol/service multiplexer for services which
support the L2CAP protocol, otherwise returns -1.
This function is equivalent to extracting the information from
QBluetoothServiceInfo::Sequence returned by
QBluetoothServiceInfo::attribute(QBluetoothServiceInfo::ProtocolDescriptorList).
*/
int QBluetoothServiceInfo::protocolServiceMultiplexer() const
{
QBluetoothServiceInfo::Sequence parameters = protocolDescriptor(QBluetoothUuid::L2cap);
if (parameters.isEmpty())
return -1;
else if (parameters.count() == 1)
return 0;
else
return parameters.at(1).toUInt();
}
示例2: attribute
/*!
Returns a list of UUIDs describing the service classes that this service conforms to.
This is a convenience function. It is equivalent to calling
attribute(QBluetoothServiceInfo::ServiceClassIds).value<QBluetoothServiceInfo::Sequence>()
and subsequently iterating over its QBluetoothUuid entries.
\sa attribute()
*/
QList<QBluetoothUuid> QBluetoothServiceInfo::serviceClassUuids() const
{
QList<QBluetoothUuid> results;
const QVariant var = attribute(QBluetoothServiceInfo::ServiceClassIds);
if (!var.isValid())
return results;
const QBluetoothServiceInfo::Sequence seq = var.value<QBluetoothServiceInfo::Sequence>();
for (int i = 0; i < seq.count(); i++)
results.append(seq.at(i).value<QBluetoothUuid>());
return results;
}
示例3: tst_serviceClassUuids
void tst_QBluetoothServiceInfo::tst_serviceClassUuids()
{
QBluetoothServiceInfo info;
QCOMPARE(info.serviceClassUuids().count(), 0);
QBluetoothServiceInfo::Sequence classIds;
classIds << QVariant::fromValue(QBluetoothUuid(QBluetoothUuid::SerialPort));
QCOMPARE(classIds.count(), 1);
QBluetoothUuid uuid(QString("e8e10f95-1a70-4b27-9ccf-02010264e9c8"));
classIds.prepend(QVariant::fromValue(uuid));
QCOMPARE(classIds.count(), 2);
QCOMPARE(classIds.at(0).value<QBluetoothUuid>(), uuid);
info.setAttribute(QBluetoothServiceInfo::ServiceClassIds, classIds);
QList<QBluetoothUuid> svclids = info.serviceClassUuids();
QCOMPARE(svclids.count(), 2);
QCOMPARE(svclids.at(0), uuid);
QCOMPARE(svclids.at(1), QBluetoothUuid(QBluetoothUuid::SerialPort));
}