blob: cff5d5e3c82e97a5ad1702d45ba01ef5691a98a0 [file] [log] [blame]
Eric Shienbrood5de44ab2011-12-05 10:46:27 -05001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkov975b5e72011-08-30 11:48:08 -07002// 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_MODEM_GSM_CARD_PROXY_INTERFACE_
6#define SHILL_MODEM_GSM_CARD_PROXY_INTERFACE_
7
8#include <string>
9
10namespace shill {
11
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050012class AsyncCallHandler;
13class Error;
14
Darin Petkov975b5e72011-08-30 11:48:08 -070015// These are the methods that a ModemManager.Modem.Gsm.Card proxy must
16// support. The interface is provided so that it can be mocked in tests.
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050017// All calls are made asynchronously. Call completion is signalled through
18// the corresponding 'OnXXXCallback' method in the ProxyDelegate interface.
Darin Petkov975b5e72011-08-30 11:48:08 -070019class ModemGSMCardProxyInterface {
20 public:
21 virtual ~ModemGSMCardProxyInterface() {}
22
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050023 virtual void GetIMEI(AsyncCallHandler *call_handler, int timeout) = 0;
24 virtual void GetIMSI(AsyncCallHandler *call_handler, int timeout) = 0;
25 virtual void GetSPN(AsyncCallHandler *call_handler, int timeout) = 0;
26 virtual void GetMSISDN(AsyncCallHandler *call_handler, int timeout) = 0;
Darin Petkove42e1012011-08-31 12:35:04 -070027
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050028 virtual void EnablePIN(const std::string &pin, bool enabled,
29 AsyncCallHandler *call_handler, int timeout) = 0;
30 virtual void SendPIN(const std::string &pin,
31 AsyncCallHandler *call_handler, int timeout) = 0;
32 virtual void SendPUK(const std::string &puk, const std::string &pin,
33 AsyncCallHandler *call_handler, int timeout) = 0;
Darin Petkove42e1012011-08-31 12:35:04 -070034 virtual void ChangePIN(const std::string &old_pin,
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050035 const std::string &new_pin,
36 AsyncCallHandler *call_handler, int timeout) = 0;
Darin Petkov975b5e72011-08-30 11:48:08 -070037};
38
Darin Petkov580c7af2011-10-24 12:32:50 +020039// ModemManager.Modem.Gsm.Card callback delegate to be associated with the
Darin Petkov975b5e72011-08-30 11:48:08 -070040// proxy.
Darin Petkov580c7af2011-10-24 12:32:50 +020041class ModemGSMCardProxyDelegate {
Darin Petkov975b5e72011-08-30 11:48:08 -070042 public:
Darin Petkov580c7af2011-10-24 12:32:50 +020043 virtual ~ModemGSMCardProxyDelegate() {}
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050044
45 virtual void OnGetIMEICallback(const std::string &imei,
46 const Error &e,
47 AsyncCallHandler *call_handler) = 0;
48 virtual void OnGetIMSICallback(const std::string &imsi,
49 const Error &e,
50 AsyncCallHandler *call_handler) = 0;
51 virtual void OnGetSPNCallback(const std::string &spn,
52 const Error &e,
53 AsyncCallHandler *call_handler) = 0;
54 virtual void OnGetMSISDNCallback(const std::string &misisdn,
55 const Error &e,
56 AsyncCallHandler *call_handler) = 0;
57 // Callback used for all four PIN operations: EnablePIN, SendPIN,
58 // SendPUK, and ChangePIN.
59 virtual void OnPINOperationCallback(const Error &e,
60 AsyncCallHandler *call_handler) = 0;
Darin Petkov975b5e72011-08-30 11:48:08 -070061};
62
63} // namespace shill
64
65#endif // SHILL_MODEM_GSM_CARD_PROXY_INTERFACE_