aboutsummaryrefslogtreecommitdiff
path: root/ble/BluetoothImpl.h
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-02-21 10:37:25 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2015-02-21 10:37:25 +0100
commita76e09808905d280282a81958cb4c68f71f18ca4 (patch)
tree52719f5d59bbdeee52188c9094850c80e24eaa67 /ble/BluetoothImpl.h
parent7c9f266cdb37e215279208198dfe009dc66c5daa (diff)
downloadble-toys-a76e09808905d280282a81958cb4c68f71f18ca4.tar.gz
ble-toys-a76e09808905d280282a81958cb4c68f71f18ca4.tar.bz2
ble-toys-a76e09808905d280282a81958cb4c68f71f18ca4.tar.xz
ble-toys-a76e09808905d280282a81958cb4c68f71f18ca4.zip
o Consistence reference usage.
Diffstat (limited to 'ble/BluetoothImpl.h')
-rw-r--r--ble/BluetoothImpl.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/ble/BluetoothImpl.h b/ble/BluetoothImpl.h
index 7801771..ef9a733 100644
--- a/ble/BluetoothImpl.h
+++ b/ble/BluetoothImpl.h
@@ -133,7 +133,7 @@ public:
}
protected:
- DefaultBluetoothDevice(A adapter, Mac &mac) :
+ DefaultBluetoothDevice(A &adapter, Mac &mac) :
adapter(adapter), mac(mac) {
DF;
}
@@ -150,13 +150,18 @@ protected:
services.clear();
}
- A adapter;
+ A &adapter;
Mac &mac;
vector<BluetoothGattService *> services;
};
+template<class _D>
class DefaultBluetoothGatt : public BluetoothGatt {
public:
+ virtual _D &getDevice() const {
+ return device;
+ }
+
virtual const vector<BluetoothGattService *> getServices() const {
return services;
};
@@ -176,7 +181,7 @@ public:
}
protected:
- DefaultBluetoothGatt() {
+ DefaultBluetoothGatt(_D &device) : device(device) {
DF;
}
@@ -192,6 +197,7 @@ protected:
services.clear();
}
+ _D &device;
vector<BluetoothGattService *> services;
};