diff options
Diffstat (limited to 'examples/bluetooth/heartrate_server/heartrate_server.py')
-rw-r--r-- | examples/bluetooth/heartrate_server/heartrate_server.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/bluetooth/heartrate_server/heartrate_server.py b/examples/bluetooth/heartrate_server/heartrate_server.py index 801584565..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,7 +66,8 @@ 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) + characteristic = service.characteristic( + QBluetoothUuid.CharacteristicType.HeartRateMeasurement) assert characteristic.isValid() # Potentially causes notification. service.writeCharacteristic(characteristic, value) |