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_network_proxy.cc b/wimax_network_proxy.cc
index c0581be..7b2dede 100644
--- a/wimax_network_proxy.cc
+++ b/wimax_network_proxy.cc
@@ -20,10 +20,15 @@
WiMaxNetworkProxy::~WiMaxNetworkProxy() {}
-DBus::Path WiMaxNetworkProxy::proxy_object_path() const {
+RpcIdentifier WiMaxNetworkProxy::path() const {
return proxy_.path();
}
+void WiMaxNetworkProxy::set_signal_strength_changed_callback(
+ const SignalStrengthChangedCallback &callback) {
+ proxy_.set_signal_strength_changed_callback(callback);
+}
+
uint32 WiMaxNetworkProxy::Identifier(Error *error) {
SLOG(DBus, 2) << __func__;
try {
@@ -104,4 +109,17 @@
WiMaxNetworkProxy::Proxy::~Proxy() {}
+void WiMaxNetworkProxy::Proxy::set_signal_strength_changed_callback(
+ const SignalStrengthChangedCallback &callback) {
+ signal_strength_changed_callback_ = callback;
+}
+
+void WiMaxNetworkProxy::Proxy::SignalStrengthChanged(
+ const int32 &signal_strength) {
+ SLOG(DBus, 2) << __func__ << "(" << signal_strength << ")";
+ if (!signal_strength_changed_callback_.is_null()) {
+ signal_strength_changed_callback_.Run(signal_strength);
+ }
+}
+
} // namespace shill