Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 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_MM1_MODEM_MODEMCDMA_PROXY_ |
| 6 | #define SHILL_MM1_MODEM_MODEMCDMA_PROXY_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "shill/dbus_bindings/mm1-modem-modemcdma.h" |
| 11 | #include "shill/dbus_properties.h" |
| 12 | #include "shill/mm1_modem_modemcdma_proxy_interface.h" |
| 13 | |
| 14 | namespace shill { |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 15 | namespace mm1 { |
| 16 | |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 17 | // A proxy to org.freedesktop.ModemManager1.Modem.ModemCdma. |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 18 | class ModemModemCdmaProxy : public ModemModemCdmaProxyInterface { |
| 19 | public: |
| 20 | // Constructs a org.freedesktop.ModemManager1.Modem.ModemCdma DBus |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 21 | // object proxy at |path| owned by |service|. |
| 22 | ModemModemCdmaProxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 23 | const std::string &path, |
| 24 | const std::string &service); |
| 25 | virtual ~ModemModemCdmaProxy(); |
| 26 | |
| 27 | // Inherited methods from ModemModemCdmaProxyInterface. |
| 28 | virtual void Activate(const std::string &carrier, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 29 | Error *error, |
| 30 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 31 | int timeout); |
| 32 | virtual void ActivateManual( |
| 33 | const DBusPropertiesMap &properties, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 34 | Error *error, |
| 35 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 36 | int timeout); |
| 37 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 38 | virtual void set_activation_state_callback( |
| 39 | const ActivationStateSignalCallback &callback); |
| 40 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 41 | // Inherited properties from ModemCdmaProxyInterface. |
| 42 | virtual std::string Meid(); |
| 43 | virtual std::string Esn(); |
Arman Uguray | cf4c007 | 2013-03-05 17:27:18 -0800 | [diff] [blame] | 44 | virtual uint32_t ActivationState(); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 45 | virtual uint32_t Sid(); |
| 46 | virtual uint32_t Nid(); |
| 47 | virtual uint32_t Cdma1xRegistrationState(); |
| 48 | virtual uint32_t EvdoRegistrationState(); |
| 49 | |
| 50 | private: |
| 51 | class Proxy : public org::freedesktop::ModemManager1::Modem::ModemCdma_proxy, |
| 52 | public DBus::ObjectProxy { |
| 53 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 54 | Proxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 55 | const std::string &path, |
| 56 | const std::string &service); |
| 57 | virtual ~Proxy(); |
| 58 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 59 | virtual void set_activation_state_callback( |
| 60 | const ActivationStateSignalCallback &callback); |
| 61 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 62 | private: |
| 63 | // Signal callbacks inherited from Proxy |
| 64 | // handle signals |
| 65 | void ActivationStateChanged( |
| 66 | const uint32_t &activation_state, |
| 67 | const uint32_t &activation_error, |
| 68 | const DBusPropertiesMap &status_changes); |
| 69 | |
| 70 | // Method callbacks inherited from |
| 71 | // org::freedesktop::ModemManager1::Modem::ModemCdmaProxy |
| 72 | virtual void ActivateCallback(const ::DBus::Error& dberror, void *data); |
| 73 | virtual void ActivateManualCallback(const ::DBus::Error& dberror, |
| 74 | void *data); |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 75 | ActivationStateSignalCallback activation_state_callback_; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 76 | |
| 77 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 78 | }; |
| 79 | |
| 80 | Proxy proxy_; |
| 81 | |
| 82 | DISALLOW_COPY_AND_ASSIGN(ModemModemCdmaProxy); |
| 83 | }; |
| 84 | |
| 85 | } // namespace mm1 |
| 86 | } // namespace shill |
| 87 | |
| 88 | #endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_ |