blob: 6d804321387786f00f7490d915d055115eae2793 [file] [log] [blame]
mukesh agrawalaf571952011-07-14 14:31:12 -07001// Copyright (c) 2011 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_interface_proxy.h"
6
7#include <map>
8#include <string>
9
10#include <base/logging.h>
11#include <dbus-c++/dbus.h>
12
13#include "shill/wifi.h"
14
15using std::map;
16using std::string;
17
18namespace shill {
19
20SupplicantInterfaceProxy::SupplicantInterfaceProxy(
21 const WiFiRefPtr &wifi,
Darin Petkovaceede32011-07-18 15:32:38 -070022 DBus::Connection *bus,
mukesh agrawalaf571952011-07-14 14:31:12 -070023 const ::DBus::Path &object_path,
24 const char *dbus_addr)
Darin Petkovaceede32011-07-18 15:32:38 -070025 : proxy_(wifi, bus, object_path, dbus_addr) {}
mukesh agrawalaf571952011-07-14 14:31:12 -070026
27SupplicantInterfaceProxy::~SupplicantInterfaceProxy() {}
28
29::DBus::Path SupplicantInterfaceProxy::AddNetwork(
30 const std::map<std::string, ::DBus::Variant> &args) {
31 return proxy_.AddNetwork(args);
32}
33
34void SupplicantInterfaceProxy::FlushBSS(const uint32_t &age) {
35 return proxy_.FlushBSS(age);
36}
37
38void SupplicantInterfaceProxy::RemoveAllNetworks() {
39 return proxy_.RemoveAllNetworks();
40}
41
42void SupplicantInterfaceProxy::Scan(
43 const std::map<std::string, ::DBus::Variant> &args) {
44 return proxy_.Scan(args);
45}
46
47void SupplicantInterfaceProxy::SelectNetwork(const ::DBus::Path &network) {
48 return proxy_.SelectNetwork(network);
49}
50
51// definitions for private class SupplicantInterfaceProxy::Proxy
52
53SupplicantInterfaceProxy::Proxy::Proxy(
54 const WiFiRefPtr &wifi, DBus::Connection *bus,
55 const DBus::Path &dbus_path, const char *dbus_addr)
56 : DBus::ObjectProxy(*bus, dbus_path, dbus_addr),
57 wifi_(wifi) {}
58
59SupplicantInterfaceProxy::Proxy::~Proxy() {}
60
mukesh agrawal1830fa12011-09-26 14:31:40 -070061void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070062 LOG(INFO) << __func__;
63 // XXX
64}
65
mukesh agrawal1830fa12011-09-26 14:31:40 -070066void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &/*blobname*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070067 LOG(INFO) << __func__;
68 // XXX
69}
70
71void SupplicantInterfaceProxy::Proxy::BSSAdded(
72 const ::DBus::Path &BSS,
73 const std::map<string, ::DBus::Variant> &properties) {
74 LOG(INFO) << __func__;
75 wifi_->BSSAdded(BSS, properties);
76}
77
mukesh agrawal1830fa12011-09-26 14:31:40 -070078void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &/*BSS*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070079 LOG(INFO) << __func__;
80 // XXX
81}
82
83void SupplicantInterfaceProxy::Proxy::NetworkAdded(
mukesh agrawal1830fa12011-09-26 14:31:40 -070084 const ::DBus::Path &/*network*/,
85 const std::map<string, ::DBus::Variant> &/*properties*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070086 LOG(INFO) << __func__;
87 // XXX
88}
89
90void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
mukesh agrawal1830fa12011-09-26 14:31:40 -070091 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070092 LOG(INFO) << __func__;
93 // XXX
94}
95
96void SupplicantInterfaceProxy::Proxy::NetworkSelected(
mukesh agrawal1830fa12011-09-26 14:31:40 -070097 const ::DBus::Path &/*network*/) {
mukesh agrawalaf571952011-07-14 14:31:12 -070098 LOG(INFO) << __func__;
99 // XXX
100}
101
102void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
mukesh agrawal7ec71312011-11-10 02:08:26 +0000103 const std::map<string, ::DBus::Variant> &properties) {
mukesh agrawalaf571952011-07-14 14:31:12 -0700104 LOG(INFO) << __func__;
mukesh agrawal7ec71312011-11-10 02:08:26 +0000105 wifi_->PropertiesChanged(properties);
mukesh agrawalaf571952011-07-14 14:31:12 -0700106}
107
108void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) {
109 LOG(INFO) << __func__ << " " << success;
110 if (success) {
111 wifi_->ScanDone();
112 }
113}
114
115} // namespace shill