Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Jason Glasgow | 1452187 | 2012-05-07 19:12:15 -0400 | [diff] [blame] | 5 | #ifndef SHILL_CELLULAR_CAPABILITY_UNIVERSAL_H_ |
| 6 | #define SHILL_CELLULAR_CAPABILITY_UNIVERSAL_H_ |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 7 | |
| 8 | #include <deque> |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 9 | #include <map> |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 10 | #include <string> |
| 11 | #include <vector> |
| 12 | |
| 13 | #include <base/memory/scoped_ptr.h> |
| 14 | #include <base/memory/weak_ptr.h> |
| 15 | #include <gtest/gtest_prod.h> // for FRIEND_TEST |
Ben Chan | 5c853ef | 2012-10-05 00:05:37 -0700 | [diff] [blame] | 16 | #include <ModemManager/ModemManager.h> |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 17 | |
| 18 | #include "shill/accessor_interface.h" |
| 19 | #include "shill/cellular.h" |
| 20 | #include "shill/cellular_capability.h" |
Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [diff] [blame] | 21 | #include "shill/mm1_bearer_proxy_interface.h" |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 22 | #include "shill/mm1_modem_modem3gpp_proxy_interface.h" |
| 23 | #include "shill/mm1_modem_modemcdma_proxy_interface.h" |
| 24 | #include "shill/mm1_modem_proxy_interface.h" |
| 25 | #include "shill/mm1_modem_simple_proxy_interface.h" |
| 26 | #include "shill/mm1_sim_proxy_interface.h" |
| 27 | |
| 28 | |
| 29 | struct mobile_provider; |
| 30 | |
| 31 | namespace shill { |
| 32 | |
| 33 | // CellularCapabilityUniversal handles modems using the |
| 34 | // org.chromium.ModemManager1 DBUS interface. This class is used for |
| 35 | // all types of modems, i.e. CDMA, GSM, and LTE modems. |
| 36 | class CellularCapabilityUniversal : public CellularCapability { |
| 37 | public: |
| 38 | typedef std::vector<DBusPropertiesMap> ScanResults; |
| 39 | typedef DBusPropertiesMap ScanResult; |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 40 | typedef std::map< uint32_t, uint32_t > LockRetryData; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 41 | |
Jason Glasgow | 1452187 | 2012-05-07 19:12:15 -0400 | [diff] [blame] | 42 | // Constants used in connect method call. Make available to test matchers. |
| 43 | // TODO(jglasgow): Generate from modem manager into |
| 44 | // ModemManager-names.h. |
| 45 | // See http://crosbug.com/30551. |
| 46 | static const char kConnectPin[]; |
| 47 | static const char kConnectOperatorId[]; |
| 48 | static const char kConnectBands[]; |
| 49 | static const char kConnectAllowedModes[]; |
| 50 | static const char kConnectPreferredMode[]; |
| 51 | static const char kConnectApn[]; |
| 52 | static const char kConnectIPType[]; |
| 53 | static const char kConnectUser[]; |
| 54 | static const char kConnectPassword[]; |
| 55 | static const char kConnectNumber[]; |
| 56 | static const char kConnectAllowRoaming[]; |
| 57 | static const char kConnectRMProtocol[]; |
| 58 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 59 | CellularCapabilityUniversal(Cellular *cellular, ProxyFactory *proxy_factory); |
| 60 | |
| 61 | // Inherited from CellularCapability. |
Gary Morain | e285a84 | 2012-08-15 08:23:57 -0700 | [diff] [blame] | 62 | // Checks the modem state. If the state is kModemStateDisabled, then the |
| 63 | // modem is enabled. Otherwise, the enable command is buffered until the |
| 64 | // modem becomes disabled. ModemManager rejects the enable command if the |
| 65 | // modem is not disabled, for exmaple, if it is initializing insted. |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 66 | virtual void StartModem(Error *error, const ResultCallback &callback); |
| 67 | virtual void StopModem(Error *error, const ResultCallback &callback); |
| 68 | virtual void Connect(const DBusPropertiesMap &properties, Error *error, |
| 69 | const ResultCallback &callback); |
| 70 | virtual void Disconnect(Error *error, const ResultCallback &callback); |
Christopher Wiley | 8a46890 | 2012-11-30 11:52:38 -0800 | [diff] [blame] | 71 | virtual void DisconnectCleanup(); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 72 | virtual void Activate(const std::string &carrier, |
| 73 | Error *error, const ResultCallback &callback); |
| 74 | |
| 75 | virtual void OnServiceCreated(); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 76 | virtual void SetupConnectProperties(DBusPropertiesMap *properties); |
Jason Glasgow | ef96556 | 2012-04-10 16:12:35 -0400 | [diff] [blame] | 77 | virtual void GetProperties(); |
Ben Chan | 1578603 | 2012-11-04 21:28:02 -0800 | [diff] [blame] | 78 | virtual bool IsServiceActivationRequired() const; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 79 | virtual void Register(const ResultCallback &callback); |
| 80 | |
| 81 | virtual void RegisterOnNetwork(const std::string &network_id, |
| 82 | Error *error, |
| 83 | const ResultCallback &callback); |
| 84 | virtual bool IsRegistered(); |
Eric Shienbrood | 7fce52c | 2012-04-13 19:11:02 -0400 | [diff] [blame] | 85 | virtual void SetUnregistered(bool searching); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 86 | virtual std::string CreateFriendlyServiceName(); |
| 87 | virtual void RequirePIN(const std::string &pin, bool require, |
| 88 | Error *error, const ResultCallback &callback); |
| 89 | virtual void EnterPIN(const std::string &pin, |
| 90 | Error *error, const ResultCallback &callback); |
| 91 | virtual void UnblockPIN(const std::string &unblock_code, |
| 92 | const std::string &pin, |
| 93 | Error *error, const ResultCallback &callback); |
| 94 | virtual void ChangePIN(const std::string &old_pin, |
| 95 | const std::string &new_pin, |
| 96 | Error *error, const ResultCallback &callback); |
Ben Chan | 5d0d32c | 2013-01-08 02:05:29 -0800 | [diff] [blame] | 97 | virtual void Reset(Error *error, const ResultCallback &callback); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 98 | |
| 99 | virtual void Scan(Error *error, const ResultCallback &callback); |
| 100 | virtual std::string GetNetworkTechnologyString() const; |
| 101 | virtual std::string GetRoamingStateString() const; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 102 | virtual void GetSignalQuality(); |
Jason Glasgow | 9f09aef | 2012-05-08 16:26:55 -0400 | [diff] [blame] | 103 | virtual std::string GetTypeString() const; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 104 | virtual void OnDBusPropertiesChanged( |
| 105 | const std::string &interface, |
| 106 | const DBusPropertiesMap &changed_properties, |
| 107 | const std::vector<std::string> &invalidated_properties); |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 108 | virtual bool AllowRoaming(); |
Jason Glasgow | 1452187 | 2012-05-07 19:12:15 -0400 | [diff] [blame] | 109 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 110 | protected: |
| 111 | virtual void InitProxies(); |
| 112 | virtual void ReleaseProxies(); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 113 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 114 | private: |
Jason Glasgow | cd0349c | 2012-05-03 23:32:15 -0400 | [diff] [blame] | 115 | // Constants used in scan results. Make available to unit tests. |
| 116 | // TODO(jglasgow): Generate from modem manager into ModemManager-names.h. |
| 117 | // See http://crosbug.com/30551. |
| 118 | static const char kStatusProperty[]; |
| 119 | static const char kOperatorLongProperty[]; |
| 120 | static const char kOperatorShortProperty[]; |
| 121 | static const char kOperatorCodeProperty[]; |
| 122 | static const char kOperatorAccessTechnologyProperty[]; |
| 123 | |
Jason Glasgow | 1452187 | 2012-05-07 19:12:15 -0400 | [diff] [blame] | 124 | // Modem Model ID strings. From modem firmware via modemmanager. |
| 125 | static const char kE362ModelId[]; |
| 126 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 127 | friend class CellularTest; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 128 | friend class CellularCapabilityTest; |
Thieu Le | 3d27539 | 2012-07-20 15:32:58 -0700 | [diff] [blame] | 129 | friend class CellularCapabilityUniversalTest; |
Darin Petkov | f508c82 | 2012-09-21 13:43:17 +0200 | [diff] [blame] | 130 | FRIEND_TEST(CellularCapabilityUniversalTest, AllowRoaming); |
Thieu Le | 3d27539 | 2012-07-20 15:32:58 -0700 | [diff] [blame] | 131 | FRIEND_TEST(CellularCapabilityUniversalTest, Connect); |
| 132 | FRIEND_TEST(CellularCapabilityUniversalTest, ConnectApns); |
Darin Petkov | a4ca3c3 | 2012-08-17 16:05:24 +0200 | [diff] [blame] | 133 | FRIEND_TEST(CellularCapabilityUniversalTest, CreateFriendlyServiceName); |
Thieu Le | 3d27539 | 2012-07-20 15:32:58 -0700 | [diff] [blame] | 134 | FRIEND_TEST(CellularCapabilityUniversalTest, DisconnectNoProxy); |
| 135 | FRIEND_TEST(CellularCapabilityUniversalTest, GetTypeString); |
Ben Chan | 1578603 | 2012-11-04 21:28:02 -0800 | [diff] [blame] | 136 | FRIEND_TEST(CellularCapabilityUniversalTest, IsServiceActivationRequired); |
Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [diff] [blame] | 137 | FRIEND_TEST(CellularCapabilityUniversalTest, OnListBearersReply); |
Thieu Le | 3d27539 | 2012-07-20 15:32:58 -0700 | [diff] [blame] | 138 | FRIEND_TEST(CellularCapabilityUniversalTest, PropertiesChanged); |
Ben Chan | 5d0d32c | 2013-01-08 02:05:29 -0800 | [diff] [blame] | 139 | FRIEND_TEST(CellularCapabilityUniversalTest, Reset); |
Thieu Le | 3d27539 | 2012-07-20 15:32:58 -0700 | [diff] [blame] | 140 | FRIEND_TEST(CellularCapabilityUniversalTest, Scan); |
| 141 | FRIEND_TEST(CellularCapabilityUniversalTest, ScanFailure); |
Darin Petkov | b4fccd2 | 2012-08-10 11:59:26 +0200 | [diff] [blame] | 142 | FRIEND_TEST(CellularCapabilityUniversalTest, SetHomeProvider); |
Arman Uguray | ab9364e | 2012-12-19 20:45:25 -0800 | [diff] [blame] | 143 | FRIEND_TEST(CellularCapabilityUniversalTest, SimLockStatusChanged); |
Ben Chan | bd3aee8 | 2012-10-16 23:52:04 -0700 | [diff] [blame] | 144 | FRIEND_TEST(CellularCapabilityUniversalTest, SimPathChanged); |
Thieu Le | 3d27539 | 2012-07-20 15:32:58 -0700 | [diff] [blame] | 145 | FRIEND_TEST(CellularCapabilityUniversalTest, SimPropertiesChanged); |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 146 | FRIEND_TEST(CellularCapabilityUniversalTest, StartModem); |
Jason Glasgow | 02401cc | 2012-05-16 10:35:37 -0400 | [diff] [blame] | 147 | FRIEND_TEST(CellularCapabilityUniversalTest, StopModem); |
| 148 | FRIEND_TEST(CellularCapabilityUniversalTest, StopModemConnected); |
Ben Chan | 6d0d1e7 | 2012-11-06 21:19:28 -0800 | [diff] [blame] | 149 | FRIEND_TEST(CellularCapabilityUniversalTest, UpdateOLP); |
Darin Petkov | a4ca3c3 | 2012-08-17 16:05:24 +0200 | [diff] [blame] | 150 | FRIEND_TEST(CellularCapabilityUniversalTest, UpdateOperatorInfo); |
Ben Chan | 092b12b | 2012-11-07 22:04:05 -0800 | [diff] [blame] | 151 | FRIEND_TEST(CellularCapabilityUniversalTest, UpdateOperatorInfoViaOperatorId); |
Ben Chan | 09fa2a0 | 2012-11-07 22:09:09 -0800 | [diff] [blame] | 152 | FRIEND_TEST(CellularTest, |
| 153 | HandleNewRegistrationStateForServiceRequiringActivation); |
Thieu Le | 5218cf2 | 2012-11-26 11:52:57 -0800 | [diff] [blame] | 154 | FRIEND_TEST(CellularTest, ModemStateChangeLostRegistration); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 155 | |
Jason Glasgow | ef96556 | 2012-04-10 16:12:35 -0400 | [diff] [blame] | 156 | // Methods used in starting a modem |
Gary Morain | e285a84 | 2012-08-15 08:23:57 -0700 | [diff] [blame] | 157 | void EnableModem(Error *error, const ResultCallback &callback); |
Jason Glasgow | ef96556 | 2012-04-10 16:12:35 -0400 | [diff] [blame] | 158 | void Start_EnableModemCompleted(const ResultCallback &callback, |
| 159 | const Error &error); |
Jason Glasgow | ef96556 | 2012-04-10 16:12:35 -0400 | [diff] [blame] | 160 | |
| 161 | // Methods used in stopping a modem |
| 162 | void Stop_DisconnectCompleted(const ResultCallback &callback, |
| 163 | const Error &error); |
| 164 | void Stop_Disable(const ResultCallback &callback); |
| 165 | void Stop_DisableCompleted(const ResultCallback &callback, |
| 166 | const Error &error); |
| 167 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 168 | // Sets the upper level information about the home cellular provider from the |
| 169 | // modem's IMSI and SPN. |
| 170 | void SetHomeProvider(); |
| 171 | |
Ben Chan | 6d0d1e7 | 2012-11-06 21:19:28 -0800 | [diff] [blame] | 172 | // Updates the online payment portal information, if any, for the cellular |
| 173 | // provider. |
| 174 | void UpdateOLP(); |
| 175 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 176 | // Updates the Universal operator name and country based on a newly |
| 177 | // obtained network id. |
| 178 | void UpdateOperatorInfo(); |
| 179 | |
| 180 | // Updates the serving operator on the active service. |
| 181 | void UpdateServingOperator(); |
| 182 | |
Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [diff] [blame] | 183 | // Updates |bearer_path_| to match the currently active bearer. |
| 184 | void UpdateBearerPath(); |
| 185 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 186 | // Initializes the |apn_list_| property based on the current |home_provider_|. |
| 187 | void InitAPNList(); |
| 188 | |
| 189 | Stringmap ParseScanResult(const ScanResult &result); |
| 190 | |
| 191 | KeyValueStore SimLockStatusToProperty(Error *error); |
| 192 | |
| 193 | void SetupApnTryList(); |
| 194 | void FillConnectPropertyMap(DBusPropertiesMap *properties); |
| 195 | |
| 196 | void HelpRegisterDerivedKeyValueStore( |
| 197 | const std::string &name, |
| 198 | KeyValueStore(CellularCapabilityUniversal::*get)(Error *error), |
| 199 | void(CellularCapabilityUniversal::*set)( |
| 200 | const KeyValueStore &value, Error *error)); |
| 201 | |
Jason Glasgow | 1452187 | 2012-05-07 19:12:15 -0400 | [diff] [blame] | 202 | // Returns true if a connect error should be retried. This function |
| 203 | // abstracts modem specific behavior for modems which do a lousy job |
| 204 | // of returning specific errors on connect failures. |
| 205 | bool RetriableConnectError(const Error &error) const; |
| 206 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 207 | // Signal callbacks |
Nathan Williams | 3022be5 | 2012-04-19 17:40:49 -0400 | [diff] [blame] | 208 | void OnNetworkModeSignal(uint32 mode); |
Eric Shienbrood | 7fce52c | 2012-04-13 19:11:02 -0400 | [diff] [blame] | 209 | void OnModemStateChangedSignal(int32 old_state, |
| 210 | int32 new_state, |
| 211 | uint32 reason); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 212 | |
| 213 | // Property Change notification handlers |
Nathan Williams | 3022be5 | 2012-04-19 17:40:49 -0400 | [diff] [blame] | 214 | void OnModemPropertiesChanged( |
Jason Glasgow | 4c0724a | 2012-04-17 15:47:40 -0400 | [diff] [blame] | 215 | const DBusPropertiesMap &properties, |
| 216 | const std::vector<std::string> &invalidated_properties); |
| 217 | |
Nathan Williams | 3022be5 | 2012-04-19 17:40:49 -0400 | [diff] [blame] | 218 | void OnSignalQualityChanged(uint32 quality); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 219 | |
Jason Glasgow | ef96556 | 2012-04-10 16:12:35 -0400 | [diff] [blame] | 220 | // Updates the sim_path_ variable and creates a new proxy to the |
| 221 | // DBUS ModemManager1.Sim interface |
Nathan Williams | 3022be5 | 2012-04-19 17:40:49 -0400 | [diff] [blame] | 222 | void OnSimPathChanged(const std::string &sim_path); |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 223 | void OnModemCapabilitesChanged(uint32 capabilities); |
| 224 | void OnModemCurrentCapabilitiesChanged(uint32 current_capabilities); |
| 225 | void OnMdnChanged(const std::string &mdn); |
| 226 | void OnModemManufacturerChanged(const std::string &manufacturer); |
| 227 | void OnModemModelChanged(const std::string &model); |
| 228 | void OnModemRevisionChanged(const std::string &revision); |
| 229 | void OnModemStateChanged(Cellular::ModemState state); |
| 230 | void OnAccessTechnologiesChanged(uint32 access_technologies); |
| 231 | void OnSupportedModesChanged(uint32 supported_modes); |
| 232 | void OnAllowedModesChanged(uint32 allowed_modes); |
| 233 | void OnPreferredModeChanged(MMModemMode preferred_mode); |
| 234 | void OnLockRetriesChanged(MMModemLock unlock_required, |
| 235 | const LockRetryData &lock_retries); |
| 236 | void OnSimLockStatusChanged(); |
| 237 | |
| 238 | // 3GPP property change handlers |
| 239 | virtual void OnModem3GPPPropertiesChanged( |
| 240 | const DBusPropertiesMap &properties, |
| 241 | const std::vector<std::string> &invalidated_properties); |
| 242 | void OnImeiChanged(const std::string &imei); |
| 243 | void On3GPPRegistrationChanged(MMModem3gppRegistrationState state, |
| 244 | const std::string &operator_code, |
| 245 | const std::string &operator_name); |
| 246 | void OnFacilityLocksChanged(uint32 locks); |
| 247 | |
| 248 | // SIM property change handlers |
| 249 | void OnSimPropertiesChanged( |
| 250 | const DBusPropertiesMap &props, |
| 251 | const std::vector<std::string> &invalidated_properties); |
| 252 | void OnImsiChanged(const std::string &imsi); |
| 253 | void OnSimIdentifierChanged(const std::string &id); |
| 254 | void OnOperatorIdChanged(const std::string &operator_id); |
| 255 | void OnOperatorNameChanged(const std::string &operator_name); |
Jason Glasgow | ef96556 | 2012-04-10 16:12:35 -0400 | [diff] [blame] | 256 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 257 | // Method callbacks |
Nathan Williams | 3022be5 | 2012-04-19 17:40:49 -0400 | [diff] [blame] | 258 | void OnRegisterReply(const ResultCallback &callback, |
| 259 | const Error &error); |
Ben Chan | 5d0d32c | 2013-01-08 02:05:29 -0800 | [diff] [blame] | 260 | void OnResetReply(const ResultCallback &callback, const Error &error); |
Nathan Williams | 3022be5 | 2012-04-19 17:40:49 -0400 | [diff] [blame] | 261 | void OnScanReply(const ResultCallback &callback, |
| 262 | const ScanResults &results, |
| 263 | const Error &error); |
Nathan Williams | b54974f | 2012-04-19 11:16:30 -0400 | [diff] [blame] | 264 | void OnConnectReply(const ResultCallback &callback, |
| 265 | const DBus::Path &bearer, |
| 266 | const Error &error); |
Arman Uguray | 6e5639f | 2012-11-15 20:30:19 -0800 | [diff] [blame] | 267 | void OnListBearersReply(const std::vector<DBus::Path> &paths, |
| 268 | const Error &error); |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 269 | |
| 270 | scoped_ptr<mm1::ModemModem3gppProxyInterface> modem_3gpp_proxy_; |
| 271 | scoped_ptr<mm1::ModemModemCdmaProxyInterface> modem_cdma_proxy_; |
| 272 | scoped_ptr<mm1::ModemProxyInterface> modem_proxy_; |
| 273 | scoped_ptr<mm1::ModemSimpleProxyInterface> modem_simple_proxy_; |
| 274 | scoped_ptr<mm1::SimProxyInterface> sim_proxy_; |
| 275 | |
| 276 | base::WeakPtrFactory<CellularCapabilityUniversal> weak_ptr_factory_; |
| 277 | |
| 278 | MMModem3gppRegistrationState registration_state_; |
| 279 | MMModemCdmaRegistrationState cdma_registration_state_; |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 280 | |
| 281 | // Bits based on MMModemCapabilities |
Jason Glasgow | 1452187 | 2012-05-07 19:12:15 -0400 | [diff] [blame] | 282 | uint32 capabilities_; // technologies supported, may require reload |
| 283 | uint32 current_capabilities_; // technologies supportsed without a reload |
| 284 | uint32 access_technologies_; // Bits based on MMModemAccessTechnology |
| 285 | uint32 supported_modes_; // Bits based on MMModemMode |
| 286 | uint32 allowed_modes_; // Bits based on MMModemMode |
| 287 | MMModemMode preferred_mode_; // A single MMModemMode bit |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 288 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 289 | Cellular::Operator serving_operator_; |
| 290 | std::string spn_; |
Jason Glasgow | af58328 | 2012-04-18 15:18:22 -0400 | [diff] [blame] | 291 | std::string sim_identifier_; |
| 292 | std::string operator_id_; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 293 | mobile_provider *home_provider_; |
Darin Petkov | f508c82 | 2012-09-21 13:43:17 +0200 | [diff] [blame] | 294 | bool provider_requires_roaming_; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 295 | std::string desired_network_; |
| 296 | |
| 297 | // Properties. |
| 298 | std::string carrier_; |
| 299 | std::string esn_; |
| 300 | std::string firmware_revision_; |
| 301 | std::string hardware_revision_; |
| 302 | std::string imei_; |
| 303 | std::string imsi_; |
| 304 | std::string manufacturer_; |
| 305 | std::string mdn_; |
| 306 | std::string meid_; |
| 307 | std::string min_; |
| 308 | std::string model_id_; |
| 309 | std::string selected_network_; |
| 310 | Stringmaps found_networks_; |
| 311 | std::deque<Stringmap> apn_try_list_; |
Ben Chan | 5d0d32c | 2013-01-08 02:05:29 -0800 | [diff] [blame] | 312 | bool resetting_; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 313 | bool scanning_supported_; |
| 314 | bool scanning_; |
| 315 | uint16 scan_interval_; |
| 316 | SimLockStatus sim_lock_status_; |
| 317 | Stringmaps apn_list_; |
Jason Glasgow | ef96556 | 2012-04-10 16:12:35 -0400 | [diff] [blame] | 318 | std::string sim_path_; |
Ben Chan | bd3aee8 | 2012-10-16 23:52:04 -0700 | [diff] [blame] | 319 | bool sim_present_; |
Nathan Williams | b54974f | 2012-04-19 11:16:30 -0400 | [diff] [blame] | 320 | DBus::Path bearer_path_; |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 321 | |
Gary Morain | e285a84 | 2012-08-15 08:23:57 -0700 | [diff] [blame] | 322 | // If the modem is not in a state to be enabled when StartModem is called, |
| 323 | // enabling is deferred using this callback. |
| 324 | base::Closure deferred_enable_modem_callback_; |
| 325 | |
Jason Glasgow | 82f9ab3 | 2012-04-04 14:27:19 -0400 | [diff] [blame] | 326 | static unsigned int friendly_service_name_id_; |
| 327 | |
| 328 | DISALLOW_COPY_AND_ASSIGN(CellularCapabilityUniversal); |
| 329 | }; |
| 330 | |
| 331 | } // namespace shill |
| 332 | |
Jason Glasgow | 1452187 | 2012-05-07 19:12:15 -0400 | [diff] [blame] | 333 | #endif // SHILL_CELLULAR_CAPABILITY_UNIVERSAL_H_ |