The QLowEnergyServiceData class is used to set up GATT service data. 更多...
头: | #include <QLowEnergyServiceData> |
qmake: | QT += bluetooth |
enum | ServiceType { ServiceTypePrimary, ServiceTypeSecondary } |
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 ) |
bool | operator!= (const QLowEnergyServiceData & a , const QLowEnergyServiceData & b ) |
bool | operator== (const QLowEnergyServiceData & a , const QLowEnergyServiceData & b ) |
An Object of this class provides a service to be added to a GATT server via QLowEnergyController::addService ().
The type of GATT service.
常量 | 值 | 描述 |
---|---|---|
QLowEnergyServiceData::ServiceTypePrimary
|
0x2800
|
The service is a primary service. |
QLowEnergyServiceData::ServiceTypeSecondary
|
0x2801
|
The service is a secondary service. Secondary services are included by other services to implement some higher-level functionality. |
Creates a new invalid object of this class.
Constructs a new object of this class that is a copy of other .
[noexcept]
QLowEnergyServiceData::
~QLowEnergyServiceData
()
销毁此对象。
添加 characteristic to the list of characteristics, if it is valid.
另请参阅 setCharacteristics ().
添加 service to the list of included services. The service object must have been returned from a call to QLowEnergyController::addService . This requirement prevents circular includes (which are forbidden by the Bluetooth specification), and also helps to support the use case of including more than one service of the same type.
另请参阅 setIncludedServices ().
Returns the list of characteristics.
另请参阅 setCharacteristics ().
Returns the list of included services.
另请参阅 setIncludedServices ().
返回
true
if this service is has a non-null UUID.
Sets the list of characteristics to characteristics . Only valid characteristics are considered.
另请参阅 characteristics () 和 addCharacteristic ().
Sets the list of included services to services . All objects in this list must have been returned from a call to QLowEnergyController::addService .
另请参阅 includedServices () 和 addIncludedService ().
Sets the type of this service to type .
另请参阅 type ().
Sets the UUID of this service to uuid .
另请参阅 uuid ().
[noexcept]
void
QLowEnergyServiceData::
swap
(
QLowEnergyServiceData
&
other
)
Swaps this object with other .
Returns the type of this service.
另请参阅 setType ().
Returns the UUID of this service.
另请参阅 setUuid ().
Makes this object a copy of other and returns the new value of this object.
返回
true
if
a
and
b
are unequal with respect to their public state, otherwise returns
false
.
返回
true
if
a
and
b
are equal with respect to their public state, otherwise returns
false
.