2 * @file connman_manager.hpp
4 * @brief Connman Manager-based settings plugin header.
6 * @author Ossama Othman @<ossama.othman@@intel.com@>
9 * Copyright 2013 Intel Corporation All Rights Reserved.
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation;
14 * version 2.1 of the License.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301 USA
27 #ifndef IVI_SETTINGS_CONNMAN_MANAGER_HPP
28 #define IVI_SETTINGS_CONNMAN_MANAGER_HPP
30 #include "connman.hpp"
31 #include "subscription_manager.hpp"
33 #include <settingsd/plugin.hpp>
34 #include <settingsd/event_callback.hpp>
46 * @class connman_manager
48 * @brief D-Bus Connman Manager object bridge.
50 * This class exposes the Connman Manager D-Bus API through the
51 * settings daemon WebSocket API.
53 class connman_manager : public plugin
58 connman_manager(GDBusConnection * connection,
59 event_callback const & e);
65 * @name Settings Plugin API
67 * Interface defined by the @c ivi::settings::plugin abstract
70 * @see settingsd/plugin.hpp
73 virtual std::string const & id() const;
74 virtual void handle_request(std::string request,
75 response_callback response);
79 * Get the properties for a specific technology.
81 * @param[in] technology Connman technology for which properties
82 * are being retrieved.
83 * @param[inout] error Glib error object that contains
84 * additional error information if
85 * non-null if the call completes.
87 * @return @c GVariant containing a dictionary of properties
88 * specific to @a technology.
90 GVariant * get_properties(std::string const & technology,
91 GError *& error) const;
94 * Get connman services and their properties.
96 * @param[inout] response Callback used to send results to the
99 void get_services(response_callback & response) const;
103 signal_data(GDBusConnection * connection,
104 event_callback const & e)
106 , subscriptions(connection, callback)
110 /// Callback through which events will be sent to clients.
111 event_callback callback;
113 /// Signal subscription manager.
114 subscription_manager subscriptions;
120 * Get connman technologies and their properties.
122 * @param[inout] response Callback used to send results to the
125 void get_technologies(response_callback & response) const;
128 * Call the method @a name on the connman Manager object. This
129 * method is meant to be used for @c GetServices and
130 * @c GetTechnologies requests.
132 * @param[in] name The connman Manager object method
134 * @param[inout] response Callback used to inform the caller of
137 void call_method(char const * name,
138 response_callback & response) const;
140 typedef void (*ivi_signal_callback)(GDBusConnection * connection,
141 char const * sender_name,
142 char const * object_path,
143 char const * interface_name,
144 char const * signal_name,
145 GVariant * parameters,
148 /// Subscribe to Connman Manager signal @a name.
149 guint subscribe_to_signal(GDBusConnection * connection,
151 ivi_signal_callback callback,
156 /// The proxy used to access the connman Manager D-Bus API.
159 /// Data passed to signal handlers.
162 /// TechnologyAdded signal subscription ID.
163 guint const technology_added_id_;
165 /// TechnologyRemoved signal subscription ID.
166 guint const technology_removed_id_;
168 /// ServicesChanged signal subscription ID.
169 guint const services_changed_id_;
177 #endif /* IVI_SETTINGS_CONNMAN_MANAGER_HPP */
183 // indent-tabs-mode: nil