shill: wimax: Listen to SignalStrengthChanged and update the service strength.
Also, change some instances of DBus::Path to RpcIdentifier.
BUG=chrome-os-partner:9831,chrome-os-partner:9837
TEST=unit tests
CQ-DEPEND=If7c0543cc98bc39fba28e7465bcd6de974d8aa1f
Change-Id: I49fafd5569764d46f5814ac3d19783fe4409a675
Reviewed-on: https://gerrit.chromium.org/gerrit/23115
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/wimax_service.cc b/wimax_service.cc
index 588d5ab..3455a60 100644
--- a/wimax_service.cc
+++ b/wimax_service.cc
@@ -48,13 +48,14 @@
.append_string(eap().password.c_str());
}
-DBus::Path WiMaxService::GetNetworkObjectPath() const {
+RpcIdentifier WiMaxService::GetNetworkObjectPath() const {
CHECK(proxy_.get());
- return proxy_->proxy_object_path();
+ return proxy_->path();
}
bool WiMaxService::Start(WiMaxNetworkProxyInterface *proxy) {
SLOG(WiMax, 2) << __func__;
+ CHECK(proxy);
proxy_.reset(proxy);
Error error;
@@ -72,6 +73,8 @@
return false;
}
SetStrength(signal_strength);
+ proxy_->set_signal_strength_changed_callback(
+ Bind(&WiMaxService::OnSignalStrengthChanged, Unretained(this)));
set_friendly_name(network_name_);
storage_id_ =
@@ -108,4 +111,9 @@
return wimax_->GetRpcIdentifier();
}
+void WiMaxService::OnSignalStrengthChanged(int strength) {
+ SLOG(WiMax, 2) << __func__ << "(" << strength << ")";
+ SetStrength(strength);
+}
+
} // namespace shill