QLowEnergyDescriptor Class
La classe QLowEnergyDescriptor memorizza le informazioni relative al descrittore Bluetooth Low Energy. Maggiori informazioni...
| Intestazione: | #include <QLowEnergyDescriptor> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Bluetooth) target_link_libraries(mytarget PRIVATE Qt6::Bluetooth) |
| qmake: | QT += bluetooth |
Funzioni pubbliche
| QLowEnergyDescriptor() | |
| QLowEnergyDescriptor(const QLowEnergyDescriptor &other) | |
| ~QLowEnergyDescriptor() | |
| bool | isValid() const |
| QString | name() const |
| QBluetoothUuid::DescriptorType | type() const |
| QBluetoothUuid | uuid() const |
| QByteArray | value() const |
| QLowEnergyDescriptor & | operator=(const QLowEnergyDescriptor &other) |
Elementi non membri correlati
| bool | operator!=(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b) |
| bool | operator==(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b) |
Descrizione dettagliata
QLowEnergyDescriptor fornisce informazioni relative alle proprietà name(), uuid() e value() di un descrittore Bluetooth Low Energy. I descrittori sono incapsulati dalle caratteristiche Bluetooth Low Energy e forniscono ulteriori informazioni contestuali sulla caratteristica (formato dei dati, attivazione delle notifiche e così via).
Il valore del descrittore può essere scritto tramite l’istanza QLowEnergyService che gestisce il servizio a cui appartiene questo descrittore. La funzione QLowEnergyService::writeDescriptor() scrive il nuovo valore. Il segnale QLowEnergyService::descriptorWritten() viene emesso in caso di esito positivo. Il metodo value() memorizzato nella cache di questo oggetto viene aggiornato di conseguenza.
Vedi anche ` QLowEnergyService ` e ` QLowEnergyCharacteristic`.
Documentazione delle funzioni membro
QLowEnergyDescriptor::QLowEnergyDescriptor()
Crea un nuovo oggetto QLowEnergyDescriptor. Un'istanza di questa classe creata con la costruzione predefinita non è mai valida.
QLowEnergyDescriptor::QLowEnergyDescriptor(const QLowEnergyDescriptor &other)
Crea un nuovo oggetto `QLowEnergyDescriptor` che sia una copia di ` other`.
Le due copie continuano a condividere gli stessi dati sottostanti, che non vengono separati al momento della scrittura.
[noexcept] QLowEnergyDescriptor::~QLowEnergyDescriptor()
Elimina l'oggetto “ QLowEnergyDescriptor ”.
bool QLowEnergyDescriptor::isValid() const
Restituisce ` true ` se l'oggetto ` QLowEnergyDescriptor ` è valido, altrimenti restituisce ` false`.
Un'istanza di descrittore non valida non è associata ad alcun servizio (costruita per impostazione predefinita) oppure il servizio associato non è più valido a causa, ad esempio, di una disconnessione dal dispositivo Bluetooth Low Energy sottostante. Una volta che l'oggetto è diventato non valido, non può più tornare ad essere valido.
Nota: se un'istanza di ` QLowEnergyDescriptor ` diventa non valida a causa di una disconnessione dal dispositivo sottostante, le informazioni incapsulate dall'istanza corrente rimangono così come erano al momento della disconnessione. Pertanto, possono essere recuperate dopo l'evento di disconnessione.
QString QLowEnergyDescriptor::name() const
Restituisce il nome leggibile dal descrittore.
Il nome si basa sul metodo ` type()` del descrittore. L'elenco completo dei tipi di descrittori è disponibile alla voce " Descriptors" sul sito Bluetooth.org.
La stringa restituita è vuota se la funzione ` type()` è sconosciuta.
Vedi anche ` type()` e ` QBluetoothUuid::descriptorToString()`.
QBluetoothUuid::DescriptorType QLowEnergyDescriptor::type() const
Restituisce il tipo del descrittore.
Vedi anche name().
QBluetoothUuid QLowEnergyDescriptor::uuid() const
Restituisce l'UUID di questo descrittore se isValid() restituisce true; in caso contrario, restituisce l'UUID null.
QByteArray QLowEnergyDescriptor::value() const
Restituisce il valore memorizzato nella cache del descrittore.
Il valore del descrittore memorizzato nella cache può essere aggiornato utilizzando QLowEnergyService::writeDescriptor() o QLowEnergyService::readDescriptor().
QLowEnergyDescriptor &QLowEnergyDescriptor::operator=(const QLowEnergyDescriptor &other)
Crea una copia di other e la assegna a questo oggetto QLowEnergyDescriptor. Le due copie continuano a condividere gli stessi dettagli relativi al servizio e al controller.
Elementi correlati non membri
bool operator!=(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b)
Restituisce ` true ` se ` a ` non è uguale a ` b`; in caso contrario, restituisce ` false`.
Due istanze di QLowEnergyDescriptor sono considerate uguali se fanno riferimento allo stesso descrittore sullo stesso dispositivo Bluetooth Low Energy remoto oppure se entrambe le istanze sono state create con i valori predefiniti.
bool operator==(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b)
Restituisce ` true ` se ` a ` è uguale a ` b`; altrimenti restituisce ` false`.
Due istanze di ` QLowEnergyDescriptor ` sono considerate uguali se fanno riferimento allo stesso descrittore sullo stesso dispositivo Bluetooth Low Energy remoto oppure se entrambe le istanze sono state create con i valori predefiniti.
© 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.