blob: e9e2a78250eabf6f28abe5aea1a980111cfd9ea1 [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,
22 const ::DBus::Path &object_path,
23 const char *dbus_addr)
24 : connection_(DBus::Connection::SystemBus()),
25 proxy_(wifi, &connection_, object_path, dbus_addr) {}
26
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
61void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &blobname) {
62 LOG(INFO) << __func__;
63 // XXX
64}
65
66void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &blobname) {
67 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
78void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) {
79 LOG(INFO) << __func__;
80 // XXX
81}
82
83void SupplicantInterfaceProxy::Proxy::NetworkAdded(
84 const ::DBus::Path &network,
85 const std::map<string, ::DBus::Variant> &properties) {
86 LOG(INFO) << __func__;
87 // XXX
88}
89
90void SupplicantInterfaceProxy::Proxy::NetworkRemoved(
91 const ::DBus::Path &network) {
92 LOG(INFO) << __func__;
93 // XXX
94}
95
96void SupplicantInterfaceProxy::Proxy::NetworkSelected(
97 const ::DBus::Path &network) {
98 LOG(INFO) << __func__;
99 // XXX
100}
101
102void SupplicantInterfaceProxy::Proxy::PropertiesChanged(
103 const std::map<string, ::DBus::Variant> &properties) {
104 LOG(INFO) << __func__;
105 // XXX
106}
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