Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 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_MODEM_GSM_CARD_PROXY_INTERFACE_ |
| 6 | #define SHILL_MODEM_GSM_CARD_PROXY_INTERFACE_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 10 | #include "shill/callbacks.h" |
| 11 | |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 12 | namespace shill { |
| 13 | |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 14 | class Error; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 15 | typedef base::Callback<void(const std::string &, |
| 16 | const Error &)> GSMIdentifierCallback; |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 17 | |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 18 | // These are the methods that a ModemManager.Modem.Gsm.Card proxy must |
| 19 | // support. The interface is provided so that it can be mocked in tests. |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 20 | // All calls are made asynchronously. |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 21 | class ModemGSMCardProxyInterface { |
| 22 | public: |
| 23 | virtual ~ModemGSMCardProxyInterface() {} |
| 24 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 25 | virtual void GetIMEI(Error *error, const GSMIdentifierCallback &callback, |
| 26 | int timeout) = 0; |
| 27 | virtual void GetIMSI(Error *error, const GSMIdentifierCallback &callback, |
| 28 | int timeout) = 0; |
| 29 | virtual void GetSPN(Error *error, const GSMIdentifierCallback &callback, |
| 30 | int timeout) = 0; |
| 31 | virtual void GetMSISDN(Error *error, const GSMIdentifierCallback &callback, |
| 32 | int timeout) = 0; |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 33 | virtual void EnablePIN(const std::string &pin, bool enabled, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 34 | Error *error, const ResultCallback &callback, |
| 35 | int timeout) = 0; |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 36 | virtual void SendPIN(const std::string &pin, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 37 | Error *error, const ResultCallback &callback, |
| 38 | int timeout) = 0; |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 39 | virtual void SendPUK(const std::string &puk, const std::string &pin, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 40 | Error *error, const ResultCallback &callback, |
| 41 | int timeout) = 0; |
Darin Petkov | e42e101 | 2011-08-31 12:35:04 -0700 | [diff] [blame] | 42 | virtual void ChangePIN(const std::string &old_pin, |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 43 | const std::string &new_pin, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 44 | Error *error, const ResultCallback &callback, |
| 45 | int timeout) = 0; |
Darin Petkov | 63138a9 | 2012-02-06 14:09:15 +0100 | [diff] [blame] | 46 | |
| 47 | // Properties. |
| 48 | virtual uint32 EnabledFacilityLocks() = 0; |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 51 | } // namespace shill |
| 52 | |
| 53 | #endif // SHILL_MODEM_GSM_CARD_PROXY_INTERFACE_ |