blob: f20d96f4e4304e4058962fc1ac8be949781b79d4 [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();
Arman Uguraycf4c0072013-03-05 17:27:18 -080043 virtual uint32_t ActivationState();
Jason Glasgowee1081c2012-03-06 15:14:53 -050044 virtual uint32_t Sid();
45 virtual uint32_t Nid();
46 virtual uint32_t Cdma1xRegistrationState();
47 virtual uint32_t EvdoRegistrationState();
48
49 private:
50 class Proxy : public org::freedesktop::ModemManager1::Modem::ModemCdma_proxy,
51 public DBus::ObjectProxy {
52 public:
Eric Shienbrood9a245532012-03-07 14:20:39 -050053 Proxy(DBus::Connection *connection,
Jason Glasgowee1081c2012-03-06 15:14:53 -050054 const std::string &path,
55 const std::string &service);
56 virtual ~Proxy();
57
Eric Shienbrood9a245532012-03-07 14:20:39 -050058 virtual void set_activation_state_callback(
59 const ActivationStateSignalCallback &callback);
60
Jason Glasgowee1081c2012-03-06 15:14:53 -050061 private:
62 // Signal callbacks inherited from Proxy
63 // handle signals
64 void ActivationStateChanged(
65 const uint32_t &activation_state,
66 const uint32_t &activation_error,
67 const DBusPropertiesMap &status_changes);
68
69 // Method callbacks inherited from
70 // org::freedesktop::ModemManager1::Modem::ModemCdmaProxy
71 virtual void ActivateCallback(const ::DBus::Error& dberror, void *data);
72 virtual void ActivateManualCallback(const ::DBus::Error& dberror,
73 void *data);
Eric Shienbrood9a245532012-03-07 14:20:39 -050074 ActivationStateSignalCallback activation_state_callback_;
Jason Glasgowee1081c2012-03-06 15:14:53 -050075
76 DISALLOW_COPY_AND_ASSIGN(Proxy);
77 };
78
79 Proxy proxy_;
80
81 DISALLOW_COPY_AND_ASSIGN(ModemModemCdmaProxy);
82};
83
84} // namespace mm1
85} // namespace shill
86
87#endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_