diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-04-12 20:06:47 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-04-12 20:06:47 +0200 |
commit | 2ca532122d60cff4dbdc7f24fbc5783bcc5ad68d (patch) | |
tree | 19f9ce796886e216a608fa5e938bd2bd4f0d0b55 /apps/ble-inspect-device.cpp | |
parent | ce07550c57172443c10a66957b50085e273d20b3 (diff) | |
download | ble-toys-2ca532122d60cff4dbdc7f24fbc5783bcc5ad68d.tar.gz ble-toys-2ca532122d60cff4dbdc7f24fbc5783bcc5ad68d.tar.bz2 ble-toys-2ca532122d60cff4dbdc7f24fbc5783bcc5ad68d.tar.xz ble-toys-2ca532122d60cff4dbdc7f24fbc5783bcc5ad68d.zip |
Soil Moisture: Adding support for controlling lights.
Bluetooth: refectorying, trying to be more c++ idiomatic and modern.
SM/Diller: adding bluetooth to Diller bridge.
Diffstat (limited to 'apps/ble-inspect-device.cpp')
-rw-r--r-- | apps/ble-inspect-device.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/ble-inspect-device.cpp b/apps/ble-inspect-device.cpp index 2140e03..baee93a 100644 --- a/apps/ble-inspect-device.cpp +++ b/apps/ble-inspect-device.cpp @@ -29,11 +29,11 @@ public: gatt->discoverServices(); - vector<BluetoothGattService *> services = gatt->getServices(); + auto services = gatt->getServices(); cout << "Device has " << services.size() << " services" << endl; for (auto &s : services) { - const vector<BluetoothGattCharacteristic *> characteristics = s->getCharacteristics(); + auto characteristics = s->getCharacteristics(); cout << "Service: UUID: " << s->getUuid() << ", has " << characteristics.size() << " characteristics" << endl; @@ -60,10 +60,10 @@ public: scan_callback(device); return EXIT_SUCCESS; - } catch (std::runtime_error ex) { + } catch (std::runtime_error &ex) { cout << "std::runtime_error: " << ex.what() << endl; return EXIT_FAILURE; - } catch (std::exception ex) { + } catch (std::exception &ex) { cout << "std::exception: " << ex.what() << endl; return EXIT_FAILURE; } |