QLowEnergyServiceData Class
La classe QLowEnergyServiceData est utilisée pour configurer les données de service GATT. Plus d'informations...
| En-tête : | #include <QLowEnergyServiceData> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS Bluetooth)target_link_libraries(mytarget PRIVATE Qt6::Bluetooth) |
| qmake : | QT += bluetooth |
- Liste de tous les membres, y compris les membres hérités
- QLowEnergyServiceData fait partie des classes implicitement partagées.
Types publics
| enum | ServiceType { ServiceTypePrimary, ServiceTypeSecondary } |
Fonctions publiques
| QLowEnergyServiceData() | |
| QLowEnergyServiceData(const QLowEnergyServiceData &other) | |
| ~QLowEnergyServiceData() | |
| void | addCharacteristic(const QLowEnergyCharacteristicData &characteristic) |
| void | addIncludedService(QLowEnergyService *service) |
| QList<QLowEnergyCharacteristicData> | characteristics() const |
| QList<QLowEnergyService *> | includedServices() const |
| bool | isValid() const |
| void | setCharacteristics(const QList<QLowEnergyCharacteristicData> &characteristics) |
| void | setIncludedServices(const QList<QLowEnergyService *> &services) |
| void | setType(QLowEnergyServiceData::ServiceType type) |
| void | setUuid(const QBluetoothUuid &uuid) |
| void | swap(QLowEnergyServiceData &other) |
| QLowEnergyServiceData::ServiceType | type() const |
| QBluetoothUuid | uuid() const |
| QLowEnergyServiceData & | operator=(const QLowEnergyServiceData &other) |
Non-membres apparentés
| bool | operator!=(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b) |
| bool | operator==(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b) |
Description détaillée
Un objet de cette classe fournit un service à ajouter à un serveur GATT via QLowEnergyController::addService().
Type de membre Documentation
enum QLowEnergyServiceData::ServiceType
Le type de service GATT.
| Constante | Valeur | Description du service |
|---|---|---|
QLowEnergyServiceData::ServiceTypePrimary | 0x2800 | Le service est un service primaire. |
QLowEnergyServiceData::ServiceTypeSecondary | 0x2801 | Le service est un service secondaire. Les services secondaires sont inclus par d'autres services pour mettre en œuvre une fonctionnalité de niveau supérieur. |
Documentation sur les fonctions membres
QLowEnergyServiceData::QLowEnergyServiceData()
Crée un nouvel objet invalide de cette classe.
QLowEnergyServiceData::QLowEnergyServiceData(const QLowEnergyServiceData &other)
Construit un nouvel objet de cette classe qui est une copie de other.
[noexcept] QLowEnergyServiceData::~QLowEnergyServiceData()
Détruit cet objet.
void QLowEnergyServiceData::addCharacteristic(const QLowEnergyCharacteristicData &characteristic)
Ajoute characteristic à la liste des caractéristiques, si elle est valide.
Voir aussi setCharacteristics().
void QLowEnergyServiceData::addIncludedService(QLowEnergyService *service)
Ajoute service à la liste des services inclus. L'objet service doit avoir été renvoyé par un appel à QLowEnergyController::addService. Cette exigence permet d'éviter les inclusions circulaires (qui sont interdites par la spécification Bluetooth) et contribue également à prendre en charge le cas d'utilisation consistant à inclure plus d'un service du même type.
Voir aussi setIncludedServices().
QList<QLowEnergyCharacteristicData> QLowEnergyServiceData::characteristics() const
Renvoie la liste des caractéristiques.
Voir également setCharacteristics().
QList<QLowEnergyService *> QLowEnergyServiceData::includedServices() const
Renvoie la liste des services inclus.
Voir aussi setIncludedServices().
bool QLowEnergyServiceData::isValid() const
Renvoie true si ce service a un UUID non nul.
void QLowEnergyServiceData::setCharacteristics(const QList<QLowEnergyCharacteristicData> &characteristics)
Définit la liste des caractéristiques à characteristics. Seules les caractéristiques valables sont prises en compte.
Voir également characteristics() et addCharacteristic().
void QLowEnergyServiceData::setIncludedServices(const QList<QLowEnergyService *> &services)
Définit la liste des services inclus à services. Tous les objets de cette liste doivent avoir été renvoyés par un appel à QLowEnergyController::addService.
Voir aussi includedServices() et addIncludedService().
void QLowEnergyServiceData::setType(QLowEnergyServiceData::ServiceType type)
Définit le type de ce service à type.
Voir aussi type().
void QLowEnergyServiceData::setUuid(const QBluetoothUuid &uuid)
Définit l'UUID de ce service à uuid.
Voir aussi uuid().
[noexcept] void QLowEnergyServiceData::swap(QLowEnergyServiceData &other)
Remplace cet objet par other.
QLowEnergyServiceData::ServiceType QLowEnergyServiceData::type() const
Renvoie le type de ce service.
Voir aussi setType().
QBluetoothUuid QLowEnergyServiceData::uuid() const
Renvoie l'UUID de ce service.
Voir aussi setUuid().
QLowEnergyServiceData &QLowEnergyServiceData::operator=(const QLowEnergyServiceData &other)
Fait de cet objet une copie de other et renvoie la nouvelle valeur de cet objet.
Non-membres apparentés
bool operator!=(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
Renvoie true si a et b sont inégaux en ce qui concerne leur état public, sinon renvoie false.
bool operator==(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
Renvoie true si a et b sont égaux en ce qui concerne leur état public, sinon renvoie false.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.