blob: 9cc03bd286531b018ea4cba17252343fb1bc62bc [file] [log] [blame]
Jason Glasgowee1081c2012-03-06 15:14:53 -05001// 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_MM1_MODEM_MODEMCDMA_PROXY_
6#define SHILL_MM1_MODEM_MODEMCDMA_PROXY_
7
8#include <string>
9
10#include "shill/dbus_bindings/mm1-modem-modemcdma.h"
11#include "shill/dbus_properties.h"
12#include "shill/mm1_modem_modemcdma_proxy_interface.h"
13
14namespace shill {
Jason Glasgowee1081c2012-03-06 15:14:53 -050015namespace mm1 {
16
17class ModemModemCdmaProxy : public ModemModemCdmaProxyInterface {
18 public:
19 // Constructs a org.freedesktop.ModemManager1.Modem.ModemCdma DBus
Eric Shienbrood9a245532012-03-07 14:20:39 -050020 // object proxy at |path| owned by |service|.
21 ModemModemCdmaProxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050022 const std::string &path,
23 const std::string &service);
24 virtual ~ModemModemCdmaProxy();
25
26 // Inherited methods from ModemModemCdmaProxyInterface.
27 virtual void Activate(const std::string &carrier,
Eric Shienbrood9a245532012-03-07 14:20:39 -050028 Error *error,
29 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050030 int timeout);
31 virtual void ActivateManual(
32 const DBusPropertiesMap &properties,
Eric Shienbrood9a245532012-03-07 14:20:39 -050033 Error *error,
34 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050035 int timeout);
36
Eric Shienbrood9a245532012-03-07 14:20:39 -050037 virtual void set_activation_state_callback(
38 const ActivationStateSignalCallback &callback);
39
Jason Glasgowee1081c2012-03-06 15:14:53 -050040 // Inherited properties from ModemCdmaProxyInterface.
41 virtual std::string Meid();
42 virtual std::string Esn();
43 virtual uint32_t Sid();
44 virtual uint32_t Nid();
45 virtual uint32_t Cdma1xRegistrationState();
46 virtual uint32_t EvdoRegistrationState();
47
48 private:
49 class Proxy : public org::freedesktop::ModemManager1::Modem::ModemCdma_proxy,
50 public DBus::ObjectProxy {
51 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050052 Proxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050053 const std::string &path,
54 const std::string &service);
55 virtual ~Proxy();
56
Eric Shienbrood9a245532012-03-07 14:20:39 -050057 virtual void set_activation_state_callback(
58 const ActivationStateSignalCallback &callback);
59
Jason Glasgowee1081c2012-03-06 15:14:53 -050060 private:
61 // Signal callbacks inherited from Proxy
62 // handle signals
63 void ActivationStateChanged(
64 const uint32_t &activation_state,
65 const uint32_t &activation_error,
66 const DBusPropertiesMap &status_changes);
67
68 // Method callbacks inherited from
69 // org::freedesktop::ModemManager1::Modem::ModemCdmaProxy
70 virtual void ActivateCallback(const ::DBus::Error& dberror, void *data);
71 virtual void ActivateManualCallback(const ::DBus::Error& dberror,
72 void *data);
Eric Shienbrood9a245532012-03-07 14:20:39 -050073 ActivationStateSignalCallback activation_state_callback_;
Jason Glasgowee1081c2012-03-06 15:14:53 -050074
75 DISALLOW_COPY_AND_ASSIGN(Proxy);
76 };
77
78 Proxy proxy_;
79
80 DISALLOW_COPY_AND_ASSIGN(ModemModemCdmaProxy);
81};
82
83} // namespace mm1
84} // namespace shill
85
86#endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_