- class QLowEnergyServiceData#
The
QLowEnergyServiceData
class is used to set up GATT service data. More…Synopsis#
Methods#
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
An Object of this class provides a service to be added to a GATT server via
addService()
.- class ServiceType#
The type of GATT service.
Constant
Description
QLowEnergyServiceData.ServiceTypePrimary
The service is a primary service.
QLowEnergyServiceData.ServiceTypeSecondary
The service is a secondary service. Secondary services are included by other services to implement some higher-level functionality.
- __init__()#
Creates a new invalid object of this class.
- __init__(other)
- Parameters:
other –
QLowEnergyServiceData
Constructs a new object of this class that is a copy of
other
.- addCharacteristic(characteristic)#
- Parameters:
characteristic –
QLowEnergyCharacteristicData
Adds
characteristic
to the list of characteristics, if it is valid.See also
- addIncludedService(service)#
- Parameters:
service –
QLowEnergyService
Adds
service
to the list of included services. Theservice
object must have been returned from a call toaddService
. 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.See also
- characteristics()#
- Return type:
.list of QLowEnergyCharacteristicData
Returns the list of characteristics.
See also
- includedServices()#
- Return type:
.list of QLowEnergyService
Returns the list of included services.
See also
- isValid()#
- Return type:
bool
Returns
true
if this service is has a non-null UUID.- __ne__(b)#
- Parameters:
- Return type:
bool
Returns
true
ifa
andb
are unequal with respect to their public state, otherwise returnsfalse
.- __eq__(b)#
- Parameters:
- Return type:
bool
Returns
true
ifa
andb
are equal with respect to their public state, otherwise returnsfalse
.- setCharacteristics(characteristics)#
- Parameters:
characteristics – .list of QLowEnergyCharacteristicData
Sets the list of characteristics to
characteristics
. Only valid characteristics are considered.See also
- setIncludedServices(services)#
- Parameters:
services – .list of QLowEnergyService
Sets the list of included services to
services
. All objects in this list must have been returned from a call toaddService
.See also
- setType(type)#
- Parameters:
type –
ServiceType
Sets the type of this service to
type
.See also
- setUuid(uuid)#
- Parameters:
uuid –
QBluetoothUuid
Sets the UUID of this service to
uuid
.See also
- swap(other)#
- Parameters:
other –
QLowEnergyServiceData
Swaps this object with
other
.- type()#
- Return type:
Returns the type of this service.
See also
- uuid()#
- Return type:
Returns the UUID of this service.
See also