aboutsummaryrefslogtreecommitdiff
path: root/LinuxBluetooth.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-02-17 23:40:12 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-02-17 23:40:12 +0100
commitdd6a36ea62b8c3e5f20f6d5fd432dec2275aac5a (patch)
tree40174dc2bd5ab8342da433eb4adea939c0df712f /LinuxBluetooth.cpp
parent08c735d7520e858868bc2c724572139998e39ada (diff)
downloadble-toys-dd6a36ea62b8c3e5f20f6d5fd432dec2275aac5a.tar.gz
ble-toys-dd6a36ea62b8c3e5f20f6d5fd432dec2275aac5a.tar.bz2
ble-toys-dd6a36ea62b8c3e5f20f6d5fd432dec2275aac5a.tar.xz
ble-toys-dd6a36ea62b8c3e5f20f6d5fd432dec2275aac5a.zip
o Finally correct decoding of ATT response.
Diffstat (limited to 'LinuxBluetooth.cpp')
-rw-r--r--LinuxBluetooth.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/LinuxBluetooth.cpp b/LinuxBluetooth.cpp
index 2c0bffa..b886dde 100644
--- a/LinuxBluetooth.cpp
+++ b/LinuxBluetooth.cpp
@@ -1,9 +1,6 @@
#include "Bluetooth.h"
#include <string.h>
-#include <stropts.h>
-#include <sys/select.h>
-#include <unistd.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
@@ -170,7 +167,7 @@ void LinuxBluetoothDevice::discoverServices() {
throw BluetoothException(this, "read(): " + errnoAsString());
}
- ByteBuffer in = ByteBuffer(buffer, r);
+ ByteBuffer in = ByteBuffer(buffer, (size_t) r);
D << "read: " << r << " bytes: " << in.toString();
@@ -179,7 +176,9 @@ void LinuxBluetoothDevice::discoverServices() {
D << "READ_BY_GROUP_TYPE response has " + to_string(values.size()) + " values";
for (auto &data: values) {
- D << "handle: " << data.handle << ", groupEndHandle: " << data.groupEndHandle << ", value: " << data.value.toString();
+ D << "handle: 0x" << setw(4) << setfill('0') << hex << data.handle <<
+ ", groupEndHandle: 0x" << hex << setw(4) << setfill('0') << data.groupEndHandle <<
+ ", value: " << data.value.toString();
}
}