blob: 1285a3c28d3cdb83dc55731a38de81e8869dff35 [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
Eric Shienbrood9a245532012-03-07 14:20:39 -050010#include "shill/callbacks.h"
11
Darin Petkov975b5e72011-08-30 11:48:08 -070012namespace shill {
13
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050014class Error;
Eric Shienbrood9a245532012-03-07 14:20:39 -050015typedef base::Callback<void(const std::string &,
16 const Error &)> GSMIdentifierCallback;
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050017
Darin Petkov975b5e72011-08-30 11:48:08 -070018// 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 Shienbrood9a245532012-03-07 14:20:39 -050020// All calls are made asynchronously.
Darin Petkov975b5e72011-08-30 11:48:08 -070021class ModemGSMCardProxyInterface {
22 public:
23 virtual ~ModemGSMCardProxyInterface() {}
24
Eric Shienbrood9a245532012-03-07 14:20:39 -050025 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 Shienbrood5de44ab2011-12-05 10:46:27 -050033 virtual void EnablePIN(const std::string &pin, bool enabled,
Eric Shienbrood9a245532012-03-07 14:20:39 -050034 Error *error, const ResultCallback &callback,
35 int timeout) = 0;
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050036 virtual void SendPIN(const std::string &pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -050037 Error *error, const ResultCallback &callback,
38 int timeout) = 0;
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050039 virtual void SendPUK(const std::string &puk, const std::string &pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -050040 Error *error, const ResultCallback &callback,
41 int timeout) = 0;
Darin Petkove42e1012011-08-31 12:35:04 -070042 virtual void ChangePIN(const std::string &old_pin,
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050043 const std::string &new_pin,
Eric Shienbrood9a245532012-03-07 14:20:39 -050044 Error *error, const ResultCallback &callback,
45 int timeout) = 0;
Darin Petkov63138a92012-02-06 14:09:15 +010046
47 // Properties.
48 virtual uint32 EnabledFacilityLocks() = 0;
Darin Petkov975b5e72011-08-30 11:48:08 -070049};
50
Darin Petkov975b5e72011-08-30 11:48:08 -070051} // namespace shill
52
53#endif // SHILL_MODEM_GSM_CARD_PROXY_INTERFACE_