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_ |
| 6 | #define SHILL_MODEM_GSM_CARD_PROXY_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 10 | #include <base/basictypes.h> |
| 11 | |
| 12 | #include "shill/dbus_bindings/modem-gsm-card.h" |
| 13 | #include "shill/modem_gsm_card_proxy_interface.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class ModemGSMCardProxy : public ModemGSMCardProxyInterface { |
| 18 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 19 | // Constructs a ModemManager.Modem.Gsm.Card DBus |
| 20 | // object proxy at |path| owned by |service|. |
| 21 | ModemGSMCardProxy(DBus::Connection *connection, |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 22 | const std::string &path, |
| 23 | const std::string &service); |
| 24 | virtual ~ModemGSMCardProxy(); |
| 25 | |
| 26 | // Inherited from ModemGSMCardProxyInterface. |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 27 | virtual void GetIMEI(Error *error, const GSMIdentifierCallback &callback, |
| 28 | int timeout); |
| 29 | virtual void GetIMSI(Error *error, const GSMIdentifierCallback &callback, |
| 30 | int timeout); |
| 31 | virtual void GetSPN(Error *error, const GSMIdentifierCallback &callback, |
| 32 | int timeout); |
| 33 | virtual void GetMSISDN(Error *error, const GSMIdentifierCallback &callback, |
| 34 | int timeout); |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 35 | virtual void EnablePIN(const std::string &pin, bool enabled, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 36 | Error *error, const ResultCallback &callback, |
| 37 | int timeout); |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 38 | virtual void SendPIN(const std::string &pin, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 39 | Error *error, const ResultCallback &callback, |
| 40 | int timeout); |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 41 | virtual void SendPUK(const std::string &puk, const std::string &pin, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 42 | Error *error, const ResultCallback &callback, |
| 43 | int timeout); |
Darin Petkov | e42e101 | 2011-08-31 12:35:04 -0700 | [diff] [blame] | 44 | virtual void ChangePIN(const std::string &old_pin, |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 45 | const std::string &new_pin, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 46 | Error *error, const ResultCallback &callback, |
| 47 | int timeout); |
Darin Petkov | 63138a9 | 2012-02-06 14:09:15 +0100 | [diff] [blame] | 48 | virtual uint32 EnabledFacilityLocks(); |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 49 | |
| 50 | private: |
| 51 | class Proxy |
| 52 | : public org::freedesktop::ModemManager::Modem::Gsm::Card_proxy, |
| 53 | public DBus::ObjectProxy { |
| 54 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 55 | Proxy(DBus::Connection *connection, |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 56 | const std::string &path, |
| 57 | const std::string &service); |
| 58 | virtual ~Proxy(); |
| 59 | |
| 60 | private: |
| 61 | // Signal callbacks inherited from ModemManager::Modem::Gsm::Card_proxy. |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 62 | // [None] |
| 63 | |
| 64 | // Method callbacks inherited from ModemManager::Modem::Gsm::Card_proxy. |
| 65 | virtual void GetImeiCallback(const std::string &imei, |
| 66 | const DBus::Error &dberror, void *data); |
| 67 | virtual void GetImsiCallback(const std::string &imsi, |
| 68 | const DBus::Error &dberror, void *data); |
| 69 | virtual void GetSpnCallback(const std::string &spn, |
| 70 | const DBus::Error &dberror, void *data); |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 71 | virtual void GetMsIsdnCallback(const std::string &msisdn, |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 72 | const DBus::Error &dberror, void *data); |
| 73 | virtual void EnablePinCallback(const DBus::Error &dberror, void *data); |
| 74 | virtual void SendPinCallback(const DBus::Error &dberror, void *data); |
| 75 | virtual void SendPukCallback(const DBus::Error &dberror, void *data); |
| 76 | virtual void ChangePinCallback(const DBus::Error &dberror, void *data); |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 77 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 78 | virtual void GetIdCallback(const std::string &id, |
| 79 | const DBus::Error &dberror, void *data); |
| 80 | virtual void PinCallback(const DBus::Error &dberror, void *data); |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 81 | |
| 82 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 83 | }; |
| 84 | |
| 85 | Proxy proxy_; |
| 86 | |
| 87 | DISALLOW_COPY_AND_ASSIGN(ModemGSMCardProxy); |
| 88 | }; |
| 89 | |
| 90 | } // namespace shill |
| 91 | |
| 92 | #endif // SHILL_MODEM_GSM_CARD_PROXY_ |