aboutsummaryrefslogtreecommitdiff
path: root/ble
diff options
context:
space:
mode:
Diffstat (limited to 'ble')
-rw-r--r--ble/BluetoothImpl.h31
-rw-r--r--ble/LinuxBluetooth.cpp11
2 files changed, 13 insertions, 29 deletions
diff --git a/ble/BluetoothImpl.h b/ble/BluetoothImpl.h
index 802c844..975a011 100644
--- a/ble/BluetoothImpl.h
+++ b/ble/BluetoothImpl.h
@@ -40,33 +40,6 @@ protected:
// Shared classes
-namespace detail {
-
-template<typename T, typename U>
-struct constify2;
-
-template<typename T, typename U>
-struct constify2<T *, U *> {
- typedef T *type;
-};
-
-template<typename T, typename U>
-struct constify2<T *, U const *> {
- typedef T const *type;
-};
-
-}
-
-template<typename A, typename B>
-class CollectionImpl : public Collection<A> {
-public:
- explicit CollectionImpl(B &b) : b(b) {
- }
-
-private:
- B &b;
-};
-
class DefaultBluetoothGattCharacteristic : protected LogSetup, public BluetoothGattCharacteristic {
public:
DefaultBluetoothGattCharacteristic(const BluetoothGattServicePtr &service, uint16_t handle, Uuid uuid,
@@ -97,6 +70,10 @@ public:
return valueHandle;
}
+ shared_ptr<BluetoothGattDescriptor> getDescriptor(Uuid uuid) const override {
+ return {};
+ }
+
protected:
BluetoothGattServicePtr service;
uint16_t handle;
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;