diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-06-21 12:27:48 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-06-21 12:27:48 +0200 |
commit | f4afc04ee7a085a89ad84ba89344bb50ca9e6e04 (patch) | |
tree | 404058c5ffd4773dfe13ddcd7a1cafc39864ae21 /apps/ble-inspect-device.h | |
parent | 7e2fb834d8ba2eb3fd6453f135d3e8ef30c852c6 (diff) | |
download | ble-toys-f4afc04ee7a085a89ad84ba89344bb50ca9e6e04.tar.gz ble-toys-f4afc04ee7a085a89ad84ba89344bb50ca9e6e04.tar.bz2 ble-toys-f4afc04ee7a085a89ad84ba89344bb50ca9e6e04.tar.xz ble-toys-f4afc04ee7a085a89ad84ba89344bb50ca9e6e04.zip |
o Trying to make the Bluetooth API more C++ idiomatic, a GATT connection has the same lifecycle as a BluetoothGatt.
sm-get-value:
o Better error handling.
Diffstat (limited to 'apps/ble-inspect-device.h')
-rw-r--r-- | apps/ble-inspect-device.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/ble-inspect-device.h b/apps/ble-inspect-device.h index bf79b2c..7d93f95 100644 --- a/apps/ble-inspect-device.h +++ b/apps/ble-inspect-device.h @@ -28,11 +28,11 @@ public: void scan_callback(BluetoothDevice &device) { cout << "Inspecting device: " << device.getMac().str() << endl; - auto &gatt = device.connectGatt(); + auto gatt = device.connectGatt(); - gatt.discoverServices(); + gatt->discoverServices(); - vector < BluetoothGattService * > services = gatt.getServices(); + vector < BluetoothGattService * > services = gatt->getServices(); cout << "Device has " << services.size() << " services" << endl; for (auto &s: services) { @@ -46,8 +46,6 @@ public: endl; } } - - gatt.disconnect(); } int main(app_execution &execution) override { |