summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/android
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@qt.io>2018-01-29 19:06:59 +0100
committerOliver Wolff <oliver.wolff@qt.io>2018-08-17 06:28:17 +0000
commit0f930cddefe386c6b6f65b8b11342c9e76876a9b (patch)
tree546340d74090e05865bc4a28d27895ae969e1919 /src/bluetooth/android
parentc0960600bad55c5df62ba26a78d08179658b0454 (diff)
Add manufacturer data to QBluetoothDeviceInfo
The initial patch was contributed by Thiemo van Engelen. Change-Id: I45fad793ba092ab2820e606d8bf8807afa3e911e Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/bluetooth/android')
-rw-r--r--src/bluetooth/android/devicediscoverybroadcastreceiver.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp b/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
index 131fb48d..99245af3 100644
--- a/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
+++ b/src/bluetooth/android/devicediscoverybroadcastreceiver.cpp
@@ -245,6 +245,7 @@ enum ADType {
ADType32BitUuidComplete = 0x05,
ADType128BitUuidIncomplete = 0x06,
ADType128BitUuidComplete = 0x07,
+ ADTypeManufacturerSpecificData = 0xff,
// .. more will be added when required
};
@@ -548,6 +549,12 @@ QBluetoothDeviceInfo DeviceDiscoveryBroadcastReceiver::retrieveDeviceInfo(JNIEnv
foundService =
QBluetoothUuid(qToBigEndian<quint128>(qFromLittleEndian<quint128>(dataPtr)));
break;
+ case ADTypeManufacturerSpecificData:
+ if (nBytes >= 3) {
+ info.setManufacturerData(qFromLittleEndian<quint16>(dataPtr),
+ QByteArray(dataPtr + 2, nBytes - 3));
+ }
+ break;
default:
// no other types supported yet and therefore skipped
// https://www.bluetooth.org/en-us/specification/assigned-numbers/generic-access-profile