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:

otherQLowEnergyServiceData

Constructs a new object of this class that is a copy of other.

addCharacteristic(characteristic)#
Parameters:

characteristicQLowEnergyCharacteristicData

Adds characteristic to the list of characteristics, if it is valid.

addIncludedService(service)#
Parameters:

serviceQLowEnergyService

Adds service to the list of included services. The service object must have been returned from a call to 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.

characteristics()#
Return type:

.list of QLowEnergyCharacteristicData

Returns the list of characteristics.

includedServices()#
Return type:

.list of QLowEnergyService

Returns the list of included services.

isValid()#
Return type:

bool

Returns true if this service is has a non-null UUID.

__ne__(b)#
Parameters:

bQLowEnergyServiceData

Return type:

bool

Returns true if a and b are unequal with respect to their public state, otherwise returns false.

__eq__(b)#
Parameters:

bQLowEnergyServiceData

Return type:

bool

Returns true if a and b are equal with respect to their public state, otherwise returns false.

setCharacteristics(characteristics)#
Parameters:

characteristics – .list of QLowEnergyCharacteristicData

Sets the list of characteristics to characteristics. Only valid characteristics are considered.

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 to addService .

setType(type)#
Parameters:

typeServiceType

Sets the type of this service to type.

See also

type()

setUuid(uuid)#
Parameters:

uuidQBluetoothUuid

Sets the UUID of this service to uuid.

See also

uuid()

swap(other)#
Parameters:

otherQLowEnergyServiceData

Swaps this object with other.

type()#
Return type:

ServiceType

Returns the type of this service.

See also

setType()

uuid()#
Return type:

QBluetoothUuid

Returns the UUID of this service.

See also

setUuid()