/** * @file technology.hpp * * @brief Connman technology request handling. * * @author Ossama Othman @ * * @copyright @par * Copyright 2013 Intel Corporation All Rights Reserved. * @par * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * @par * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * @par * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifndef IVI_SETTINGS_CONNMAN_TECHNOLOGY_HPP #define IVI_SETTINGS_CONNMAN_TECHNOLOGY_HPP #include "connman.hpp" #include #include namespace ivi { namespace settings { class response_callback; class connman_manager; /** * @class technology * * @brief Common technology-based settings functionality. * * This class implements functionality common to all technology-based * settings, such as bluetooth, wifi, date/time, etc. */ class technology { public: /** * Constructor. * * @param[in] tech The connman technology, e.g. "bluetooth". * @param[in] e Callback through which events will be sent to * clients. */ technology(std::string tech, connman_manager & manager, event_callback const & e); /// Handle requests common to all connman technologies. void handle_request(std::string request, response_callback response); private: /// Get technology "Powered" state. void get_powered(JsonReader * reader, response_callback response); /// Set technology "Powered" state. void set_powered(JsonReader * reader, response_callback response); /** * Scan for services that implement the technology, e.g. WiFi * access points. */ void scan(JsonReader * reader, response_callback response); /** * Connect to service whose object path is found in the JSON * request. */ void connect(JsonReader * reader, response_callback response); /** * Disconnect from service whose object path is found in the * JSON request. */ void disconnect(JsonReader * reader, response_callback response); /// Send list of services to caller. void send_services(response_callback response, GError *& error); /** * Get property for this technology. * * @param[in] name Name of the connman technology property * to retrieve. * @param[in] type The type of property being retrieved. * @param[in] response The response callback through errors will * be sent to the caller. * * @returns A @c GVariant containing the retrieved property. */ GVariant * get_property(char const * name, GVariantType const * type, response_callback response); private: /// The proxy used to access the connman Technology D-Bus API. connman connman_; /// The proxy used to access the connman Manager D-Bus API. connman_manager & manager_; /// Technology name, e.g. "bluetooth" or "wifi". std::string const technology_; /// Callback through which events will be sent to clients. event_callback event_callback_; }; } } #endif /* IVI_SETTINGS_CONNMAN_TECHNOLOGY_HPP */ // Local Variables: // mode:c++ // c-basic-offset:2 // indent-tabs-mode: nil // End: