diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-11-19 23:13:50 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-11-19 23:13:50 +0100 |
commit | e8aa2eadf309fbc0c0e1418c6bee482e505fa09b (patch) | |
tree | e93292292834b8d8959301cd8d02b27090e7e0ca /ble/LinuxBluetooth.cpp | |
parent | d6f16958eaa966332b911eb9257b8524c2efd772 (diff) | |
download | ble-toys-e8aa2eadf309fbc0c0e1418c6bee482e505fa09b.tar.gz ble-toys-e8aa2eadf309fbc0c0e1418c6bee482e505fa09b.tar.bz2 ble-toys-e8aa2eadf309fbc0c0e1418c6bee482e505fa09b.tar.xz ble-toys-e8aa2eadf309fbc0c0e1418c6bee482e505fa09b.zip |
ble-read-characteristic: working READ mode, starting on NOTIFY.
Diffstat (limited to 'ble/LinuxBluetooth.cpp')
-rw-r--r-- | ble/LinuxBluetooth.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ble/LinuxBluetooth.cpp b/ble/LinuxBluetooth.cpp index d3fe80b..444e3a2 100644 --- a/ble/LinuxBluetooth.cpp +++ b/ble/LinuxBluetooth.cpp @@ -1,4 +1,5 @@ #include "BluetoothImpl.h" +#include "ble/misc.h" #include <bluetooth/bluetooth.h> #include <bluetooth/hci.h> @@ -22,8 +23,9 @@ namespace trygvis { namespace bluetooth { namespace linux { -using namespace uuids; +//using namespace uuids; using namespace std::chrono_literals; +using namespace std; using std::to_string; class LinuxBluetoothGatt; @@ -55,7 +57,7 @@ public: void runScan(std::function<void(const shared_ptr<BluetoothDevice> &device)>) override; - shared_ptr <BluetoothDevice> getDevice(Mac &mac) override; + shared_ptr<BluetoothDevice> getDevice(Mac &mac) override; private: void startScan() override; @@ -105,6 +107,8 @@ public: ByteBuffer readValue(const BluetoothGattCharacteristicPtr &c, ByteBuffer& response) override; + void setCharacteristicNotification(const BluetoothGattDescriptorPtr &c, bool enable) override; + private: void connect(); @@ -302,6 +306,9 @@ ByteBuffer LinuxBluetoothGatt::readValue(const BluetoothGattCharacteristicPtr &c return view; } +void LinuxBluetoothGatt::setCharacteristicNotification(const BluetoothGattDescriptorPtr &c, bool enable) { +} + void LinuxBluetoothGatt::discoverServices() { uint16_t startHandle = 0x0001; |