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