blob: 7cee6c4a3a441f6a849d77fca19357a998c6f1fd [file] [log] [blame]
Darin Petkovc64fe5e2012-01-11 12:46:13 +01001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masone3bd3c8c2011-06-13 08:20:26 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Darin Petkova4ca3c32012-08-17 16:05:24 +02005#ifndef SHILL_CELLULAR_H_
6#define SHILL_CELLULAR_H_
Chris Masone3bd3c8c2011-06-13 08:20:26 -07007
8#include <string>
Jason Glasgow82f9ab32012-04-04 14:27:19 -04009#include <vector>
Chris Masone3bd3c8c2011-06-13 08:20:26 -070010
11#include <base/basictypes.h>
Thieu Le64b0fe52012-08-08 14:57:36 -070012#include <base/memory/weak_ptr.h>
Darin Petkove9d12e02011-07-27 15:09:37 -070013#include <gtest/gtest_prod.h> // for FRIEND_TEST
Chris Masone3bd3c8c2011-06-13 08:20:26 -070014
Darin Petkovc5f56562011-08-06 16:40:05 -070015#include "shill/dbus_properties.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070016#include "shill/device.h"
Paul Stewart26b327e2011-10-19 11:38:09 -070017#include "shill/event_dispatcher.h"
Thieu Le26fc01b2013-01-28 12:08:48 -080018#include "shill/metrics.h"
Darin Petkovc5f56562011-08-06 16:40:05 -070019#include "shill/modem_proxy_interface.h"
Chris Masone2b105542011-06-22 10:58:09 -070020#include "shill/refptr_types.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070021
Darin Petkov137884a2011-10-26 18:52:47 +020022struct mobile_provider_db;
23
Chris Masone3bd3c8c2011-06-13 08:20:26 -070024namespace shill {
25
Darin Petkovdaf43862011-10-27 11:37:28 +020026class CellularCapability;
Ben Chan62028b22012-11-05 11:20:02 -080027class CellularOperatorInfo;
Darin Petkov4d6d9412011-08-24 13:19:54 -070028class Error;
Darin Petkovab565bb2011-10-06 02:55:51 -070029class ProxyFactory;
Darin Petkove9d12e02011-07-27 15:09:37 -070030
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050031class Cellular : public Device {
Chris Masone3bd3c8c2011-06-13 08:20:26 -070032 public:
Darin Petkove9d12e02011-07-27 15:09:37 -070033 enum Type {
34 kTypeGSM,
David Rochbergfa1d31d2012-03-20 10:38:07 -040035 kTypeCDMA,
36 kTypeUniversal, // ModemManager1
37 kTypeInvalid,
Darin Petkove9d12e02011-07-27 15:09:37 -070038 };
39
Darin Petkov0828f5f2011-08-11 10:18:52 -070040 // The device states progress linearly from Disabled to Linked.
Darin Petkove9d12e02011-07-27 15:09:37 -070041 enum State {
Darin Petkov0828f5f2011-08-11 10:18:52 -070042 // This is the initial state of the modem and indicates that the modem radio
43 // is not turned on.
Darin Petkove9d12e02011-07-27 15:09:37 -070044 kStateDisabled,
Darin Petkov0828f5f2011-08-11 10:18:52 -070045 // This state indicates that the modem radio is turned on, and it should be
46 // possible to measure signal strength.
Darin Petkove9d12e02011-07-27 15:09:37 -070047 kStateEnabled,
Darin Petkov0828f5f2011-08-11 10:18:52 -070048 // The modem has registered with a network and has signal quality
Darin Petkov51489002011-08-18 13:13:20 -070049 // measurements. A cellular service object is created.
Darin Petkove9d12e02011-07-27 15:09:37 -070050 kStateRegistered,
Darin Petkov0828f5f2011-08-11 10:18:52 -070051 // The modem has connected to a network.
Darin Petkove9d12e02011-07-27 15:09:37 -070052 kStateConnected,
Darin Petkov0828f5f2011-08-11 10:18:52 -070053 // The network interface is UP.
54 kStateLinked,
Darin Petkove9d12e02011-07-27 15:09:37 -070055 };
56
Darin Petkovbac96002011-08-09 13:22:00 -070057 enum ModemState {
58 kModemStateUnknown = 0,
Eric Shienbrood7fce52c2012-04-13 19:11:02 -040059 kModemStateInitializing = 1,
60 kModemStateLocked = 2,
61 kModemStateDisabled = 3,
David Rochbergfa1d31d2012-03-20 10:38:07 -040062 kModemStateDisabling = 4,
63 kModemStateEnabling = 5,
64 kModemStateEnabled = 6,
65 kModemStateSearching = 7,
66 kModemStateRegistered = 8,
67 kModemStateDisconnecting = 9,
68 kModemStateConnecting = 10,
69 kModemStateConnected = 11,
Darin Petkovbac96002011-08-09 13:22:00 -070070 };
71
Darin Petkov3335b372011-08-22 11:05:32 -070072 class Operator {
73 public:
74 Operator();
75 ~Operator();
76
77 void CopyFrom(const Operator &oper);
Darin Petkov9cb02682012-01-28 00:17:38 +010078 bool Equals(const Operator &oper) const { return dict_ == oper.dict_; }
Darin Petkov3335b372011-08-22 11:05:32 -070079
80 const std::string &GetName() const;
81 void SetName(const std::string &name);
82
83 const std::string &GetCode() const;
84 void SetCode(const std::string &code);
85
86 const std::string &GetCountry() const;
87 void SetCountry(const std::string &country);
88
89 const Stringmap &ToDict() const;
90
91 private:
92 Stringmap dict_;
93
94 DISALLOW_COPY_AND_ASSIGN(Operator);
95 };
96
Jason Glasgowa585fc32012-06-06 11:04:09 -040097 // |owner| is the ModemManager DBus service owner (e.g., ":1.17").
98 // |path| is the ModemManager.Modem DBus object path (e.g.,
Darin Petkove9d12e02011-07-27 15:09:37 -070099 // "/org/chromium/ModemManager/Gobi/0").
Jason Glasgowa585fc32012-06-06 11:04:09 -0400100 // |service| is the modem mananager service name (e.g.,
101 // /org/freeDesktop/ModemManager, /org/freedesktop/ModemManager1
102 // or /org/chromium/ModemManager).
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700103 Cellular(ControlInterface *control_interface,
104 EventDispatcher *dispatcher,
Thieu Le3426c8f2012-01-11 17:35:11 -0800105 Metrics *metrics,
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700106 Manager *manager,
Darin Petkove9d12e02011-07-27 15:09:37 -0700107 const std::string &link_name,
Chris Masone626719f2011-08-18 16:58:48 -0700108 const std::string &address,
Darin Petkove9d12e02011-07-27 15:09:37 -0700109 int interface_index,
110 Type type,
111 const std::string &owner,
Jason Glasgowa585fc32012-06-06 11:04:09 -0400112 const std::string &service,
Darin Petkov137884a2011-10-26 18:52:47 +0200113 const std::string &path,
Ben Chan62028b22012-11-05 11:20:02 -0800114 CellularOperatorInfo *cellular_operator_info,
Ben Chan3ecdf822012-08-06 12:29:23 -0700115 mobile_provider_db *provider_db,
116 ProxyFactory *proxy_factory);
Darin Petkove9d12e02011-07-27 15:09:37 -0700117 virtual ~Cellular();
118
Jason Glasgow7b461df2012-05-01 16:38:45 -0400119 // Load configuration for the device from |storage|.
120 virtual bool Load(StoreInterface *storage);
121
122 // Save configuration for the device to |storage|.
123 virtual bool Save(StoreInterface *storage);
124
Darin Petkov4d6d9412011-08-24 13:19:54 -0700125 // Asynchronously connects the modem to the network. Populates |error| on
126 // failure, leaves it unchanged otherwise.
127 void Connect(Error *error);
Darin Petkovc5f56562011-08-06 16:40:05 -0700128
Christopher Wiley8a468902012-11-30 11:52:38 -0800129 // Asynchronously disconnects the modem from the network and populates
130 // |error| on failure, leaves it unchanged otherwise.
Christopher Wiley7d0953e2012-11-16 00:37:10 -0800131 virtual void Disconnect(Error *error);
Darin Petkovfb0625e2012-01-16 13:05:56 +0100132
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500133 // Asynchronously activates the modem. Returns an error on failure.
Eric Shienbrood9a245532012-03-07 14:20:39 -0500134 void Activate(const std::string &carrier, Error *error,
135 const ResultCallback &callback);
Darin Petkovc408e692011-08-17 13:47:15 -0700136
Darin Petkov3e509242011-11-10 14:46:44 +0100137 const CellularServiceRefPtr &service() const { return service_; }
138
Darin Petkova0a0efe2012-06-27 12:50:01 +0200139 // Deregisters and destructs the current service and destroys the connection,
140 // if any. This also eliminates the circular references between this device
141 // and the associated service, allowing eventual device destruction.
142 virtual void DestroyService();
143
Darin Petkova3d3be52011-11-14 21:34:16 +0100144 static std::string GetStateString(State state);
145
Darin Petkovac635a82012-01-10 16:51:58 +0100146 std::string CreateFriendlyServiceName();
147
Darin Petkova3d3be52011-11-14 21:34:16 +0100148 State state() const { return state_; }
149
Darin Petkovbac96002011-08-09 13:22:00 -0700150 void set_modem_state(ModemState state) { modem_state_ = state; }
151 ModemState modem_state() const { return modem_state_; }
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400152 bool IsUnderlyingDeviceEnabled() const;
Thieu Led0012052012-07-25 16:09:09 -0700153 bool IsModemRegistered() const;
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400154 static bool IsEnabledModemState(ModemState state);
Darin Petkovbac96002011-08-09 13:22:00 -0700155
Ben Chan62028b22012-11-05 11:20:02 -0800156 CellularOperatorInfo *cellular_operator_info() const {
157 return cellular_operator_info_;
158 }
Darin Petkov1272a432011-11-10 15:53:37 +0100159 mobile_provider_db *provider_db() const { return provider_db_; }
160
Darin Petkovdaf43862011-10-27 11:37:28 +0200161 const std::string &dbus_owner() const { return dbus_owner_; }
162 const std::string &dbus_path() const { return dbus_path_; }
163
Darin Petkovae0c64e2011-11-15 15:50:27 +0100164 const Operator &home_provider() const { return home_provider_; }
165 void set_home_provider(const Operator &oper);
Darin Petkov184c54e2011-11-15 12:44:39 +0100166
Darin Petkov3e509242011-11-10 14:46:44 +0100167 void HandleNewSignalQuality(uint32 strength);
168
Darin Petkov184c54e2011-11-15 12:44:39 +0100169 // Processes a change in the modem registration state, possibly creating,
170 // destroying or updating the CellularService.
171 void HandleNewRegistrationState();
172
Jason Glasgow82f9ab32012-04-04 14:27:19 -0400173 virtual void OnDBusPropertiesChanged(
174 const std::string &interface,
175 const DBusPropertiesMap &changed_properties,
176 const std::vector<std::string> &invalidated_properties);
Darin Petkov184c54e2011-11-15 12:44:39 +0100177
Darin Petkove9d12e02011-07-27 15:09:37 -0700178 // Inherited from Device.
Eric Shienbrood9a245532012-03-07 14:20:39 -0500179 virtual void Start(Error *error, const EnabledStateChangedCallback &callback);
180 virtual void Stop(Error *error, const EnabledStateChangedCallback &callback);
Darin Petkov0828f5f2011-08-11 10:18:52 -0700181 virtual void LinkEvent(unsigned int flags, unsigned int change);
Darin Petkovc0865312011-09-16 15:31:20 -0700182 virtual void Scan(Error *error);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500183 virtual void RegisterOnNetwork(const std::string &network_id,
Eric Shienbrood9a245532012-03-07 14:20:39 -0500184 Error *error,
185 const ResultCallback &callback);
186 virtual void RequirePIN(const std::string &pin, bool require,
187 Error *error, const ResultCallback &callback);
188 virtual void EnterPIN(const std::string &pin,
189 Error *error, const ResultCallback &callback);
Darin Petkove42e1012011-08-31 12:35:04 -0700190 virtual void UnblockPIN(const std::string &unblock_code,
191 const std::string &pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -0500192 Error *error, const ResultCallback &callback);
Darin Petkove42e1012011-08-31 12:35:04 -0700193 virtual void ChangePIN(const std::string &old_pin,
194 const std::string &new_pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -0500195 Error *error, const ResultCallback &callback);
Ben Chan5d0d32c2013-01-08 02:05:29 -0800196 virtual void Reset(Error *error, const ResultCallback &callback);
Darin Petkovc37a9c42012-09-06 15:28:22 +0200197 virtual void SetCarrier(const std::string &carrier,
198 Error *error, const ResultCallback &callback);
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700199
Thieu Le37b90032012-05-15 15:18:41 -0700200 void StartModemCallback(const EnabledStateChangedCallback &callback,
201 const Error &error);
202 void StopModemCallback(const EnabledStateChangedCallback &callback,
203 const Error &error);
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400204 void OnConnecting();
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500205 void OnConnected();
Eric Shienbrood30bc0ec2012-03-21 18:19:46 -0400206 void OnConnectFailed(const Error &error);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500207 void OnDisconnected();
208 void OnDisconnectFailed();
Eric Shienbrood0db6a9b2012-03-30 16:11:39 -0400209 std::string GetTechnologyFamily(Error *error);
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400210 void OnModemStateChanged(ModemState old_state,
211 ModemState new_state,
212 uint32 reason);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500213
Jason Glasgow7b461df2012-05-01 16:38:45 -0400214 // accessor to read the allow roaming property
215 bool allow_roaming_property() const { return allow_roaming_; }
Christopher Wiley1582bdd2012-11-15 11:31:14 -0800216 // Is the underlying device in the process of activating?
217 bool IsActivating() const;
Jason Glasgow7b461df2012-05-01 16:38:45 -0400218
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700219 private:
Darin Petkovab565bb2011-10-06 02:55:51 -0700220 friend class CellularTest;
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500221 friend class CellularCapabilityTest;
Darin Petkov20c13ec2011-11-09 15:07:15 +0100222 friend class CellularCapabilityCDMATest;
223 friend class CellularCapabilityGSMTest;
Jason Glasgowef965562012-04-10 16:12:35 -0400224 friend class CellularCapabilityUniversalTest;
Jason Glasgow82f9ab32012-04-04 14:27:19 -0400225 friend class CellularServiceTest;
Darin Petkov721ac932011-11-16 15:43:09 +0100226 friend class ModemTest;
Darin Petkovac635a82012-01-10 16:51:58 +0100227 FRIEND_TEST(CellularCapabilityCDMATest, CreateFriendlyServiceName);
Eric Shienbrood9a245532012-03-07 14:20:39 -0500228 FRIEND_TEST(CellularCapabilityCDMATest, GetRegistrationState);
Darin Petkovf508c822012-09-21 13:43:17 +0200229 FRIEND_TEST(CellularCapabilityGSMTest, AllowRoaming);
Darin Petkovac635a82012-01-10 16:51:58 +0100230 FRIEND_TEST(CellularCapabilityGSMTest, CreateFriendlyServiceName);
Darin Petkova4ca3c32012-08-17 16:05:24 +0200231 FRIEND_TEST(CellularCapabilityTest, AllowRoaming);
232 FRIEND_TEST(CellularCapabilityTest, EnableModemFail);
233 FRIEND_TEST(CellularCapabilityTest, EnableModemSucceed);
234 FRIEND_TEST(CellularCapabilityTest, FinishEnable);
235 FRIEND_TEST(CellularCapabilityTest, GetModemInfo);
236 FRIEND_TEST(CellularCapabilityTest, GetModemStatus);
Darin Petkovf508c822012-09-21 13:43:17 +0200237 FRIEND_TEST(CellularCapabilityUniversalTest, AllowRoaming);
Darin Petkova4ca3c32012-08-17 16:05:24 +0200238 FRIEND_TEST(CellularCapabilityUniversalTest, CreateFriendlyServiceName);
239 FRIEND_TEST(CellularCapabilityUniversalTest, Connect);
Ben Chan15786032012-11-04 21:28:02 -0800240 FRIEND_TEST(CellularCapabilityUniversalTest, IsServiceActivationRequired);
Arman Ugurayd73783f2013-01-31 16:11:21 -0800241 FRIEND_TEST(CellularCapabilityUniversalTest, SetHomeProvider);
Darin Petkova4ca3c32012-08-17 16:05:24 +0200242 FRIEND_TEST(CellularCapabilityUniversalTest, StopModemConnected);
Ben Chan6d0d1e72012-11-06 21:19:28 -0800243 FRIEND_TEST(CellularCapabilityUniversalTest, UpdateOLP);
Ben Chan092b12b2012-11-07 22:04:05 -0800244 FRIEND_TEST(CellularCapabilityUniversalTest, UpdateOperatorInfoViaOperatorId);
Ben Chan8a2c01e2013-01-23 10:09:14 -0800245 FRIEND_TEST(CellularCapabilityUniversalTest, UpdateScanningProperty);
Arman Uguray2717a102013-01-29 23:36:06 -0800246 FRIEND_TEST(CellularCapabilityUniversalTest, UpdateServiceName);
Arman Ugurayc9533572013-01-22 17:34:20 -0800247 FRIEND_TEST(CellularCapabilityUniversalTest, UpdateStorageIdentifier);
Darin Petkovac635a82012-01-10 16:51:58 +0100248 FRIEND_TEST(CellularServiceTest, FriendlyName);
Darin Petkov3335b372011-08-22 11:05:32 -0700249 FRIEND_TEST(CellularTest, CreateService);
Darin Petkovc5f56562011-08-06 16:40:05 -0700250 FRIEND_TEST(CellularTest, Connect);
Gary Moraina9fb3252012-05-31 12:05:31 -0700251 FRIEND_TEST(CellularTest, ConnectAddsTerminationAction);
Eric Shienbroodcc95c5d2012-03-30 15:25:49 -0400252 FRIEND_TEST(CellularTest, ConnectFailure);
Thieu Leb5954a22012-05-18 10:37:34 -0700253 FRIEND_TEST(CellularTest, ConnectFailureNoService);
Darin Petkovfb0625e2012-01-16 13:05:56 +0100254 FRIEND_TEST(CellularTest, DisableModem);
Eric Shienbrood9a245532012-03-07 14:20:39 -0500255 FRIEND_TEST(CellularTest, Disconnect);
Arman Uguray539c4232012-09-11 10:00:22 -0700256 FRIEND_TEST(CellularTest, DisconnectFailure);
Christopher Wiley7d0953e2012-11-16 00:37:10 -0800257 FRIEND_TEST(CellularTest, DisconnectWithCallback);
Ben Chan09fa2a02012-11-07 22:09:09 -0800258 FRIEND_TEST(CellularTest,
259 HandleNewRegistrationStateForServiceRequiringActivation);
Arman Uguray32c76402012-11-27 14:01:13 -0800260 FRIEND_TEST(CellularTest, LinkEventWontDestroyService);
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400261 FRIEND_TEST(CellularTest, ModemStateChangeDisable);
262 FRIEND_TEST(CellularTest, ModemStateChangeEnable);
Thieu Led0012052012-07-25 16:09:09 -0700263 FRIEND_TEST(CellularTest, ModemStateChangeStaleConnected);
264 FRIEND_TEST(CellularTest, ModemStateChangeValidConnected);
Darin Petkove7c6ad32012-06-29 10:22:09 +0200265 FRIEND_TEST(CellularTest, SetAllowRoaming);
Thieu Le37b90032012-05-15 15:18:41 -0700266 FRIEND_TEST(CellularTest, StartModemCallback);
267 FRIEND_TEST(CellularTest, StartModemCallbackFail);
268 FRIEND_TEST(CellularTest, StopModemCallback);
269 FRIEND_TEST(CellularTest, StopModemCallbackFail);
Darin Petkovbac96002011-08-09 13:22:00 -0700270 FRIEND_TEST(CellularTest, StartConnected);
Darin Petkova1e0a1c2011-08-25 15:08:33 -0700271 FRIEND_TEST(CellularTest, StartCDMARegister);
Darin Petkov9bac6fe2011-08-26 12:49:05 -0700272 FRIEND_TEST(CellularTest, StartGSMRegister);
Darin Petkov0828f5f2011-08-11 10:18:52 -0700273 FRIEND_TEST(CellularTest, StartLinked);
Ben Chan876efd32012-09-28 15:25:13 -0700274 FRIEND_TEST(Modem1Test, CreateDeviceMM1);
Darin Petkove9d12e02011-07-27 15:09:37 -0700275
Jason Glasgow7b461df2012-05-01 16:38:45 -0400276 // Names of properties in storage
277 static const char kAllowRoaming[];
278
Darin Petkov0828f5f2011-08-11 10:18:52 -0700279 void SetState(State state);
280
Darin Petkovbac96002011-08-09 13:22:00 -0700281 // Invoked when the modem is connected to the cellular network to transition
282 // to the network-connected state and bring the network interface up.
283 void EstablishLink();
284
Ben Chan3ecdf822012-08-06 12:29:23 -0700285 void InitCapability(Type type);
Darin Petkovf5f61e02011-07-29 11:35:40 -0700286
Darin Petkovd9661952011-08-03 16:25:42 -0700287 void CreateService();
288
Eric Shienbrood0db6a9b2012-03-30 16:11:39 -0400289 // HelpRegisterDerived*: Expose a property over RPC, with the name |name|.
290 //
291 // Reads of the property will be handled by invoking |get|.
292 // Writes to the property will be handled by invoking |set|.
293 // Clearing the property will be handled by PropertyStore.
Jason Glasgow7b461df2012-05-01 16:38:45 -0400294 void HelpRegisterDerivedBool(
295 const std::string &name,
296 bool(Cellular::*get)(Error *error),
297 void(Cellular::*set)(const bool &value, Error *error));
Eric Shienbrood0db6a9b2012-03-30 16:11:39 -0400298 void HelpRegisterDerivedString(
299 const std::string &name,
300 std::string(Cellular::*get)(Error *error),
301 void(Cellular::*set)(const std::string &value, Error *error));
302
Nathan Williamsb54974f2012-04-19 11:16:30 -0400303 void OnConnectReply(const Error &error);
Christopher Wiley8a468902012-11-30 11:52:38 -0800304 void OnDisconnectReply(const Error &error);
Nathan Williamsb54974f2012-04-19 11:16:30 -0400305
Jason Glasgow7b461df2012-05-01 16:38:45 -0400306 // DBUS accessors to read/modify the allow roaming property
307 bool GetAllowRoaming(Error */*error*/) { return allow_roaming_; }
308 void SetAllowRoaming(const bool &value, Error *error);
309
Gary Moraina9fb3252012-05-31 12:05:31 -0700310 // When shill terminates or ChromeOS suspends, this function is called to
311 // disconnect from the cellular network.
312 void StartTermination();
313
Arman Uguray539c4232012-09-11 10:00:22 -0700314 // This function does the final cleanup once a disconnect request terminates.
315 // Returns true, if the device state is successfully changed.
316 bool DisconnectCleanup();
317
Thieu Le64b0fe52012-08-08 14:57:36 -0700318 base::WeakPtrFactory<Cellular> weak_ptr_factory_;
319
Darin Petkove9d12e02011-07-27 15:09:37 -0700320 State state_;
Darin Petkovbac96002011-08-09 13:22:00 -0700321 ModemState modem_state_;
Darin Petkove9d12e02011-07-27 15:09:37 -0700322
Darin Petkovdaf43862011-10-27 11:37:28 +0200323 scoped_ptr<CellularCapability> capability_;
324
Jason Glasgowa585fc32012-06-06 11:04:09 -0400325 const std::string dbus_owner_; // :x.y
326 const std::string dbus_service_; // org.*.ModemManager*
Darin Petkove9d12e02011-07-27 15:09:37 -0700327 const std::string dbus_path_; // ModemManager.Modem
Darin Petkovbec79a22011-08-01 14:47:17 -0700328
Ben Chan62028b22012-11-05 11:20:02 -0800329 CellularOperatorInfo *cellular_operator_info_;
Darin Petkov137884a2011-10-26 18:52:47 +0200330 mobile_provider_db *provider_db_;
Ben Chan3ecdf822012-08-06 12:29:23 -0700331 ProxyFactory *proxy_factory_;
Darin Petkov137884a2011-10-26 18:52:47 +0200332
Darin Petkovd9661952011-08-03 16:25:42 -0700333 CellularServiceRefPtr service_;
Chris Masone853b81b2011-06-24 14:11:41 -0700334
Chris Masoneb925cc82011-06-22 15:39:57 -0700335 // Properties
Darin Petkov3335b372011-08-22 11:05:32 -0700336 Operator home_provider_;
Chris Masoneb925cc82011-06-22 15:39:57 -0700337
Jason Glasgow7b461df2012-05-01 16:38:45 -0400338 // User preference to allow or disallow roaming
339 bool allow_roaming_;
340
Thieu Le26fc01b2013-01-28 12:08:48 -0800341 // Flag indicating that a disconnect has been explicitly requested.
342 bool explicit_disconnect_;
343
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700344 DISALLOW_COPY_AND_ASSIGN(Cellular);
345};
346
347} // namespace shill
348
Darin Petkova4ca3c32012-08-17 16:05:24 +0200349#endif // SHILL_CELLULAR_H_