diff options
author | Roshan Pius <rpius@google.com> | 2015-11-13 11:28:45 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2015-12-03 15:47:50 -0800 |
commit | 9cac82a4fda9ceee25e69b21686645daa4266afb (patch) | |
tree | a344aad8aca337cb33e3800e49428f427b7dba68 /test-rpc-proxy | |
parent | 78dfe30f944f6eb63e6b56b632e3c048fbcd2524 (diff) | |
download | shill-9cac82a4fda9ceee25e69b21686645daa4266afb.tar.gz |
shill-test-proxy: Implement dbus methods (Part 10)
Implementation of the following methods declared in the abstract
ProxyShillWifiClient interface:
1. RequestRoam
2. SetDeviceEnabled
Bug: 25516476
Change-Id: I36b3290ead835d05282b87009f7b60e1183c8885
TEST: mmm system/connectivity/shill
Diffstat (limited to 'test-rpc-proxy')
-rw-r--r-- | test-rpc-proxy/proxy_dbus_shill_wifi_client.cc | 31 | ||||
-rw-r--r-- | test-rpc-proxy/proxy_dbus_shill_wifi_client.h | 4 | ||||
-rw-r--r-- | test-rpc-proxy/proxy_shill_wifi_client.h | 4 |
3 files changed, 29 insertions, 10 deletions
diff --git a/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc b/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc index 7b3f6daf..76b815cd 100644 --- a/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc +++ b/test-rpc-proxy/proxy_dbus_shill_wifi_client.cc @@ -500,16 +500,35 @@ bool ProxyDbusShillWifiClient::SetPropertyOnDevice( } bool ProxyDbusShillWifiClient::RequestRoam( - std::string bssid, - std::string interface_name) { - - return true; + const std::string& interface_name, + const std::string& bssid) { + brillo::VariantDictionary device_params; + device_params.insert(std::make_pair( + shill::kNameProperty, brillo::Any(interface_name))); + std::unique_ptr<DeviceProxy> device = + dbus_client_->GetMatchingDeviceProxy(device_params); + if (!device) { + return false; + } + return device->RequestRoam(bssid, nullptr); } bool ProxyDbusShillWifiClient::SetDeviceEnabled( - std::string interface_name, + const std::string& interface_name, bool enable) { - return true; + brillo::VariantDictionary device_params; + device_params.insert(std::make_pair( + shill::kNameProperty, brillo::Any(interface_name))); + std::unique_ptr<DeviceProxy> device = + dbus_client_->GetMatchingDeviceProxy(device_params); + if (!device) { + return false; + } + if (enable) { + return device->Enable(nullptr); + } else { + return device->Disable(nullptr); + } } bool ProxyDbusShillWifiClient::DiscoverTDLSLink( diff --git a/test-rpc-proxy/proxy_dbus_shill_wifi_client.h b/test-rpc-proxy/proxy_dbus_shill_wifi_client.h index b90be9b8..5c9c5a8d 100644 --- a/test-rpc-proxy/proxy_dbus_shill_wifi_client.h +++ b/test-rpc-proxy/proxy_dbus_shill_wifi_client.h @@ -88,8 +88,8 @@ class ProxyDbusShillWifiClient : public ProxyShillWifiClient { bool SetPropertyOnDevice(const std::string& interface_name, const std::string& property_name, const brillo::Any& property_value) override; - bool RequestRoam(std::string bssid, std::string interface_name) override; - bool SetDeviceEnabled(std::string interface_name, bool enable) override; + bool RequestRoam(const std::string& interface_name, const std::string& bssid) override; + bool SetDeviceEnabled(const std::string& interface_name, bool enable) override; bool DiscoverTDLSLink(std::string interface_name, std::string peer_mac_address) override; bool EstablishTDLSLink(std::string interface_name, diff --git a/test-rpc-proxy/proxy_shill_wifi_client.h b/test-rpc-proxy/proxy_shill_wifi_client.h index 8e93f2e3..4e43f580 100644 --- a/test-rpc-proxy/proxy_shill_wifi_client.h +++ b/test-rpc-proxy/proxy_shill_wifi_client.h @@ -107,8 +107,8 @@ class ProxyShillWifiClient { virtual bool SetPropertyOnDevice(const std::string& interface_name, const std::string& property_name, const brillo::Any& property_value) = 0; - virtual bool RequestRoam(std::string bssid, std::string interface_name) = 0; - virtual bool SetDeviceEnabled(std::string interface_name, bool enable) = 0; + virtual bool RequestRoam(const std::string& interface_name, const std::string& bssid) = 0; + virtual bool SetDeviceEnabled(const std::string& interface_name, bool enable) = 0; virtual bool DiscoverTDLSLink(std::string interface_name, std::string peer_mac_address) = 0; virtual bool EstablishTDLSLink(std::string interface_name, |