aboutsummaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/heartrate_server/heartrate_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bluetooth/heartrate_server/heartrate_server.py')
-rw-r--r--examples/bluetooth/heartrate_server/heartrate_server.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/bluetooth/heartrate_server/heartrate_server.py b/examples/bluetooth/heartrate_server/heartrate_server.py
index f98cc6fe8..abbf4eb7f 100644
--- a/examples/bluetooth/heartrate_server/heartrate_server.py
+++ b/examples/bluetooth/heartrate_server/heartrate_server.py
@@ -39,8 +39,8 @@ if __name__ == '__main__':
char_data.setUuid(QBluetoothUuid.CharacteristicType.HeartRateMeasurement)
char_data.setValue(QByteArray(2, 0))
char_data.setProperties(QLowEnergyCharacteristic.Notify)
- client_config = QLowEnergyDescriptorData(QBluetoothUuid.DescriptorType.ClientCharacteristicConfiguration,
- QByteArray(2, 0))
+ client_config = QLowEnergyDescriptorData(
+ QBluetoothUuid.DescriptorType.ClientCharacteristicConfiguration, QByteArray(2, 0))
char_data.addDescriptor(client_config)
service_data = QLowEnergyServiceData()
@@ -66,8 +66,9 @@ if __name__ == '__main__':
value = QByteArray()
value.append(chr(0)) # Flags that specify the format of the value.
value.append(chr(current_heart_rate)) # Actual value.
- characteristic = service.characteristic(QBluetoothUuid.CharacteristicType.HeartRateMeasurement)
- assert(characteristic.isValid())
+ characteristic = service.characteristic(
+ QBluetoothUuid.CharacteristicType.HeartRateMeasurement)
+ assert characteristic.isValid()
# Potentially causes notification.
service.writeCharacteristic(characteristic, value)
if current_heart_rate == 60: