From f4afc04ee7a085a89ad84ba89344bb50ca9e6e04 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 21 Jun 2015 12:27:48 +0200 Subject: 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. --- apps/ble-inspect-device.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'apps/ble-inspect-device.h') 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 { -- cgit v1.2.3