blob: 550563d35e99e5f6d2a5af3ce04c041d2e4ab7f3 [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 Petkovdaf43862011-10-27 11:37:28 +020031
Darin Petkovcb547732011-11-09 13:55:26 +010032 // Obtains the IMEI, IMSI, SPN and MSISDN.
33 virtual void GetIdentifiers();
34
Darin Petkovdaf43862011-10-27 11:37:28 +020035 private:
Darin Petkovcb547732011-11-09 13:55:26 +010036 friend class CellularCapabilityGSMTest;
37
Darin Petkovb05315f2011-11-07 10:14:25 +010038 void RequirePINTask(const std::string &pin, bool require);
39 void EnterPINTask(const std::string &pin);
40 void UnblockPINTask(const std::string &unblock_code, const std::string &pin);
41 void ChangePINTask(const std::string &old_pin, const std::string &new_pin);
42
Darin Petkovcb547732011-11-09 13:55:26 +010043 scoped_ptr<ModemGSMCardProxyInterface> card_proxy_;
44
Darin Petkovb05315f2011-11-07 10:14:25 +010045 ScopedRunnableMethodFactory<CellularCapabilityGSM> task_factory_;
46
Darin Petkovdaf43862011-10-27 11:37:28 +020047 DISALLOW_COPY_AND_ASSIGN(CellularCapabilityGSM);
48};
49
50} // namespace shill
51
52#endif // SHILL_CELLULAR_CAPABILITY_GSM_