blob: f4c341048940ca643efd198502b9f33a9f60ce5b [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>
Liam McLoughlin0fec81c2013-02-28 10:31:47 -050013#include <base/gtest_prod_util.h> // for FRIEND_TEST_ALL_PREFIXES
Darin Petkove9d12e02011-07-27 15:09:37 -070014#include <gtest/gtest_prod.h> // for FRIEND_TEST
Chris Masone3bd3c8c2011-06-13 08:20:26 -070015
Darin Petkovc5f56562011-08-06 16:40:05 -070016#include "shill/dbus_properties.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070017#include "shill/device.h"
Paul Stewart26b327e2011-10-19 11:38:09 -070018#include "shill/event_dispatcher.h"
Thieu Le26fc01b2013-01-28 12:08:48 -080019#include "shill/metrics.h"
Prathmesh Prabhu27526f12013-03-25 19:42:18 -070020#include "shill/modem_info.h"
Darin Petkovc5f56562011-08-06 16:40:05 -070021#include "shill/modem_proxy_interface.h"
Chris Masone2b105542011-06-22 10:58:09 -070022#include "shill/refptr_types.h"
Chris Masone3bd3c8c2011-06-13 08:20:26 -070023
Darin Petkov137884a2011-10-26 18:52:47 +020024struct mobile_provider_db;
25
Chris Masone3bd3c8c2011-06-13 08:20:26 -070026namespace shill {
27
Darin Petkovdaf43862011-10-27 11:37:28 +020028class CellularCapability;
Darin Petkov4d6d9412011-08-24 13:19:54 -070029class Error;
Darin Petkovab565bb2011-10-06 02:55:51 -070030class ProxyFactory;
Darin Petkove9d12e02011-07-27 15:09:37 -070031
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050032class Cellular : public Device {
Chris Masone3bd3c8c2011-06-13 08:20:26 -070033 public:
Darin Petkove9d12e02011-07-27 15:09:37 -070034 enum Type {
35 kTypeGSM,
David Rochbergfa1d31d2012-03-20 10:38:07 -040036 kTypeCDMA,
37 kTypeUniversal, // ModemManager1
38 kTypeInvalid,
Darin Petkove9d12e02011-07-27 15:09:37 -070039 };
40
Darin Petkov0828f5f2011-08-11 10:18:52 -070041 // The device states progress linearly from Disabled to Linked.
Darin Petkove9d12e02011-07-27 15:09:37 -070042 enum State {
Darin Petkov0828f5f2011-08-11 10:18:52 -070043 // This is the initial state of the modem and indicates that the modem radio
44 // is not turned on.
Darin Petkove9d12e02011-07-27 15:09:37 -070045 kStateDisabled,
Darin Petkov0828f5f2011-08-11 10:18:52 -070046 // This state indicates that the modem radio is turned on, and it should be
47 // possible to measure signal strength.
Darin Petkove9d12e02011-07-27 15:09:37 -070048 kStateEnabled,
Darin Petkov0828f5f2011-08-11 10:18:52 -070049 // The modem has registered with a network and has signal quality
Darin Petkov51489002011-08-18 13:13:20 -070050 // measurements. A cellular service object is created.
Darin Petkove9d12e02011-07-27 15:09:37 -070051 kStateRegistered,
Darin Petkov0828f5f2011-08-11 10:18:52 -070052 // The modem has connected to a network.
Darin Petkove9d12e02011-07-27 15:09:37 -070053 kStateConnected,
Darin Petkov0828f5f2011-08-11 10:18:52 -070054 // The network interface is UP.
55 kStateLinked,
Darin Petkove9d12e02011-07-27 15:09:37 -070056 };
57
Darin Petkovbac96002011-08-09 13:22:00 -070058 enum ModemState {
59 kModemStateUnknown = 0,
Eric Shienbrood7fce52c2012-04-13 19:11:02 -040060 kModemStateInitializing = 1,
61 kModemStateLocked = 2,
62 kModemStateDisabled = 3,
David Rochbergfa1d31d2012-03-20 10:38:07 -040063 kModemStateDisabling = 4,
64 kModemStateEnabling = 5,
65 kModemStateEnabled = 6,
66 kModemStateSearching = 7,
67 kModemStateRegistered = 8,
68 kModemStateDisconnecting = 9,
69 kModemStateConnecting = 10,
70 kModemStateConnected = 11,
Darin Petkovbac96002011-08-09 13:22:00 -070071 };
72
Darin Petkov3335b372011-08-22 11:05:32 -070073 class Operator {
74 public:
75 Operator();
76 ~Operator();
77
78 void CopyFrom(const Operator &oper);
Darin Petkov9cb02682012-01-28 00:17:38 +010079 bool Equals(const Operator &oper) const { return dict_ == oper.dict_; }
Darin Petkov3335b372011-08-22 11:05:32 -070080
81 const std::string &GetName() const;
82 void SetName(const std::string &name);
83
84 const std::string &GetCode() const;
85 void SetCode(const std::string &code);
86
87 const std::string &GetCountry() const;
88 void SetCountry(const std::string &country);
89
90 const Stringmap &ToDict() const;
91
92 private:
93 Stringmap dict_;
94
95 DISALLOW_COPY_AND_ASSIGN(Operator);
96 };
97
Jason Glasgowa585fc32012-06-06 11:04:09 -040098 // |owner| is the ModemManager DBus service owner (e.g., ":1.17").
99 // |path| is the ModemManager.Modem DBus object path (e.g.,
Darin Petkove9d12e02011-07-27 15:09:37 -0700100 // "/org/chromium/ModemManager/Gobi/0").
Jason Glasgowa585fc32012-06-06 11:04:09 -0400101 // |service| is the modem mananager service name (e.g.,
102 // /org/freeDesktop/ModemManager, /org/freedesktop/ModemManager1
103 // or /org/chromium/ModemManager).
Prathmesh Prabhu27526f12013-03-25 19:42:18 -0700104 Cellular(ModemInfo *modem_info,
Darin Petkove9d12e02011-07-27 15:09:37 -0700105 const std::string &link_name,
Chris Masone626719f2011-08-18 16:58:48 -0700106 const std::string &address,
Darin Petkove9d12e02011-07-27 15:09:37 -0700107 int interface_index,
108 Type type,
109 const std::string &owner,
Jason Glasgowa585fc32012-06-06 11:04:09 -0400110 const std::string &service,
Darin Petkov137884a2011-10-26 18:52:47 +0200111 const std::string &path,
Ben Chan3ecdf822012-08-06 12:29:23 -0700112 ProxyFactory *proxy_factory);
Darin Petkove9d12e02011-07-27 15:09:37 -0700113 virtual ~Cellular();
114
Jason Glasgow7b461df2012-05-01 16:38:45 -0400115 // Load configuration for the device from |storage|.
116 virtual bool Load(StoreInterface *storage);
117
118 // Save configuration for the device to |storage|.
119 virtual bool Save(StoreInterface *storage);
120
Darin Petkov4d6d9412011-08-24 13:19:54 -0700121 // Asynchronously connects the modem to the network. Populates |error| on
122 // failure, leaves it unchanged otherwise.
Thieu Le398b1da2013-03-11 17:31:10 -0700123 virtual void Connect(Error *error);
Darin Petkovc5f56562011-08-06 16:40:05 -0700124
Christopher Wiley8a468902012-11-30 11:52:38 -0800125 // Asynchronously disconnects the modem from the network and populates
126 // |error| on failure, leaves it unchanged otherwise.
Christopher Wiley7d0953e2012-11-16 00:37:10 -0800127 virtual void Disconnect(Error *error);
Darin Petkovfb0625e2012-01-16 13:05:56 +0100128
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500129 // Asynchronously activates the modem. Returns an error on failure.
Eric Shienbrood9a245532012-03-07 14:20:39 -0500130 void Activate(const std::string &carrier, Error *error,
131 const ResultCallback &callback);
Darin Petkovc408e692011-08-17 13:47:15 -0700132
Arman Ugurayc7b15602013-02-16 00:56:18 -0800133 // Performs the necessary steps to bring the service to the activated state,
134 // once an online payment has been done.
135 void CompleteActivation(Error *error);
136
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
Darin Petkovdaf43862011-10-27 11:37:28 +0200156 const std::string &dbus_owner() const { return dbus_owner_; }
157 const std::string &dbus_path() const { return dbus_path_; }
158
Darin Petkovae0c64e2011-11-15 15:50:27 +0100159 const Operator &home_provider() const { return home_provider_; }
160 void set_home_provider(const Operator &oper);
Darin Petkov184c54e2011-11-15 12:44:39 +0100161
Darin Petkov3e509242011-11-10 14:46:44 +0100162 void HandleNewSignalQuality(uint32 strength);
163
Darin Petkov184c54e2011-11-15 12:44:39 +0100164 // Processes a change in the modem registration state, possibly creating,
165 // destroying or updating the CellularService.
166 void HandleNewRegistrationState();
167
Jason Glasgow82f9ab32012-04-04 14:27:19 -0400168 virtual void OnDBusPropertiesChanged(
169 const std::string &interface,
170 const DBusPropertiesMap &changed_properties,
171 const std::vector<std::string> &invalidated_properties);
Darin Petkov184c54e2011-11-15 12:44:39 +0100172
Darin Petkove9d12e02011-07-27 15:09:37 -0700173 // Inherited from Device.
Eric Shienbrood9a245532012-03-07 14:20:39 -0500174 virtual void Start(Error *error, const EnabledStateChangedCallback &callback);
175 virtual void Stop(Error *error, const EnabledStateChangedCallback &callback);
Darin Petkov0828f5f2011-08-11 10:18:52 -0700176 virtual void LinkEvent(unsigned int flags, unsigned int change);
Wade Guthrie68d41092013-04-02 12:56:02 -0700177 virtual void Scan(ScanType scan_type, Error *error);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500178 virtual void RegisterOnNetwork(const std::string &network_id,
Eric Shienbrood9a245532012-03-07 14:20:39 -0500179 Error *error,
180 const ResultCallback &callback);
181 virtual void RequirePIN(const std::string &pin, bool require,
182 Error *error, const ResultCallback &callback);
183 virtual void EnterPIN(const std::string &pin,
184 Error *error, const ResultCallback &callback);
Darin Petkove42e1012011-08-31 12:35:04 -0700185 virtual void UnblockPIN(const std::string &unblock_code,
186 const std::string &pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -0500187 Error *error, const ResultCallback &callback);
Darin Petkove42e1012011-08-31 12:35:04 -0700188 virtual void ChangePIN(const std::string &old_pin,
189 const std::string &new_pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -0500190 Error *error, const ResultCallback &callback);
Ben Chan5d0d32c2013-01-08 02:05:29 -0800191 virtual void Reset(Error *error, const ResultCallback &callback);
Darin Petkovc37a9c42012-09-06 15:28:22 +0200192 virtual void SetCarrier(const std::string &carrier,
193 Error *error, const ResultCallback &callback);
Arman Ugurayd42d8ec2013-04-08 19:28:21 -0700194 virtual void OnNoNetworkRouting();
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700195
Thieu Le37b90032012-05-15 15:18:41 -0700196 void StartModemCallback(const EnabledStateChangedCallback &callback,
197 const Error &error);
198 void StopModemCallback(const EnabledStateChangedCallback &callback,
199 const Error &error);
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400200 void OnConnecting();
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500201 void OnConnected();
Eric Shienbrood30bc0ec2012-03-21 18:19:46 -0400202 void OnConnectFailed(const Error &error);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500203 void OnDisconnected();
204 void OnDisconnectFailed();
Eric Shienbrood0db6a9b2012-03-30 16:11:39 -0400205 std::string GetTechnologyFamily(Error *error);
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400206 void OnModemStateChanged(ModemState old_state,
207 ModemState new_state,
208 uint32 reason);
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500209
Jason Glasgow7b461df2012-05-01 16:38:45 -0400210 // accessor to read the allow roaming property
211 bool allow_roaming_property() const { return allow_roaming_; }
Christopher Wiley1582bdd2012-11-15 11:31:14 -0800212 // Is the underlying device in the process of activating?
213 bool IsActivating() const;
Jason Glasgow7b461df2012-05-01 16:38:45 -0400214
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700215 private:
Darin Petkovab565bb2011-10-06 02:55:51 -0700216 friend class CellularTest;
Eric Shienbrood5de44ab2011-12-05 10:46:27 -0500217 friend class CellularCapabilityTest;
Darin Petkov20c13ec2011-11-09 15:07:15 +0100218 friend class CellularCapabilityCDMATest;
219 friend class CellularCapabilityGSMTest;
Jason Glasgowef965562012-04-10 16:12:35 -0400220 friend class CellularCapabilityUniversalTest;
Jason Glasgow82f9ab32012-04-04 14:27:19 -0400221 friend class CellularServiceTest;
Darin Petkov721ac932011-11-16 15:43:09 +0100222 friend class ModemTest;
Darin Petkovac635a82012-01-10 16:51:58 +0100223 FRIEND_TEST(CellularCapabilityCDMATest, CreateFriendlyServiceName);
Eric Shienbrood9a245532012-03-07 14:20:39 -0500224 FRIEND_TEST(CellularCapabilityCDMATest, GetRegistrationState);
Darin Petkovf508c822012-09-21 13:43:17 +0200225 FRIEND_TEST(CellularCapabilityGSMTest, AllowRoaming);
Darin Petkovac635a82012-01-10 16:51:58 +0100226 FRIEND_TEST(CellularCapabilityGSMTest, CreateFriendlyServiceName);
Darin Petkova4ca3c32012-08-17 16:05:24 +0200227 FRIEND_TEST(CellularCapabilityTest, AllowRoaming);
228 FRIEND_TEST(CellularCapabilityTest, EnableModemFail);
229 FRIEND_TEST(CellularCapabilityTest, EnableModemSucceed);
230 FRIEND_TEST(CellularCapabilityTest, FinishEnable);
231 FRIEND_TEST(CellularCapabilityTest, GetModemInfo);
232 FRIEND_TEST(CellularCapabilityTest, GetModemStatus);
Arman Uguray1361c032013-02-11 17:53:39 -0800233 FRIEND_TEST(CellularCapabilityUniversalMainTest, AllowRoaming);
234 FRIEND_TEST(CellularCapabilityUniversalMainTest, CreateFriendlyServiceName);
235 FRIEND_TEST(CellularCapabilityUniversalMainTest, Connect);
236 FRIEND_TEST(CellularCapabilityUniversalMainTest, IsServiceActivationRequired);
237 FRIEND_TEST(CellularCapabilityUniversalMainTest, SetHomeProvider);
Thieu Leb9c05e02013-03-04 14:09:32 -0800238 FRIEND_TEST(CellularCapabilityUniversalMainTest, StartModemAlreadyEnabled);
Arman Uguray1361c032013-02-11 17:53:39 -0800239 FRIEND_TEST(CellularCapabilityUniversalMainTest, StopModemConnected);
Arman Ugurayc7b15602013-02-16 00:56:18 -0800240 FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateIccidActivationState);
Arman Uguray1361c032013-02-11 17:53:39 -0800241 FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateOLP);
242 FRIEND_TEST(CellularCapabilityUniversalMainTest,
243 UpdateOperatorInfoViaOperatorId);
244 FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateScanningProperty);
Arman Ugurayefea6e02013-02-21 13:28:04 -0800245 FRIEND_TEST(CellularCapabilityUniversalMainTest,
246 UpdateServiceActivationState);
Arman Uguray1361c032013-02-11 17:53:39 -0800247 FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateServiceName);
248 FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateStorageIdentifier);
Darin Petkovac635a82012-01-10 16:51:58 +0100249 FRIEND_TEST(CellularServiceTest, FriendlyName);
Darin Petkov3335b372011-08-22 11:05:32 -0700250 FRIEND_TEST(CellularTest, CreateService);
Darin Petkovc5f56562011-08-06 16:40:05 -0700251 FRIEND_TEST(CellularTest, Connect);
Liam McLoughlin0fec81c2013-02-28 10:31:47 -0500252 FRIEND_TEST_ALL_PREFIXES(CellularTest, ConnectAddsTerminationAction);
Eric Shienbroodcc95c5d2012-03-30 15:25:49 -0400253 FRIEND_TEST(CellularTest, ConnectFailure);
Thieu Leb5954a22012-05-18 10:37:34 -0700254 FRIEND_TEST(CellularTest, ConnectFailureNoService);
Darin Petkovfb0625e2012-01-16 13:05:56 +0100255 FRIEND_TEST(CellularTest, DisableModem);
Eric Shienbrood9a245532012-03-07 14:20:39 -0500256 FRIEND_TEST(CellularTest, Disconnect);
Arman Uguray539c4232012-09-11 10:00:22 -0700257 FRIEND_TEST(CellularTest, DisconnectFailure);
Christopher Wiley7d0953e2012-11-16 00:37:10 -0800258 FRIEND_TEST(CellularTest, DisconnectWithCallback);
Arman Ugurayd42d8ec2013-04-08 19:28:21 -0700259 FRIEND_TEST(CellularTest, EnableTrafficMonitor);
Ben Chan09fa2a02012-11-07 22:09:09 -0800260 FRIEND_TEST(CellularTest,
261 HandleNewRegistrationStateForServiceRequiringActivation);
Arman Uguray32c76402012-11-27 14:01:13 -0800262 FRIEND_TEST(CellularTest, LinkEventWontDestroyService);
Eric Shienbrood7fce52c2012-04-13 19:11:02 -0400263 FRIEND_TEST(CellularTest, ModemStateChangeDisable);
264 FRIEND_TEST(CellularTest, ModemStateChangeEnable);
Thieu Led0012052012-07-25 16:09:09 -0700265 FRIEND_TEST(CellularTest, ModemStateChangeStaleConnected);
266 FRIEND_TEST(CellularTest, ModemStateChangeValidConnected);
Darin Petkove7c6ad32012-06-29 10:22:09 +0200267 FRIEND_TEST(CellularTest, SetAllowRoaming);
Thieu Le37b90032012-05-15 15:18:41 -0700268 FRIEND_TEST(CellularTest, StartModemCallback);
269 FRIEND_TEST(CellularTest, StartModemCallbackFail);
270 FRIEND_TEST(CellularTest, StopModemCallback);
271 FRIEND_TEST(CellularTest, StopModemCallbackFail);
Darin Petkovbac96002011-08-09 13:22:00 -0700272 FRIEND_TEST(CellularTest, StartConnected);
Darin Petkova1e0a1c2011-08-25 15:08:33 -0700273 FRIEND_TEST(CellularTest, StartCDMARegister);
Darin Petkov9bac6fe2011-08-26 12:49:05 -0700274 FRIEND_TEST(CellularTest, StartGSMRegister);
Darin Petkov0828f5f2011-08-11 10:18:52 -0700275 FRIEND_TEST(CellularTest, StartLinked);
Ben Chan876efd32012-09-28 15:25:13 -0700276 FRIEND_TEST(Modem1Test, CreateDeviceMM1);
Darin Petkove9d12e02011-07-27 15:09:37 -0700277
Jason Glasgow7b461df2012-05-01 16:38:45 -0400278 // Names of properties in storage
279 static const char kAllowRoaming[];
280
Darin Petkov0828f5f2011-08-11 10:18:52 -0700281 void SetState(State state);
282
Darin Petkovbac96002011-08-09 13:22:00 -0700283 // Invoked when the modem is connected to the cellular network to transition
284 // to the network-connected state and bring the network interface up.
285 void EstablishLink();
286
Ben Chan3ecdf822012-08-06 12:29:23 -0700287 void InitCapability(Type type);
Darin Petkovf5f61e02011-07-29 11:35:40 -0700288
Darin Petkovd9661952011-08-03 16:25:42 -0700289 void CreateService();
290
Eric Shienbrood0db6a9b2012-03-30 16:11:39 -0400291 // HelpRegisterDerived*: Expose a property over RPC, with the name |name|.
292 //
293 // Reads of the property will be handled by invoking |get|.
294 // Writes to the property will be handled by invoking |set|.
295 // Clearing the property will be handled by PropertyStore.
Jason Glasgow7b461df2012-05-01 16:38:45 -0400296 void HelpRegisterDerivedBool(
297 const std::string &name,
298 bool(Cellular::*get)(Error *error),
299 void(Cellular::*set)(const bool &value, Error *error));
Eric Shienbrood0db6a9b2012-03-30 16:11:39 -0400300 void HelpRegisterDerivedString(
301 const std::string &name,
302 std::string(Cellular::*get)(Error *error),
303 void(Cellular::*set)(const std::string &value, Error *error));
304
Nathan Williamsb54974f2012-04-19 11:16:30 -0400305 void OnConnectReply(const Error &error);
Christopher Wiley8a468902012-11-30 11:52:38 -0800306 void OnDisconnectReply(const Error &error);
Nathan Williamsb54974f2012-04-19 11:16:30 -0400307
Jason Glasgow7b461df2012-05-01 16:38:45 -0400308 // DBUS accessors to read/modify the allow roaming property
309 bool GetAllowRoaming(Error */*error*/) { return allow_roaming_; }
310 void SetAllowRoaming(const bool &value, Error *error);
311
Gary Moraina9fb3252012-05-31 12:05:31 -0700312 // When shill terminates or ChromeOS suspends, this function is called to
313 // disconnect from the cellular network.
314 void StartTermination();
315
Arman Uguray539c4232012-09-11 10:00:22 -0700316 // This function does the final cleanup once a disconnect request terminates.
317 // Returns true, if the device state is successfully changed.
318 bool DisconnectCleanup();
319
Thieu Le64b0fe52012-08-08 14:57:36 -0700320 base::WeakPtrFactory<Cellular> weak_ptr_factory_;
321
Darin Petkove9d12e02011-07-27 15:09:37 -0700322 State state_;
Darin Petkovbac96002011-08-09 13:22:00 -0700323 ModemState modem_state_;
Darin Petkove9d12e02011-07-27 15:09:37 -0700324
Darin Petkovdaf43862011-10-27 11:37:28 +0200325 scoped_ptr<CellularCapability> capability_;
326
Jason Glasgowa585fc32012-06-06 11:04:09 -0400327 const std::string dbus_owner_; // :x.y
328 const std::string dbus_service_; // org.*.ModemManager*
Darin Petkove9d12e02011-07-27 15:09:37 -0700329 const std::string dbus_path_; // ModemManager.Modem
Darin Petkovbec79a22011-08-01 14:47:17 -0700330
Prathmesh Prabhu27526f12013-03-25 19:42:18 -0700331 ModemInfo *modem_info_;
Ben Chan3ecdf822012-08-06 12:29:23 -0700332 ProxyFactory *proxy_factory_;
Darin Petkov137884a2011-10-26 18:52:47 +0200333
Darin Petkovd9661952011-08-03 16:25:42 -0700334 CellularServiceRefPtr service_;
Chris Masone853b81b2011-06-24 14:11:41 -0700335
Chris Masoneb925cc82011-06-22 15:39:57 -0700336 // Properties
Darin Petkov3335b372011-08-22 11:05:32 -0700337 Operator home_provider_;
Chris Masoneb925cc82011-06-22 15:39:57 -0700338
Jason Glasgow7b461df2012-05-01 16:38:45 -0400339 // User preference to allow or disallow roaming
340 bool allow_roaming_;
341
Thieu Le26fc01b2013-01-28 12:08:48 -0800342 // Flag indicating that a disconnect has been explicitly requested.
343 bool explicit_disconnect_;
344
Chris Masone3bd3c8c2011-06-13 08:20:26 -0700345 DISALLOW_COPY_AND_ASSIGN(Cellular);
346};
347
348} // namespace shill
349
Darin Petkova4ca3c32012-08-17 16:05:24 +0200350#endif // SHILL_CELLULAR_H_