blob: a3172b8a4bd4548d71815637cb017abd3a92ee03 [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
Hristo Stefanoved2c28c2011-11-29 15:37:30 -08008#include <string>
9
Darin Petkovbec79a22011-08-01 14:47:17 -070010#include "shill/dbus_bindings/modem-cdma.h"
11#include "shill/dbus_properties.h"
12#include "shill/modem_cdma_proxy_interface.h"
13
14namespace shill {
15
16class ModemCDMAProxy : public ModemCDMAProxyInterface {
17 public:
Darin Petkovd9661952011-08-03 16:25:42 -070018 // Constructs a ModemManager.Modem.CDMA DBus object proxy at |path| owned by
Darin Petkov580c7af2011-10-24 12:32:50 +020019 // |service|. Caught signals will be dispatched to |delegate|.
20 ModemCDMAProxy(ModemCDMAProxyDelegate *delegate,
Darin Petkovd9661952011-08-03 16:25:42 -070021 DBus::Connection *connection,
Darin Petkovbec79a22011-08-01 14:47:17 -070022 const std::string &path,
23 const std::string &service);
24 virtual ~ModemCDMAProxy();
25
26 // Inherited from ModemCDMAProxyInterface.
Darin Petkovc408e692011-08-17 13:47:15 -070027 virtual uint32 Activate(const std::string &carrier);
Darin Petkovbec79a22011-08-01 14:47:17 -070028 virtual void GetRegistrationState(uint32 *cdma_1x_state, uint32 *evdo_state);
Darin Petkovd9661952011-08-03 16:25:42 -070029 virtual uint32 GetSignalQuality();
Darin Petkov975b5e72011-08-30 11:48:08 -070030 virtual const std::string MEID();
Darin Petkovbec79a22011-08-01 14:47:17 -070031
32 private:
33 class Proxy : public org::freedesktop::ModemManager::Modem::Cdma_proxy,
34 public DBus::ObjectProxy {
35 public:
Darin Petkov580c7af2011-10-24 12:32:50 +020036 Proxy(ModemCDMAProxyDelegate *delegate,
Darin Petkovd9661952011-08-03 16:25:42 -070037 DBus::Connection *connection,
Darin Petkovbec79a22011-08-01 14:47:17 -070038 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 Petkovd9661952011-08-03 16:25:42 -070049 virtual void RegistrationStateChanged(const uint32 &cdma_1x_state,
50 const uint32 &evdo_state);
51
Darin Petkov580c7af2011-10-24 12:32:50 +020052 ModemCDMAProxyDelegate *delegate_;
Darin Petkovbec79a22011-08-01 14:47:17 -070053
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_