summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2022-11-28 10:06:53 +0200
committerJuha Vuolle <juha.vuolle@insta.fi>2022-12-07 11:48:00 +0200
commit6beab27c5393920884bbb1d0fba68971ab19ca8d (patch)
treee25da630e54a946f5aedafd00cc625d2a8d0e510 /tests
parente7499c2cca615eaff3bd4c9ffe5f72d7112055cf (diff)
Bluez DBus peripheral add support for extended properties
Task-number: QTBUG-107511 Change-Id: Ia94262a29457489f8b7d5ffd2f5b50f943eb4b21 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/bttestui/btlocaldevice.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/bttestui/btlocaldevice.cpp b/tests/bttestui/btlocaldevice.cpp
index 9306c482..b0c55ca7 100644
--- a/tests/bttestui/btlocaldevice.cpp
+++ b/tests/bttestui/btlocaldevice.cpp
@@ -957,7 +957,8 @@ void BtLocalDevice::peripheralAddServices()
charData.setValueLength(leCharacteristicSize, leCharacteristicSize);
charData.setProperties(QLowEnergyCharacteristic::PropertyType::Read
| QLowEnergyCharacteristic::PropertyType::Write
- | QLowEnergyCharacteristic::PropertyType::Notify);
+ | QLowEnergyCharacteristic::PropertyType::Notify
+ | QLowEnergyCharacteristic::ExtendedProperty);
const QLowEnergyDescriptorData clientConfig(
QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration,
@@ -968,6 +969,14 @@ void BtLocalDevice::peripheralAddServices()
QBluetoothUuid::DescriptorType::CharacteristicUserDescription,
leDescriptorValue);
charData.addDescriptor(userDescription);
+
+ const QLowEnergyDescriptorData extendedProperties(
+ QBluetoothUuid::DescriptorType::CharacteristicExtendedProperties,
+ // From bluetooth specs: length 2 bytes
+ // bit 0: reliable write, bit 1: writable auxiliaries
+ QByteArray::fromHex("0300"));
+ charData.addDescriptor(extendedProperties);
+
sd.addCharacteristic(charData);
// Set another characteristic without notifications