4 * @brief Connman-based settings plugin.
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 #include "connman.hpp"
29 #include <settingsd/glib_traits.hpp>
30 #include <settingsd/unique_ptr.hpp>
37 ivi::settings::connman::connman(char const * interface,
39 GDBusConnection * connection)
42 static char const name[] = "net.connman"; // Service
44 GError * error = nullptr;
47 g_dbus_proxy_new_sync (connection,
48 G_DBUS_PROXY_FLAGS_NONE,
49 nullptr, // GDBusInterfaceInfo
53 nullptr, // GCancellable
56 unique_ptr<GError> safe_error(error);
58 if (proxy_ == nullptr) {
59 g_printerr("Unable to create D-Bus proxy for (\"%s\", \"%s\"): %s\n",
64 throw std::runtime_error(error->message);
68 ivi::settings::connman::~connman()
70 if (proxy_ != nullptr)
71 g_object_unref(proxy_);
75 ivi::settings::connman::set_property(char const * property,
79 static gint const timeout = 5000; // milliseconds
81 return g_dbus_proxy_call_sync(proxy_,
82 "SetProperty", // Method name
86 G_DBUS_CALL_FLAGS_NONE,
88 nullptr, // Not cancellable
96 // indent-tabs-mode: nil