Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 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_MODEM_CDMA_PROXY_ |
| 6 | #define SHILL_MODEM_CDMA_PROXY_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 10 | #include "shill/dbus_bindings/modem-cdma.h" |
| 11 | #include "shill/dbus_properties.h" |
| 12 | #include "shill/modem_cdma_proxy_interface.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | |
| 16 | class ModemCDMAProxy : public ModemCDMAProxyInterface { |
| 17 | public: |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 18 | // Constructs a ModemManager.Modem.CDMA DBus object proxy at |path| owned by |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 19 | // |service|. Caught signals will be dispatched to |delegate|. |
| 20 | ModemCDMAProxy(ModemCDMAProxyDelegate *delegate, |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 21 | DBus::Connection *connection, |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 22 | const std::string &path, |
| 23 | const std::string &service); |
| 24 | virtual ~ModemCDMAProxy(); |
| 25 | |
| 26 | // Inherited from ModemCDMAProxyInterface. |
Darin Petkov | c408e69 | 2011-08-17 13:47:15 -0700 | [diff] [blame] | 27 | virtual uint32 Activate(const std::string &carrier); |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 28 | virtual void GetRegistrationState(uint32 *cdma_1x_state, uint32 *evdo_state); |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 29 | virtual uint32 GetSignalQuality(); |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 30 | virtual const std::string MEID(); |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 31 | |
| 32 | private: |
| 33 | class Proxy : public org::freedesktop::ModemManager::Modem::Cdma_proxy, |
| 34 | public DBus::ObjectProxy { |
| 35 | public: |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 36 | Proxy(ModemCDMAProxyDelegate *delegate, |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 37 | DBus::Connection *connection, |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 38 | const std::string &path, |
| 39 | const std::string &service); |
| 40 | virtual ~Proxy(); |
| 41 | |
| 42 | private: |
| 43 | // Signal callbacks inherited from ModemManager::Modem::Cdma_proxy. |
| 44 | virtual void ActivationStateChanged( |
| 45 | const uint32 &activation_state, |
| 46 | const uint32 &activation_error, |
| 47 | const DBusPropertiesMap &status_changes); |
| 48 | virtual void SignalQuality(const uint32 &quality); |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 49 | virtual void RegistrationStateChanged(const uint32 &cdma_1x_state, |
| 50 | const uint32 &evdo_state); |
| 51 | |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 52 | ModemCDMAProxyDelegate *delegate_; |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 53 | |
| 54 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 55 | }; |
| 56 | |
| 57 | Proxy proxy_; |
| 58 | |
| 59 | DISALLOW_COPY_AND_ASSIGN(ModemCDMAProxy); |
| 60 | }; |
| 61 | |
| 62 | } // namespace shill |
| 63 | |
| 64 | #endif // SHILL_MODEM_CDMA_PROXY_ |