4 * @brief Connman technology request handling.
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_TECHNOLOGY_HPP
28 #define IVI_SETTINGS_CONNMAN_TECHNOLOGY_HPP
30 #include "connman.hpp"
34 #include <json-glib/json-glib.h>
41 class response_callback;
42 class connman_manager;
47 * @brief Common technology-based settings functionality.
49 * This class implements functionality common to all technology-based
50 * settings, such as bluetooth, wifi, date/time, etc.
59 * @param[in] tech The connman technology, e.g. "bluetooth".
60 * @param[in] e Callback through which events will be sent to
63 technology(std::string tech,
64 connman_manager & manager,
65 event_callback const & e);
67 /// Handle requests common to all connman technologies.
68 void handle_request(std::string request,
69 response_callback response);
73 /// Get technology "Powered" state.
74 void get_powered(JsonReader * reader,
75 response_callback response);
77 /// Set technology "Powered" state.
78 void set_powered(JsonReader * reader,
79 response_callback response);
82 * Scan for services that implement the technology, e.g. WiFi
85 void scan(JsonReader * reader,
86 response_callback response);
89 * Connect to service whose object path is found in the JSON
92 void connect(JsonReader * reader,
93 response_callback response);
96 * Disconnect from service whose object path is found in the
99 void disconnect(JsonReader * reader,
100 response_callback response);
102 /// Send list of services to caller.
103 void send_services(response_callback response,
107 * Get property for this technology.
109 * @param[in] name Name of the connman technology property
111 * @param[in] type The type of property being retrieved.
112 * @param[in] response The response callback through errors will
113 * be sent to the caller.
115 * @returns A @c GVariant containing the retrieved property.
117 GVariant * get_property(char const * name,
118 GVariantType const * type,
119 response_callback response);
123 /// The proxy used to access the connman Technology D-Bus API.
126 /// The proxy used to access the connman Manager D-Bus API.
127 connman_manager & manager_;
129 /// Technology name, e.g. "bluetooth" or "wifi".
130 std::string const technology_;
132 /// Callback through which events will be sent to clients.
133 event_callback event_callback_;
141 #endif /* IVI_SETTINGS_CONNMAN_TECHNOLOGY_HPP */
147 // indent-tabs-mode: nil