diff options
Diffstat (limited to 'plugins/connman/connman_manager.hpp')
-rw-r--r-- | plugins/connman/connman_manager.hpp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/plugins/connman/connman_manager.hpp b/plugins/connman/connman_manager.hpp index b174950..e96542d 100644 --- a/plugins/connman/connman_manager.hpp +++ b/plugins/connman/connman_manager.hpp @@ -98,6 +98,22 @@ namespace ivi */ void get_services(response_callback & response) const; + struct signal_data + { + signal_data(GDBusConnection * connection, + event_callback const & e) + : callback(e) + , subscriptions(connection, callback) + { + } + + /// Callback through which events will be sent to clients. + event_callback callback; + + /// Signal subscription manager. + subscription_manager subscriptions; + }; + private: /** @@ -121,17 +137,27 @@ namespace ivi void call_method(char const * name, response_callback & response) const; + typedef void (*ivi_signal_callback)(GDBusConnection * connection, + char const * sender_name, + char const * object_path, + char const * interface_name, + char const * signal_name, + GVariant * parameters, + gpointer user_data); + /// Subscribe to Connman Manager signal @a name. guint subscribe_to_signal(GDBusConnection * connection, - char const * name); + char const * name, + ivi_signal_callback callback, + void * user_data); private: /// The proxy used to access the connman Manager D-Bus API. connman connman_; - /// Callback through which events will be sent to clients. - event_callback event_callback_; + /// Data passed to signal handlers. + signal_data data_; /// TechnologyAdded signal subscription ID. guint const technology_added_id_; @@ -142,9 +168,6 @@ namespace ivi /// ServicesChanged signal subscription ID. guint const services_changed_id_; - /// Signal subscription manager. - subscription_manager subscriptions_; - }; } |