diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-08-12 14:54:06 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-08-13 17:21:56 +0200 |
commit | 05dc94529b1a8f7c65c8aebbf8081d1d1f3aa96a (patch) | |
tree | eba72249447d6e2a3f28ed5b2cbfb351a0bc2053 /src/bluetooth/qlowenergycontroller_bluez.cpp | |
parent | 81b3178cede7fad5360755a1186071548d139198 (diff) | |
download | qtconnectivity-05dc94529b1a8f7c65c8aebbf8081d1d1f3aa96a.tar.gz |
Remove libbluetooth system header dependencies from BTLE code base
Change-Id: I44c2ba2308a786b1ed67a9f89701c2d18fe64f6b
Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_bluez.cpp')
-rw-r--r-- | src/bluetooth/qlowenergycontroller_bluez.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/bluetooth/qlowenergycontroller_bluez.cpp b/src/bluetooth/qlowenergycontroller_bluez.cpp index fe0ae9f2..dcb99736 100644 --- a/src/bluetooth/qlowenergycontroller_bluez.cpp +++ b/src/bluetooth/qlowenergycontroller_bluez.cpp @@ -42,14 +42,12 @@ #include "qlowenergycontroller_p.h" #include "qbluetoothsocket_p.h" +#include "bluez/bluez_data_p.h" #include <QtCore/QLoggingCategory> #include <QtBluetooth/QBluetoothSocket> #include <QtBluetooth/QLowEnergyService> -#include <bluetooth/bluetooth.h> -#include <bluetooth/l2cap.h> - #define ATTRIBUTE_CHANNEL_ID 4 #define ATT_DEFAULT_LE_MTU 23 @@ -115,9 +113,9 @@ QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(QT_BT_BLUEZ) -static inline QBluetoothUuid convert_uuid128(const uint128_t *p) +static inline QBluetoothUuid convert_uuid128(const quint128 *p) { - uint128_t dst_hostOrder, dst_bigEndian; + quint128 dst_hostOrder, dst_bigEndian; // Bluetooth LE data comes as little endian // uuids are constructed using high endian @@ -126,7 +124,7 @@ static inline QBluetoothUuid convert_uuid128(const uint128_t *p) // convert to Qt's own data type quint128 qtdst; - memcpy(&qtdst, &dst_bigEndian, sizeof(uint128_t)); + memcpy(&qtdst, &dst_bigEndian, sizeof(quint128)); return QBluetoothUuid(qtdst); } @@ -379,7 +377,7 @@ QLowEnergyHandle parseReadByTypeCharDiscovery( if (elementLength == 7) // 16 bit uuid charData->uuid = QBluetoothUuid(bt_get_le16(&data[5])); else - charData->uuid = convert_uuid128((uint128_t *)&data[5]); + charData->uuid = convert_uuid128((quint128 *)&data[5]); qCDebug(QT_BT_BLUEZ) << "Found handle:" << hex << attributeHandle << "properties:" << charData->properties @@ -407,7 +405,7 @@ QLowEnergyHandle parseReadByTypeIncludeDiscovery( if (elementLength == 8) //16 bit uuid foundServices->append(QBluetoothUuid(bt_get_le16(&data[6]))); else - foundServices->append(convert_uuid128((uint128_t *) &data[6])); + foundServices->append(convert_uuid128((quint128 *) &data[6])); qCDebug(QT_BT_BLUEZ) << "Found included service: " << hex << attributeHandle << "uuid:" << *foundServices; @@ -478,7 +476,7 @@ void QLowEnergyControllerPrivate::processReply( if (elementLength == 6) //16 bit uuid uuid = QBluetoothUuid(bt_get_le16(&data[offset+4])); else if (elementLength == 20) //128 bit uuid - uuid = convert_uuid128((uint128_t *)&data[offset+4]); + uuid = convert_uuid128((quint128 *)&data[offset+4]); //else -> do nothing offset += elementLength; @@ -715,7 +713,7 @@ void QLowEnergyControllerPrivate::processReply( if (format == 0x01) uuid = QBluetoothUuid(bt_get_le16(&data[offset+2])); else if (format == 0x02) - uuid = convert_uuid128((uint128_t *)&data[offset+2]); + uuid = convert_uuid128((quint128 *)&data[offset+2]); offset += elementLength; |