Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QBluetoothSdpRecord class represents a bluetooth SDP record. More...
#include <QBluetoothSdpRecord>
The QBluetoothSdpRecord class represents a bluetooth SDP record.
Each Bluetooth record is composed of zero or more attributes. Each attribute contains exactly one value. To group several values, sequences or alternatives are used. Each attribute has a unique 16 bit identifier associated with it. The mapping between SDP basic types and the types used by the QBluetoothSdpRecord implementation are given below:
SDP Type | Qt Type |
---|---|
UINT8 | quint8 |
INT8 | qint8 |
UINT16 | quint16 |
INT16 | qint16 |
UINT32 | quint32 |
INT32 | qint32 |
UINT64 | quint64 |
INT64 | qint64 |
UINT128 | quint128 |
INT128 | qint128 |
BOOL | bool |
Alternate | QBluetoothSdpAlternative |
Sequence | QBluetoothSdpSequence |
UUID16, UUID32, UUID128 | QBluetoothSdpUuid |
URL | QUrl |
TEXT | QString |
TEXT (binary data) | QByteArray |
The attributes are stored as QVariants.
For example, the following code retrieves the value of the ServiceClassIDList attribute:
QBluetoothSdpRecord record = ...
quint16 UUID_SERVICE_CLASS_ID_LIST = 0x0001; // as defined in Bluetooth specification
QBluetoothSdpSequence serviceClassIdList = record.attribute(UUID_SERVICE_CLASS_ID_LIST).value<QBluetoothSdpSequence>();
for (int i=0; i<serviceClassIdList.count(); i++)
qDebug() << "Service class ID:" << serviceClassIdList[i];
Typically a QBluetoothSdpRecord is populated by:
See also QVariant, QBluetoothSdpSequence, and QBluetoothSdpAlternative.
Construct a new empty SDP Service record.
Construct a SDP service record, copying contents from other.
Deconstruct a SDP Service record.
Tries to add an attribute attr with id id to the service. Returns false if the attribute already exists.
See also attributeIds(), removeAttribute(), attribute(), and clearAttributes().
Returns the attribute with id id from the service. If the attribute is not found, a null QSDPAttribute is returned. For extra error information, you can pass in the ok flag, which specifies whether an error occurred, or an actual NULL attribute was returned.
See also attributeIds(), addAttribute(), removeAttribute(), and clearAttributes().
Returns a list of all attribute identifiers this service contains.
See also addAttribute(), removeAttribute(), attribute(), and clearAttributes().
Returns a list of unique identifiers of all browse groups this service is a part of.
See also setBrowseGroups().
Clears all attributes.
See also attributeIds(), addAttribute(), removeAttribute(), and attribute().
Returns the Doc URL attribute.
See also setDocUrl().
Returns the Exec URL attribute.
See also setExecUrl().
Returns a SDP service record generated from the contents of data.
Returns a null service record if the contents of data cannot be parsed.
Returns a SDP service record generated from the contents of device.
Returns a null service record if the contents of device cannot be parsed.
Returns the group id attribute.
See also setGroup().
Returns the Icon URL attribute.
See also setIconUrl().
Returns the ServiceID attribute - default value 0x0000. Whilst not mandatory the service on the SDP Server can be uniquely identified using this uuid.
See also setId().
This method can be used to find out whether a SDP record is an implementation of a particular service class, given by profile parameter.
This method returns true if the service class matches, false otherwise.
This is an overloaded member function, provided for convenience.
This method can be used to find out whether a SDP record is an implementation of a particular service class, given by serviceUuid parameter.
This method returns true if the service class matches, false otherwise.
Returns true if this SDP service record has no attributes.
Returns the provider name attribute.
See also setProviderName().
Returns a server specific record handle.
See also setRecordHandle().
Removes the attribute with the specified id id from the service record. Returns true on success. If the attribute is not found, nothing is done and false is returned.
See also attributeIds(), addAttribute(), attribute(), and clearAttributes().
For a family of services that work over the RFCOMM protocol, this method returns the RFCOMM channel the service is running on. The service parameter specifies the service record to search.
Returns the channel number on success, -1 if no channel number was found.
Returns the service description attribute.
See also setServiceDescription().
Returns the service name attribute.
See also setServiceName().
Sets a list of unique identifiers of all browse groups this service is a part of to groups.
See also browseGroups().
Sets the Doc URL attribute to docUrl.
See also docUrl().
Sets the Exec URL attribute to execUrl.
See also execUrl().
Sets the GroupID attribute to group. All services which belong to a Group Service Class will require this attribute. All other services can be a part of one or more groups. This is set through the browse group list attribute.
See also group().
Sets the Icon URL attribute to iconUrl.
See also iconUrl().
Sets the ServiceID attribute to id. The id argument should be unique identifier of the service.
See also id().
Sets the provider name attribute to providerName
See also providerName().
Sets a server specific record handle to handle.
See also recordHandle().
Sets the service description attribute to serviceDesc.
See also serviceDescription().
Sets the service name attribute to serviceName.
See also serviceName().
Assign the contents of other to the current SDP service record.
Returns whether other is equal to this SDP service record.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |