shill: Generate more ModemManager interface bindings.
No functional changes. Refactors the Makefile to add sysroot XML bindings
through a one line change per interface. Refactors Cellular::Start to outline
the separate tasks more clearly.
BUG=chromium-os:18315
TEST=unit tests
Change-Id: I39359ecfc4b8c0290bf67a6f93732f4be4fbbd59
Reviewed-on: http://gerrit.chromium.org/gerrit/5008
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
diff --git a/cellular.cc b/cellular.cc
index 07276aa..7a72eb0 100644
--- a/cellular.cc
+++ b/cellular.cc
@@ -163,22 +163,16 @@
}
void Cellular::Start() {
- VLOG(2) << __func__ << ": " << GetStateString();
- CHECK_EQ(kStateDisabled, state_);
proxy_.reset(
ProxyFactory::factory()->CreateModemProxy(dbus_path_, dbus_owner_));
- // TODO(petkov): Switch to asynchronous calls (crosbug.com/17583).
- proxy_->Enable(true);
- state_ = kStateEnabled;
-
simple_proxy_.reset(
- ProxyFactory::factory()->CreateModemSimpleProxy(dbus_path_, dbus_owner_));
- // TODO(petkov): Switch to asynchronous calls (crosbug.com/17583).
- DBusPropertiesMap properties = simple_proxy_->GetStatus();
- for (DBusPropertiesMap::const_iterator it = properties.begin();
- it != properties.end(); ++it) {
- VLOG(2) << "ModemManager.Modem.Simple: " << it->first;
- }
+ ProxyFactory::factory()->CreateModemSimpleProxy(
+ dbus_path_, dbus_owner_));
+
+ VLOG(2) << __func__ << ": " << GetStateString();
+ EnableModem();
+ // TODO(petkov): If GSM, invoke ModemManager.Modem.Gsm.Network.Register.
+ GetModemStatus();
// TODO(petkov): Device::Start();
}
@@ -190,6 +184,22 @@
// TODO(petkov): Device::Stop();
}
+void Cellular::EnableModem() {
+ CHECK_EQ(kStateDisabled, state_);
+ // TODO(petkov): Switch to asynchronous calls (crosbug.com/17583).
+ proxy_->Enable(true);
+ state_ = kStateEnabled;
+}
+
+void Cellular::GetModemStatus() {
+ // TODO(petkov): Switch to asynchronous calls (crosbug.com/17583).
+ DBusPropertiesMap properties = simple_proxy_->GetStatus();
+ for (DBusPropertiesMap::const_iterator it = properties.begin();
+ it != properties.end(); ++it) {
+ VLOG(2) << "ModemManager.Modem.Simple: " << it->first;
+ }
+}
+
bool Cellular::TechnologyIs(const Device::Technology type) {
return type == Device::kCellular;
}