aboutsummaryrefslogtreecommitdiff
path: root/ble/BluetoothImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'ble/BluetoothImpl.h')
-rw-r--r--ble/BluetoothImpl.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/ble/BluetoothImpl.h b/ble/BluetoothImpl.h
index 204b051..3f4615e 100644
--- a/ble/BluetoothImpl.h
+++ b/ble/BluetoothImpl.h
@@ -16,6 +16,7 @@
0x00, 0x80, 0x5f, 0x9b, 0x34, 0xfb \
};
+#define LOG_TRACE(body) LOG4CPLUS_TRACE(logger, body)
#define LOG_DEBUG(body) LOG4CPLUS_DEBUG(logger, body)
#define LOG_INFO(body) LOG4CPLUS_INFO(logger, body)
#define LOG_WARN(body) LOG4CPLUS_WARN(logger, body)
@@ -44,8 +45,10 @@ protected:
class DefaultBluetoothGattCharacteristic : LogSetup, public BluetoothGattCharacteristic {
public:
- DefaultBluetoothGattCharacteristic(BluetoothGattService &service, uint16_t handle, uuid_t uuid, uint8_t properties, uint16_t valueHandle)
- : LogSetup("DefaultBluetoothGattCharacteristic"), service(service), handle(handle), uuid(uuid), properties(properties), valueHandle(valueHandle) {
+ DefaultBluetoothGattCharacteristic(BluetoothGattService &service, uint16_t handle, uuid_t uuid, uint8_t properties,
+ uint16_t valueHandle)
+ : LogSetup("DefaultBluetoothGattCharacteristic"), service(service), handle(handle), uuid(uuid),
+ properties(properties), valueHandle(valueHandle) {
}
virtual ~DefaultBluetoothGattCharacteristic() {
@@ -81,7 +84,8 @@ protected:
class DefaultBluetoothGattService : public BluetoothGattService {
public:
- DefaultBluetoothGattService(BluetoothDevice &device, const uuid_t uuid, const uint16_t handle, const uint16_t endGroupHandle)
+ DefaultBluetoothGattService(BluetoothDevice &device, const uuid_t uuid, const uint16_t handle,
+ const uint16_t endGroupHandle)
: device(device), uuid(uuid), handle(handle), endGroupHandle(endGroupHandle) {
}
@@ -218,12 +222,18 @@ protected:
class DefaultBluetoothAdapter : protected LogSetup, public BluetoothAdapter {
public:
protected:
- DefaultBluetoothAdapter() :
- LogSetup("BluetoothAdapter") {
+ DefaultBluetoothAdapter(Mac &mac) :
+ LogSetup("BluetoothAdapter"), mac(mac) {
}
+
+ Mac const &getMac() override {
+ return mac;
+ };
+
+ Mac &mac;
};
-BluetoothAdapter &getAdapterImpl(int hciDevice);
+shared_ptr<BluetoothAdapter> getAdapterImpl(int hciDevice);
void shutdownImpl();