Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [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_WIMAX_NETWORK_PROXY_H_ |
| 6 | #define SHILL_WIMAX_NETWORK_PROXY_H_ |
| 7 | |
Darin Petkov | 1e52a1b | 2012-05-21 10:35:56 +0200 | [diff] [blame] | 8 | #include <base/callback.h> |
| 9 | |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 10 | #include "shill/dbus_bindings/wimax_manager-network.h" |
| 11 | #include "shill/wimax_network_proxy_interface.h" |
| 12 | |
| 13 | namespace shill { |
| 14 | |
| 15 | class WiMaxNetworkProxy : public WiMaxNetworkProxyInterface { |
| 16 | public: |
| 17 | // Constructs a WiMaxManager.Network DBus object proxy at |path|. |
| 18 | WiMaxNetworkProxy(DBus::Connection *connection, |
| 19 | const DBus::Path &path); |
| 20 | virtual ~WiMaxNetworkProxy(); |
| 21 | |
| 22 | // Inherited from WiMaxNetwokProxyInterface. |
Darin Petkov | 1e52a1b | 2012-05-21 10:35:56 +0200 | [diff] [blame] | 23 | virtual RpcIdentifier path() const; |
| 24 | virtual void set_signal_strength_changed_callback( |
| 25 | const SignalStrengthChangedCallback &callback); |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 26 | virtual uint32 Identifier(Error *error); |
| 27 | virtual std::string Name(Error *error); |
| 28 | virtual int Type(Error *error); |
| 29 | virtual int CINR(Error *error); |
| 30 | virtual int RSSI(Error *error); |
Ben Chan | ac6e836 | 2012-05-20 00:39:58 -0700 | [diff] [blame] | 31 | virtual int SignalStrength(Error *error); |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 32 | |
| 33 | private: |
| 34 | class Proxy : public org::chromium::WiMaxManager::Network_proxy, |
| 35 | public DBus::ObjectProxy { |
| 36 | public: |
| 37 | Proxy(DBus::Connection *connection, const DBus::Path &path); |
| 38 | virtual ~Proxy(); |
| 39 | |
Darin Petkov | 1e52a1b | 2012-05-21 10:35:56 +0200 | [diff] [blame] | 40 | void set_signal_strength_changed_callback( |
| 41 | const SignalStrengthChangedCallback &callback); |
| 42 | |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 43 | private: |
| 44 | // Signal callbacks inherited from WiMaxManager::Network_proxy. |
Darin Petkov | 1e52a1b | 2012-05-21 10:35:56 +0200 | [diff] [blame] | 45 | virtual void SignalStrengthChanged(const int32 &signal_strength); |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 46 | |
| 47 | // Method callbacks inherited from WiMaxManager::Network_proxy. |
| 48 | // [None] |
| 49 | |
Darin Petkov | 1e52a1b | 2012-05-21 10:35:56 +0200 | [diff] [blame] | 50 | SignalStrengthChangedCallback signal_strength_changed_callback_; |
| 51 | |
Darin Petkov | 9893d9c | 2012-05-17 15:27:31 -0700 | [diff] [blame] | 52 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 53 | }; |
| 54 | |
| 55 | static void FromDBusError(const DBus::Error &dbus_error, Error *error); |
| 56 | |
| 57 | Proxy proxy_; |
| 58 | |
| 59 | DISALLOW_COPY_AND_ASSIGN(WiMaxNetworkProxy); |
| 60 | }; |
| 61 | |
| 62 | } // namespace shill |
| 63 | |
| 64 | #endif // SHILL_WIMAX_NETWORK_PROXY_H_ |