summaryrefslogtreecommitdiffstats
path: root/src/BluetoothEvent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/BluetoothEvent.cpp')
-rw-r--r--src/BluetoothEvent.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/BluetoothEvent.cpp b/src/BluetoothEvent.cpp
index 1b68f629..ee797343 100644
--- a/src/BluetoothEvent.cpp
+++ b/src/BluetoothEvent.cpp
@@ -36,12 +36,15 @@ BluetoothEvent::BluetoothEvent(BluetoothType type, std::string *name,
this->parent = nullptr;
this->execute_once = execute_once;
- this->cb = cb;
- if (cb == generic_callback)
+ if (cb == nullptr) {
this->data = static_cast<void *>(&cv);
- else
+ this->cb = generic_callback;
+ }
+ else {
+ this->cb = cb;
this->data = data;
+ }
}
bool BluetoothEvent::execute_callback(BluetoothObject &object)