blob: 33d021f1050c67e7720a00d1ead6648af8816be0 [file] [log] [blame]
Darin Petkovbec79a22011-08-01 14:47:17 -07001// 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
12namespace shill {
13
14class ModemCDMAProxy : public ModemCDMAProxyInterface {
15 public:
Darin Petkovd9661952011-08-03 16:25:42 -070016 // 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 Petkovbec79a22011-08-01 14:47:17 -070020 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 Petkovd9661952011-08-03 16:25:42 -070026 virtual uint32 GetSignalQuality();
Darin Petkovbec79a22011-08-01 14:47:17 -070027
28 private:
29 class Proxy : public org::freedesktop::ModemManager::Modem::Cdma_proxy,
30 public DBus::ObjectProxy {
31 public:
Darin Petkovd9661952011-08-03 16:25:42 -070032 Proxy(ModemCDMAProxyListener *listener,
33 DBus::Connection *connection,
Darin Petkovbec79a22011-08-01 14:47:17 -070034 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 Petkovd9661952011-08-03 16:25:42 -070045 virtual void RegistrationStateChanged(const uint32 &cdma_1x_state,
46 const uint32 &evdo_state);
47
48 ModemCDMAProxyListener *listener_;
Darin Petkovbec79a22011-08-01 14:47:17 -070049
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_