blob: acbedba22a834e92594dc1de243b4629e784f3b7 [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
mukesh agrawalf407d592013-07-31 11:37:57 -070017// A proxy to org.freedesktop.ModemManager1.Modem.ModemCdma.
Jason Glasgowee1081c2012-03-06 15:14:53 -050018class ModemModemCdmaProxy : public ModemModemCdmaProxyInterface {
19 public:
20 // Constructs a org.freedesktop.ModemManager1.Modem.ModemCdma DBus
Eric Shienbrood9a245532012-03-07 14:20:39 -050021 // object proxy at |path| owned by |service|.
22 ModemModemCdmaProxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050023 const std::string &path,
24 const std::string &service);
25 virtual ~ModemModemCdmaProxy();
26
27 // Inherited methods from ModemModemCdmaProxyInterface.
28 virtual void Activate(const std::string &carrier,
Eric Shienbrood9a245532012-03-07 14:20:39 -050029 Error *error,
30 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050031 int timeout);
32 virtual void ActivateManual(
33 const DBusPropertiesMap &properties,
Eric Shienbrood9a245532012-03-07 14:20:39 -050034 Error *error,
35 const ResultCallback &callback,
Jason Glasgowee1081c2012-03-06 15:14:53 -050036 int timeout);
37
Eric Shienbrood9a245532012-03-07 14:20:39 -050038 virtual void set_activation_state_callback(
39 const ActivationStateSignalCallback &callback);
40
Jason Glasgowee1081c2012-03-06 15:14:53 -050041 // Inherited properties from ModemCdmaProxyInterface.
42 virtual std::string Meid();
43 virtual std::string Esn();
Arman Uguraycf4c0072013-03-05 17:27:18 -080044 virtual uint32_t ActivationState();
Jason Glasgowee1081c2012-03-06 15:14:53 -050045 virtual uint32_t Sid();
46 virtual uint32_t Nid();
47 virtual uint32_t Cdma1xRegistrationState();
48 virtual uint32_t EvdoRegistrationState();
49
50 private:
51 class Proxy : public org::freedesktop::ModemManager1::Modem::ModemCdma_proxy,
52 public DBus::ObjectProxy {
53 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050054 Proxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050055 const std::string &path,
56 const std::string &service);
57 virtual ~Proxy();
58
Eric Shienbrood9a245532012-03-07 14:20:39 -050059 virtual void set_activation_state_callback(
60 const ActivationStateSignalCallback &callback);
61
Jason Glasgowee1081c2012-03-06 15:14:53 -050062 private:
63 // Signal callbacks inherited from Proxy
64 // handle signals
65 void ActivationStateChanged(
66 const uint32_t &activation_state,
67 const uint32_t &activation_error,
68 const DBusPropertiesMap &status_changes);
69
70 // Method callbacks inherited from
71 // org::freedesktop::ModemManager1::Modem::ModemCdmaProxy
72 virtual void ActivateCallback(const ::DBus::Error& dberror, void *data);
73 virtual void ActivateManualCallback(const ::DBus::Error& dberror,
74 void *data);
Eric Shienbrood9a245532012-03-07 14:20:39 -050075 ActivationStateSignalCallback activation_state_callback_;
Jason Glasgowee1081c2012-03-06 15:14:53 -050076
77 DISALLOW_COPY_AND_ASSIGN(Proxy);
78 };
79
80 Proxy proxy_;
81
82 DISALLOW_COPY_AND_ASSIGN(ModemModemCdmaProxy);
83};
84
85} // namespace mm1
86} // namespace shill
87
88#endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_