blob: 26049d2763b5899adf04d511c16dee8ab20a0a9b [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
Ben Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_MODEM_CDMA_PROXY_INTERFACE_H_
6#define SHILL_MODEM_CDMA_PROXY_INTERFACE_H_
Darin Petkovbec79a22011-08-01 14:47:17 -07007
Darin Petkovc408e692011-08-17 13:47:15 -07008#include <string>
9
Darin Petkovbec79a22011-08-01 14:47:17 -070010#include <base/basictypes.h>
11
Eric Shienbrood9a245532012-03-07 14:20:39 -050012#include "shill/callbacks.h"
Darin Petkovef34f182011-08-26 14:14:40 -070013#include "shill/dbus_properties.h"
14
Darin Petkovbec79a22011-08-01 14:47:17 -070015namespace shill {
16
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050017class Error;
18
Ben Chan7fab8972014-08-10 17:14:46 -070019typedef base::Callback<void(uint32_t)> SignalQualitySignalCallback;
20typedef base::Callback<void(uint32_t, uint32_t)>
21 RegistrationStateSignalCallback;
Eric Shienbrood9a245532012-03-07 14:20:39 -050022
Ben Chan7fab8972014-08-10 17:14:46 -070023typedef base::Callback<void(uint32_t, const Error &)> ActivationResultCallback;
24typedef base::Callback<void(uint32_t, const Error &)> SignalQualityCallback;
25typedef base::Callback<void(uint32_t, uint32_t,
Eric Shienbrood9a245532012-03-07 14:20:39 -050026 const Error &)> RegistrationStateCallback;
27
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050028// These are the methods that a ModemManager.Modem.CDMA proxy must support.
29// The interface is provided so that it can be mocked in tests.
Eric Shienbrood9a245532012-03-07 14:20:39 -050030// All calls are made asynchronously. Call completion is signalled via
31// the callbacks passed to the methods.
Darin Petkovbec79a22011-08-01 14:47:17 -070032class ModemCDMAProxyInterface {
33 public:
34 virtual ~ModemCDMAProxyInterface() {}
35
Eric Shienbrood9a245532012-03-07 14:20:39 -050036 virtual void Activate(const std::string &carrier, Error *error,
37 const ActivationResultCallback &callback,
38 int timeout) = 0;
39 virtual void GetRegistrationState(Error *error,
40 const RegistrationStateCallback &callback,
41 int timeout) = 0;
42 virtual void GetSignalQuality(Error *error,
43 const SignalQualityCallback &callback,
44 int timeout) = 0;
Darin Petkov975b5e72011-08-30 11:48:08 -070045
46 // Properties.
47 virtual const std::string MEID() = 0;
Darin Petkovd9661952011-08-03 16:25:42 -070048
Eric Shienbrood9a245532012-03-07 14:20:39 -050049 virtual void set_activation_state_callback(
50 const ActivationStateSignalCallback &callback) = 0;
51 virtual void set_signal_quality_callback(
52 const SignalQualitySignalCallback &callback) = 0;
53 virtual void set_registration_state_callback(
54 const RegistrationStateSignalCallback &callback) = 0;
Darin Petkovbec79a22011-08-01 14:47:17 -070055};
56
57} // namespace shill
58
Ben Chanc45688b2014-07-02 23:50:45 -070059#endif // SHILL_MODEM_CDMA_PROXY_INTERFACE_H_