mukesh agrawal | af57195 | 2011-07-14 14:31:12 -0700 | [diff] [blame^] | 1 | // 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 | |
| 15 | using std::map; |
| 16 | using std::string; |
| 17 | |
| 18 | namespace shill { |
| 19 | |
| 20 | SupplicantInterfaceProxy::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 | |
| 27 | SupplicantInterfaceProxy::~SupplicantInterfaceProxy() {} |
| 28 | |
| 29 | ::DBus::Path SupplicantInterfaceProxy::AddNetwork( |
| 30 | const std::map<std::string, ::DBus::Variant> &args) { |
| 31 | return proxy_.AddNetwork(args); |
| 32 | } |
| 33 | |
| 34 | void SupplicantInterfaceProxy::FlushBSS(const uint32_t &age) { |
| 35 | return proxy_.FlushBSS(age); |
| 36 | } |
| 37 | |
| 38 | void SupplicantInterfaceProxy::RemoveAllNetworks() { |
| 39 | return proxy_.RemoveAllNetworks(); |
| 40 | } |
| 41 | |
| 42 | void SupplicantInterfaceProxy::Scan( |
| 43 | const std::map<std::string, ::DBus::Variant> &args) { |
| 44 | return proxy_.Scan(args); |
| 45 | } |
| 46 | |
| 47 | void SupplicantInterfaceProxy::SelectNetwork(const ::DBus::Path &network) { |
| 48 | return proxy_.SelectNetwork(network); |
| 49 | } |
| 50 | |
| 51 | // definitions for private class SupplicantInterfaceProxy::Proxy |
| 52 | |
| 53 | SupplicantInterfaceProxy::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 | |
| 59 | SupplicantInterfaceProxy::Proxy::~Proxy() {} |
| 60 | |
| 61 | void SupplicantInterfaceProxy::Proxy::BlobAdded(const string &blobname) { |
| 62 | LOG(INFO) << __func__; |
| 63 | // XXX |
| 64 | } |
| 65 | |
| 66 | void SupplicantInterfaceProxy::Proxy::BlobRemoved(const string &blobname) { |
| 67 | LOG(INFO) << __func__; |
| 68 | // XXX |
| 69 | } |
| 70 | |
| 71 | void 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 | |
| 78 | void SupplicantInterfaceProxy::Proxy::BSSRemoved(const ::DBus::Path &BSS) { |
| 79 | LOG(INFO) << __func__; |
| 80 | // XXX |
| 81 | } |
| 82 | |
| 83 | void SupplicantInterfaceProxy::Proxy::NetworkAdded( |
| 84 | const ::DBus::Path &network, |
| 85 | const std::map<string, ::DBus::Variant> &properties) { |
| 86 | LOG(INFO) << __func__; |
| 87 | // XXX |
| 88 | } |
| 89 | |
| 90 | void SupplicantInterfaceProxy::Proxy::NetworkRemoved( |
| 91 | const ::DBus::Path &network) { |
| 92 | LOG(INFO) << __func__; |
| 93 | // XXX |
| 94 | } |
| 95 | |
| 96 | void SupplicantInterfaceProxy::Proxy::NetworkSelected( |
| 97 | const ::DBus::Path &network) { |
| 98 | LOG(INFO) << __func__; |
| 99 | // XXX |
| 100 | } |
| 101 | |
| 102 | void SupplicantInterfaceProxy::Proxy::PropertiesChanged( |
| 103 | const std::map<string, ::DBus::Variant> &properties) { |
| 104 | LOG(INFO) << __func__; |
| 105 | // XXX |
| 106 | } |
| 107 | |
| 108 | void SupplicantInterfaceProxy::Proxy::ScanDone(const bool& success) { |
| 109 | LOG(INFO) << __func__ << " " << success; |
| 110 | if (success) { |
| 111 | wifi_->ScanDone(); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | } // namespace shill |