diff options
Diffstat (limited to 'LinuxBluetooth.cpp')
-rw-r--r-- | LinuxBluetooth.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/LinuxBluetooth.cpp b/LinuxBluetooth.cpp index a15f350..c30a2b7 100644 --- a/LinuxBluetooth.cpp +++ b/LinuxBluetooth.cpp @@ -129,12 +129,12 @@ namespace trygvis { addr.l2_family = AF_BLUETOOTH; addr.l2_cid = htobs(ATT_CID); addr.l2_bdaddr_type = BDADDR_LE_RANDOM; - _mac.copy(addr.l2_bdaddr.b[0], - addr.l2_bdaddr.b[1], - addr.l2_bdaddr.b[2], - addr.l2_bdaddr.b[3], + _mac.copy(addr.l2_bdaddr.b[5], addr.l2_bdaddr.b[4], - addr.l2_bdaddr.b[5]); + addr.l2_bdaddr.b[3], + addr.l2_bdaddr.b[2], + addr.l2_bdaddr.b[1], + addr.l2_bdaddr.b[0]); if (::connect(l2cap, (struct sockaddr *) &addr, sizeof(addr)) < 0) { close(l2cap); @@ -165,15 +165,13 @@ namespace trygvis { D << "read: " << r << " bytes"; - vector<AttributeData *> *values = AttPdu::parseReadByGroupType(in); + vector<AttributeData> values = AttPdu::parseReadByGroupType(in); - D << "READ_BY_GROUP_TYPE response has " + to_string(values->size()) + " values"; + D << "READ_BY_GROUP_TYPE response has " + to_string(values.size()) + " values"; - for (auto &data: *values) { - D << "handle: " << data->handle << ", value: " << data->value.toString(); + for (auto &data: values) { + D << "handle: " << data.handle << ", value: " << data.value.toString(); } - - delete values; } // ----------------------------------------------------------------------- |