blob: ee1850639b99eb5ed7c03ccda0724098d5493337 [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_INTERFACE_
6#define SHILL_MM1_MODEM_MODEMCDMA_PROXY_INTERFACE_
7
8#include <string>
9
10#include <base/basictypes.h>
11
12#include "shill/dbus_properties.h"
13
14namespace shill {
15class AsyncCallHandler;
16class Error;
17
18namespace mm1 {
19
20// These are the methods that a
21// org.freedesktop.ModemManager1.Modem.ModemCdma proxy must support.
22// The interface is provided so that it can be mocked in tests. All
23// calls are made asynchronously. Call completion is signalled through
24// the corresponding 'OnXXXCallback' method in the ProxyDelegate
25// interface.
26class ModemModemCdmaProxyInterface {
27 public:
28 virtual ~ModemModemCdmaProxyInterface() {}
29
30 virtual void Activate(const std::string &carrier,
31 AsyncCallHandler *call_handler,
32 int timeout) = 0;
33 virtual void ActivateManual(
34 const DBusPropertiesMap &properties,
35 AsyncCallHandler *call_handler, int timeout) = 0;
36
37
38 // Properties.
39 virtual std::string Meid() = 0;
40 virtual std::string Esn() = 0;
41 virtual uint32_t Sid() = 0;
42 virtual uint32_t Nid() = 0;
43 virtual uint32_t Cdma1xRegistrationState() = 0;
44 virtual uint32_t EvdoRegistrationState() = 0;
45};
46
47
48// ModemManager1.Modem.ModemCdma signal delegate to be associated with
49// the proxy.
50class ModemModemCdmaProxyDelegate {
51 public:
52 virtual ~ModemModemCdmaProxyDelegate() {}
53
54 // handle signals
55 virtual void OnActivationStateChanged(
56 const uint32_t &activation_state,
57 const uint32_t &activation_error,
58 const DBusPropertiesMap &status_changes) = 0;
59
60 // Handle async callbacks
61 virtual void OnActivateCallback(const Error &error,
62 AsyncCallHandler *call_handler) = 0;
63 virtual void OnActivateManualCallback(
64 const Error &error,
65 AsyncCallHandler *call_handler) = 0;
66};
67
68} // namespace mm1
69} // namespace shill
70
71#endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_INTERFACE_