QLowEnergyServiceData Class
La clase QLowEnergyServiceData se utiliza para configurar los datos de los servicios GATT. Más información...
| Encabezado: | #include <QLowEnergyServiceData> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Bluetooth) target_link_libraries(mytarget PRIVATE Qt6::Bluetooth) |
| qmake: | QT += bluetooth |
- Lista de todos los miembros, incluidos los heredados
- QLowEnergyServiceData forma parte de las clases compartidas implícitamente.
Tipos públicos
| enum | ServiceType { ServiceTypePrimary, ServiceTypeSecondary } |
Funciones públicas
| 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) |
Elementos no miembros relacionados
| bool | operator!=(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b) |
| bool | operator==(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b) |
Descripción detallada
Un objeto de esta clase proporciona un servicio que se añade a un servidor GATT mediante la función ` QLowEnergyController::addService()`.
Documentación de los tipos de miembros
enum QLowEnergyServiceData::ServiceType
El tipo de servicio según el GATT.
| Constante | Valor | Descripción |
|---|---|---|
QLowEnergyServiceData::ServiceTypePrimary | 0x2800 | El servicio es un servicio primario. |
QLowEnergyServiceData::ServiceTypeSecondary | 0x2801 | El servicio es un servicio secundario. Los servicios secundarios se incluyen en otros servicios para implementar alguna funcionalidad de nivel superior. |
Documentación de la función miembro
QLowEnergyServiceData::QLowEnergyServiceData()
Crea un nuevo objeto no válido de esta clase.
QLowEnergyServiceData::QLowEnergyServiceData(const QLowEnergyServiceData &other)
Crea un nuevo objeto de esta clase que es una copia de other.
[noexcept] QLowEnergyServiceData::~QLowEnergyServiceData()
Destruye este objeto.
void QLowEnergyServiceData::addCharacteristic(const QLowEnergyCharacteristicData &characteristic)
Añade « characteristic » a la lista de características, si es válido.
Véase también setCharacteristics().
void QLowEnergyServiceData::addIncludedService(QLowEnergyService *service)
Añade « service » a la lista de servicios incluidos. El objeto « service » debe haber sido devuelto por una llamada a « QLowEnergyController::addService ». Este requisito evita las inclusiones circulares (prohibidas por la especificación de Bluetooth) y, además, ayuda a dar soporte al caso de uso en el que se incluye más de un servicio del mismo tipo.
Véase también setIncludedServices().
QList<QLowEnergyCharacteristicData> QLowEnergyServiceData::characteristics() const
Devuelve la lista de características.
Véase también setCharacteristics().
QList<QLowEnergyService *> QLowEnergyServiceData::includedServices() const
Devuelve la lista de servicios incluidos.
Véase también setIncludedServices().
bool QLowEnergyServiceData::isValid() const
Devuelve « true » si este servicio tiene un UUID distinto de nulo.
void QLowEnergyServiceData::setCharacteristics(const QList<QLowEnergyCharacteristicData> &characteristics)
Establece la lista de características en characteristics. Solo se tienen en cuenta las características válidas.
Véase también characteristics() y addCharacteristic().
void QLowEnergyServiceData::setIncludedServices(const QList<QLowEnergyService *> &services)
Establece la lista de servicios incluidos en services. Todos los objetos de esta lista deben haber sido devueltos por una llamada a QLowEnergyController::addService.
Véase también includedServices() y addIncludedService().
void QLowEnergyServiceData::setType(QLowEnergyServiceData::ServiceType type)
Establece el tipo de este servicio como « type ».
Véase también type().
void QLowEnergyServiceData::setUuid(const QBluetoothUuid &uuid)
Establece el UUID de este servicio en uuid.
Véase también uuid().
[noexcept] void QLowEnergyServiceData::swap(QLowEnergyServiceData &other)
Intercambia este objeto con other.
QLowEnergyServiceData::ServiceType QLowEnergyServiceData::type() const
Devuelve el tipo de este servicio.
Véase también setType().
QBluetoothUuid QLowEnergyServiceData::uuid() const
Devuelve el UUID de este servicio.
Véase también setUuid().
QLowEnergyServiceData &QLowEnergyServiceData::operator=(const QLowEnergyServiceData &other)
Convierte este objeto en una copia de ` other ` y devuelve el nuevo valor de este objeto.
Elementos no miembros relacionados
bool operator!=(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
Devuelve ` true ` si ` a ` y ` b ` son desiguales en cuanto a su estado público; en caso contrario, devuelve ` false`.
bool operator==(const QLowEnergyServiceData &a, const QLowEnergyServiceData &b)
Devuelve « true » si « a » y « b » son iguales en cuanto a su estado público; en caso contrario, devuelve « 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.