shill: Update WiMAX DBus proxy interfaces and classes.
Adds WiMaxManager.Network proxy. Creates WiMaxService objects based on
the available WiMax networks thus adding initial support for multiple
active WiMAX services. Adds a "Scanning" property to the WiMax device,
similar to WiFi and Cellular.
BUG=chrome-os-partner:9782
TEST=Build and run unit tests.
CQ-DEPEND=I97ce1351436afb3aeac0d2a48a8f51e1501e7466
Change-Id: Ie3f919846114f63414788c5b970fa0dff2e2d06a
Reviewed-on: https://gerrit.chromium.org/gerrit/23008
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/wimax_provider.cc b/wimax_provider.cc
index 10ca5bb..a12c882 100644
--- a/wimax_provider.cc
+++ b/wimax_provider.cc
@@ -10,7 +10,6 @@
#include <base/string_util.h>
#include <chromeos/dbus/service_constants.h>
-#include "shill/dbus_properties_proxy_interface.h"
#include "shill/error.h"
#include "shill/manager.h"
#include "shill/proxy_factory.h"
@@ -27,12 +26,6 @@
namespace shill {
-namespace {
-// TODO(petkov): Add these to chromeos/dbus/service_constants.h.
-const char kWiMaxDevicePathPrefix[] = "/org/chromium/WiMaxManager/Device/";
-const char kWiMaxManagerDevicesProperty[] = "Devices";
-} // namespace
-
WiMaxProvider::WiMaxProvider(ControlInterface *control,
EventDispatcher *dispatcher,
Metrics *metrics,
@@ -52,25 +45,20 @@
if (manager_proxy_.get()) {
return;
}
- properties_proxy_.reset(
- proxy_factory_->CreateDBusPropertiesProxy(
- wimax_manager::kWiMaxManagerServicePath,
- wimax_manager::kWiMaxManagerServiceName));
- properties_proxy_->set_properties_changed_callback(
- Bind(&WiMaxProvider::OnPropertiesChanged, Unretained(this)));
manager_proxy_.reset(proxy_factory_->CreateWiMaxManagerProxy());
+ manager_proxy_->set_devices_changed_callback(
+ Bind(&WiMaxProvider::OnDevicesChanged, Unretained(this)));
Error error;
- UpdateDevices(manager_proxy_->Devices(&error));
+ OnDevicesChanged(manager_proxy_->Devices(&error));
}
void WiMaxProvider::Stop() {
SLOG(WiMax, 2) << __func__;
- properties_proxy_.reset();
manager_proxy_.reset();
DestroyDeadDevices(RpcIdentifiers());
}
-void WiMaxProvider::UpdateDevices(const RpcIdentifiers &devices) {
+void WiMaxProvider::OnDevicesChanged(const RpcIdentifiers &devices) {
SLOG(WiMax, 2) << __func__;
DestroyDeadDevices(devices);
for (RpcIdentifiers::const_iterator it = devices.begin();
@@ -82,18 +70,6 @@
}
}
-void WiMaxProvider::OnPropertiesChanged(
- const string &/*interface*/,
- const DBusPropertiesMap &changed_properties,
- const vector<string> &/*invalidated_properties*/) {
- SLOG(WiMax, 2) << __func__;
- RpcIdentifiers devices;
- if (DBusProperties::GetRpcIdentifiers(
- changed_properties, kWiMaxManagerDevicesProperty, &devices)) {
- UpdateDevices(devices);
- }
-}
-
void WiMaxProvider::OnDeviceInfoAvailable(const string &link_name) {
SLOG(WiMax, 2) << __func__ << "(" << link_name << ")";
map<string, string>::iterator find_it = pending_devices_.find(link_name);
@@ -165,8 +141,8 @@
}
string WiMaxProvider::GetLinkName(const RpcIdentifier &path) {
- if (StartsWithASCII(path, kWiMaxDevicePathPrefix, true)) {
- return path.substr(strlen(kWiMaxDevicePathPrefix));
+ if (StartsWithASCII(path, wimax_manager::kDeviceObjectPathPrefix, true)) {
+ return path.substr(strlen(wimax_manager::kDeviceObjectPathPrefix));
}
LOG(ERROR) << "Unable to determine link name from RPC path: " << path;
return string();