Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QBluetoothSdpRecord Class Reference
[QtBluetoothModule]

The QBluetoothSdpRecord class represents a bluetooth SDP record. More...

    #include <QBluetoothSdpRecord>

Public Functions

Static Public Members

  • QBluetoothSdpRecord fromData ( const QByteArray & data )
  • QBluetoothSdpRecord fromDevice ( QIODevice * device )
  • int rfcommChannel ( const QBluetoothSdpRecord & service )

Detailed Description

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 TypeQt Type
UINT8quint8
INT8qint8
UINT16quint16
INT16qint16
UINT32quint32
INT32qint32
UINT64quint64
INT64qint64
UINT128quint128
INT128qint128
BOOLbool
AlternateQBluetoothSdpAlternative
SequenceQBluetoothSdpSequence
UUID16, UUID32, UUID128QBluetoothSdpUuid
URLQUrl
TEXTQString
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.


Member Function Documentation

QBluetoothSdpRecord::QBluetoothSdpRecord ()

Construct a new empty SDP Service record.

QBluetoothSdpRecord::QBluetoothSdpRecord ( const QBluetoothSdpRecord & other )

Construct a SDP service record, copying contents from other.

QBluetoothSdpRecord::~QBluetoothSdpRecord ()

Deconstruct a SDP Service record.

bool QBluetoothSdpRecord::addAttribute ( quint16 id, const QVariant & attr )

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().

QVariant QBluetoothSdpRecord::attribute ( quint16 id, bool * ok = NULL ) const

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().

QList<quint16> QBluetoothSdpRecord::attributeIds () const

Returns a list of all attribute identifiers this service contains.

See also addAttribute(), removeAttribute(), attribute(), and clearAttributes().

QList<QBluetoothSdpUuid> QBluetoothSdpRecord::browseGroups () const

Returns a list of unique identifiers of all browse groups this service is a part of.

See also setBrowseGroups().

void QBluetoothSdpRecord::clearAttributes ()

Clears all attributes.

See also attributeIds(), addAttribute(), removeAttribute(), and attribute().

QUrl QBluetoothSdpRecord::docUrl () const

Returns the Doc URL attribute.

See also setDocUrl().

QUrl QBluetoothSdpRecord::execUrl () const

Returns the Exec URL attribute.

See also setExecUrl().

QBluetoothSdpRecord QBluetoothSdpRecord::fromData ( const QByteArray & data )   [static]

Returns a SDP service record generated from the contents of data.

Returns a null service record if the contents of data cannot be parsed.

QBluetoothSdpRecord QBluetoothSdpRecord::fromDevice ( QIODevice * device )   [static]

Returns a SDP service record generated from the contents of device.

Returns a null service record if the contents of device cannot be parsed.

QBluetoothSdpUuid QBluetoothSdpRecord::group () const

Returns the group id attribute.

See also setGroup().

QUrl QBluetoothSdpRecord::iconUrl () const

Returns the Icon URL attribute.

See also setIconUrl().

QBluetoothSdpUuid QBluetoothSdpRecord::id () const

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().

bool QBluetoothSdpRecord::isInstance ( QBluetooth::SDPProfile profile ) const

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.

bool QBluetoothSdpRecord::isInstance ( const QBluetoothSdpUuid & serviceUuid ) const

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.

bool QBluetoothSdpRecord::isNull () const

Returns true if this SDP service record has no attributes.

QString QBluetoothSdpRecord::providerName () const

Returns the provider name attribute.

See also setProviderName().

quint32 QBluetoothSdpRecord::recordHandle () const

Returns a server specific record handle.

See also setRecordHandle().

bool QBluetoothSdpRecord::removeAttribute ( quint16 id )

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().

int QBluetoothSdpRecord::rfcommChannel ( const QBluetoothSdpRecord & service )   [static]

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.

QString QBluetoothSdpRecord::serviceDescription () const

Returns the service description attribute.

See also setServiceDescription().

QString QBluetoothSdpRecord::serviceName () const

Returns the service name attribute.

See also setServiceName().

void QBluetoothSdpRecord::setBrowseGroups ( const QList<QBluetoothSdpUuid> & groups )

Sets a list of unique identifiers of all browse groups this service is a part of to groups.

See also browseGroups().

void QBluetoothSdpRecord::setDocUrl ( const QUrl & docUrl )

Sets the Doc URL attribute to docUrl.

See also docUrl().

void QBluetoothSdpRecord::setExecUrl ( const QUrl & execUrl )

Sets the Exec URL attribute to execUrl.

See also execUrl().

void QBluetoothSdpRecord::setGroup ( const QBluetoothSdpUuid & group )

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().

void QBluetoothSdpRecord::setIconUrl ( const QUrl & iconUrl )

Sets the Icon URL attribute to iconUrl.

See also iconUrl().

void QBluetoothSdpRecord::setId ( const QBluetoothSdpUuid & id )

Sets the ServiceID attribute to id. The id argument should be unique identifier of the service.

See also id().

void QBluetoothSdpRecord::setProviderName ( const QString & providerName )

Sets the provider name attribute to providerName

See also providerName().

void QBluetoothSdpRecord::setRecordHandle ( quint32 handle )

Sets a server specific record handle to handle.

See also recordHandle().

void QBluetoothSdpRecord::setServiceDescription ( const QString & serviceDesc )

Sets the service description attribute to serviceDesc.

See also serviceDescription().

void QBluetoothSdpRecord::setServiceName ( const QString & serviceName )

Sets the service name attribute to serviceName.

See also serviceName().

QBluetoothSdpRecord & QBluetoothSdpRecord::operator= ( const QBluetoothSdpRecord & other )

Assign the contents of other to the current SDP service record.

bool QBluetoothSdpRecord::operator== ( const QBluetoothSdpRecord & other ) const

Returns whether other is equal to this SDP service record.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 43
  4. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 9
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web