• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (C) 2012 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef SHILL_CELLULAR_MODEM_GSM_CARD_PROXY_INTERFACE_H_
18 #define SHILL_CELLULAR_MODEM_GSM_CARD_PROXY_INTERFACE_H_
19 
20 #include <string>
21 
22 #include "shill/callbacks.h"
23 
24 namespace shill {
25 
26 class Error;
27 typedef base::Callback<void(const std::string&,
28                             const Error&)> GSMIdentifierCallback;
29 
30 // These are the methods that a ModemManager.Modem.Gsm.Card proxy must
31 // support. The interface is provided so that it can be mocked in tests.
32 // All calls are made asynchronously.
33 class ModemGSMCardProxyInterface {
34  public:
~ModemGSMCardProxyInterface()35   virtual ~ModemGSMCardProxyInterface() {}
36 
37   virtual void GetIMEI(Error* error, const GSMIdentifierCallback& callback,
38                        int timeout) = 0;
39   virtual void GetIMSI(Error* error, const GSMIdentifierCallback& callback,
40                        int timeout) = 0;
41   virtual void GetSPN(Error* error, const GSMIdentifierCallback& callback,
42                       int timeout) = 0;
43   virtual void GetMSISDN(Error* error, const GSMIdentifierCallback& callback,
44                          int timeout) = 0;
45   virtual void EnablePIN(const std::string& pin, bool enabled,
46                          Error* error, const ResultCallback& callback,
47                          int timeout) = 0;
48   virtual void SendPIN(const std::string& pin,
49                        Error* error, const ResultCallback& callback,
50                        int timeout) = 0;
51   virtual void SendPUK(const std::string& puk, const std::string& pin,
52                        Error* error, const ResultCallback& callback,
53                        int timeout) = 0;
54   virtual void ChangePIN(const std::string& old_pin,
55                          const std::string& new_pin,
56                          Error* error, const ResultCallback& callback,
57                          int timeout) = 0;
58 
59   // Properties.
60   virtual uint32_t EnabledFacilityLocks() = 0;
61 };
62 
63 }  // namespace shill
64 
65 #endif  // SHILL_CELLULAR_MODEM_GSM_CARD_PROXY_INTERFACE_H_
66