blob: 7c4fcd12fdb41fff160be2fc0550dbf900cb5d0c [file] [log] [blame]
Darin Petkovdaf43862011-10-27 11:37:28 +02001// Copyright (c) 2011 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
5#ifndef SHILL_CELLULAR_CAPABILITY_GSM_
6#define SHILL_CELLULAR_CAPABILITY_GSM_
7
Darin Petkovcb547732011-11-09 13:55:26 +01008#include <base/memory/scoped_ptr.h>
Darin Petkovb05315f2011-11-07 10:14:25 +01009#include <base/task.h>
10
Darin Petkovdaf43862011-10-27 11:37:28 +020011#include "shill/cellular_capability.h"
Darin Petkovcb547732011-11-09 13:55:26 +010012#include "shill/modem_gsm_card_proxy_interface.h"
Darin Petkovdaf43862011-10-27 11:37:28 +020013
14namespace shill {
15
Darin Petkovcb547732011-11-09 13:55:26 +010016class CellularCapabilityGSM : public CellularCapability,
17 public ModemGSMCardProxyDelegate {
Darin Petkovdaf43862011-10-27 11:37:28 +020018 public:
19 CellularCapabilityGSM(Cellular *cellular);
20
Darin Petkovb05315f2011-11-07 10:14:25 +010021 // Inherited from CellularCapability.
Darin Petkovdaf43862011-10-27 11:37:28 +020022 virtual void InitProxies();
Darin Petkovb05315f2011-11-07 10:14:25 +010023 virtual void RequirePIN(const std::string &pin, bool require, Error *error);
24 virtual void EnterPIN(const std::string &pin, Error *error);
25 virtual void UnblockPIN(const std::string &unblock_code,
26 const std::string &pin,
27 Error *error);
28 virtual void ChangePIN(const std::string &old_pin,
29 const std::string &new_pin,
30 Error *error);
Darin Petkov20c13ec2011-11-09 15:07:15 +010031 virtual std::string GetNetworkTechnologyString() const;
32 virtual std::string GetRoamingStateString() const;
Darin Petkovdaf43862011-10-27 11:37:28 +020033
Darin Petkovcb547732011-11-09 13:55:26 +010034 // Obtains the IMEI, IMSI, SPN and MSISDN.
35 virtual void GetIdentifiers();
36
Darin Petkovdaf43862011-10-27 11:37:28 +020037 private:
Darin Petkovcb547732011-11-09 13:55:26 +010038 friend class CellularCapabilityGSMTest;
39
Darin Petkovb05315f2011-11-07 10:14:25 +010040 void RequirePINTask(const std::string &pin, bool require);
41 void EnterPINTask(const std::string &pin);
42 void UnblockPINTask(const std::string &unblock_code, const std::string &pin);
43 void ChangePINTask(const std::string &old_pin, const std::string &new_pin);
44
Darin Petkovcb547732011-11-09 13:55:26 +010045 scoped_ptr<ModemGSMCardProxyInterface> card_proxy_;
46
Darin Petkovb05315f2011-11-07 10:14:25 +010047 ScopedRunnableMethodFactory<CellularCapabilityGSM> task_factory_;
48
Darin Petkovdaf43862011-10-27 11:37:28 +020049 DISALLOW_COPY_AND_ASSIGN(CellularCapabilityGSM);
50};
51
52} // namespace shill
53
54#endif // SHILL_CELLULAR_CAPABILITY_GSM_