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