blob: 1be7733652962a23dbe8ab94e22d67e2217b3502 [file] [log] [blame]
Darin Petkov9893d9c2012-05-17 15:27:31 -07001// 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 Petkov1e52a1b2012-05-21 10:35:56 +02008#include <base/callback.h>
9
Darin Petkov9893d9c2012-05-17 15:27:31 -070010#include "shill/dbus_bindings/wimax_manager-network.h"
11#include "shill/wimax_network_proxy_interface.h"
12
13namespace shill {
14
15class 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 Petkov1e52a1b2012-05-21 10:35:56 +020023 virtual RpcIdentifier path() const;
24 virtual void set_signal_strength_changed_callback(
25 const SignalStrengthChangedCallback &callback);
Darin Petkov9893d9c2012-05-17 15:27:31 -070026 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 Chanac6e8362012-05-20 00:39:58 -070031 virtual int SignalStrength(Error *error);
Darin Petkov9893d9c2012-05-17 15:27:31 -070032
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 Petkov1e52a1b2012-05-21 10:35:56 +020040 void set_signal_strength_changed_callback(
41 const SignalStrengthChangedCallback &callback);
42
Darin Petkov9893d9c2012-05-17 15:27:31 -070043 private:
44 // Signal callbacks inherited from WiMaxManager::Network_proxy.
Darin Petkov1e52a1b2012-05-21 10:35:56 +020045 virtual void SignalStrengthChanged(const int32 &signal_strength);
Darin Petkov9893d9c2012-05-17 15:27:31 -070046
47 // Method callbacks inherited from WiMaxManager::Network_proxy.
48 // [None]
49
Darin Petkov1e52a1b2012-05-21 10:35:56 +020050 SignalStrengthChangedCallback signal_strength_changed_callback_;
51
Darin Petkov9893d9c2012-05-17 15:27:31 -070052 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_