blob: 309f30652acef517d2fd480006cf1e3d9efa2c69 [file] [log] [blame]
Paul Stewart835934a2012-12-06 19:27:09 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "shill/supplicant_network_proxy.h"
6
7#include <map>
8#include <string>
9
10#include <dbus-c++/dbus.h>
11
12#include "shill/logging.h"
13
14using std::map;
15using std::string;
16
17namespace shill {
18
19SupplicantNetworkProxy::SupplicantNetworkProxy(
20 DBus::Connection *bus,
21 const ::DBus::Path &object_path,
22 const char *dbus_addr)
23 : proxy_(bus, object_path, dbus_addr) {}
24
25SupplicantNetworkProxy::~SupplicantNetworkProxy() {}
26
27void SupplicantNetworkProxy::SetEnabled(bool enabled) {
28 SLOG(DBus, 2) << __func__;
29 try {
30 return proxy_.Enabled(enabled);
31 } catch (const DBus::Error &e) {
32 LOG(ERROR) << "DBus exception: " << e.name() << ": " << e.what()
33 << "enabled: " << enabled;
34 throw; // Re-throw the exception.
35 }
36}
37
38// definitions for private class SupplicantNetworkProxy::Proxy
39
40SupplicantNetworkProxy::Proxy::Proxy(
41 DBus::Connection *bus, const DBus::Path &dbus_path, const char *dbus_addr)
42 : DBus::ObjectProxy(*bus, dbus_path, dbus_addr) {}
43
44SupplicantNetworkProxy::Proxy::~Proxy() {}
45
46void SupplicantNetworkProxy::Proxy::PropertiesChanged(
47 const map<string, ::DBus::Variant> &properties) {
48 SLOG(DBus, 2) << __func__;
49 // TODO(pstew): Some day we could notify someone about this state change.
50}
51
52} // namespace shill