blob: a047c02ef7ab4728c31cb5781027e87fae9f0719 [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 Petkov63138a92012-02-06 14:09:15 +010037
38 // Properties.
39 virtual uint32 EnabledFacilityLocks() = 0;
Darin Petkov975b5e72011-08-30 11:48:08 -070040};
41
Darin Petkov580c7af2011-10-24 12:32:50 +020042// ModemManager.Modem.Gsm.Card callback delegate to be associated with the
Darin Petkov975b5e72011-08-30 11:48:08 -070043// proxy.
Darin Petkov580c7af2011-10-24 12:32:50 +020044class ModemGSMCardProxyDelegate {
Darin Petkov975b5e72011-08-30 11:48:08 -070045 public:
Darin Petkov580c7af2011-10-24 12:32:50 +020046 virtual ~ModemGSMCardProxyDelegate() {}
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050047
48 virtual void OnGetIMEICallback(const std::string &imei,
49 const Error &e,
50 AsyncCallHandler *call_handler) = 0;
51 virtual void OnGetIMSICallback(const std::string &imsi,
52 const Error &e,
53 AsyncCallHandler *call_handler) = 0;
54 virtual void OnGetSPNCallback(const std::string &spn,
55 const Error &e,
56 AsyncCallHandler *call_handler) = 0;
57 virtual void OnGetMSISDNCallback(const std::string &misisdn,
58 const Error &e,
59 AsyncCallHandler *call_handler) = 0;
60 // Callback used for all four PIN operations: EnablePIN, SendPIN,
61 // SendPUK, and ChangePIN.
62 virtual void OnPINOperationCallback(const Error &e,
63 AsyncCallHandler *call_handler) = 0;
Darin Petkov975b5e72011-08-30 11:48:08 -070064};
65
66} // namespace shill
67
68#endif // SHILL_MODEM_GSM_CARD_PROXY_INTERFACE_