diff options
Diffstat (limited to 'include/UwbDbusManager.h')
-rw-r--r-- | include/UwbDbusManager.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/include/UwbDbusManager.h b/include/UwbDbusManager.h index 62626e2..7dbdae6 100644 --- a/include/UwbDbusManager.h +++ b/include/UwbDbusManager.h @@ -17,31 +17,41 @@ #ifndef __UWB_DBUS_MANAGER_H__ #define __UWB_DBUS_MANAGER_H__ +#include <functional> + #include <gio/gio.h> -#include <UwbIfaceHandler.h> +#include "generated-code.h" + +#include <Node.h> namespace UwbManagerNamespace { class UwbDbusManager { public: - UwbDbusManager() : _owner_id(0) {}; + UwbDbusManager() : _owner_id(0), _manager_skeleton(nullptr), _bus_acquired_cb(nullptr) {}; ~UwbDbusManager(); - /* TODO: Make this pointer to vector if there's multiple handlers */ - void init(UwbIfaceHandler *iface_handler); + void setBusAcquiredCallback(std::function<void(GDBusConnection *, UwbGdbuslibManager *)> bus_acquired_cb) + {_bus_acquired_cb = bus_acquired_cb;}; + void unsetBusAcquiredCallback(void) {_bus_acquired_cb = nullptr;}; + std::function<void(GDBusConnection *, UwbGdbuslibManager *)> getBusAcquiredCallback(void) {return _bus_acquired_cb;}; + void init(void); void deinit(void); - static void emitMessageReceivedSignal(uint16_t node_id, - const unsigned char *message, int message_length); - static void emitPositionChangedSignal(uint16_t node_id, int x, int y, int z); - + void emitPositionUpdatedSignal(Node *p_node); + void emitNodeAddedSignal(Node *p_node); + void emitNodeUpdatedSignal(Node *p_node); + void emitNodeRemovedSignal(Node *p_node); + UwbGdbuslibManager *getManagerSkeleton(void) {return _manager_skeleton;}; private: const std::string uwb_dbus_service_str = std::string("org.tizen.uwb"); guint _owner_id; - static void onBusAcquired(GDBusConnection *connection, const gchar *name, gpointer user_data); + + /* Add interface to default object path */ + UwbGdbuslibManager *_manager_skeleton; + std::function<void(GDBusConnection *, UwbGdbuslibManager *)> _bus_acquired_cb; }; } - #endif /* __UWB_DBUS_MANAGER_H__ */ |