blob: 921a4990953cc75190919540fd243e7a6ae41037 [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
5#ifndef SHILL_MODEM_CDMA_PROXY_INTERFACE_
6#define SHILL_MODEM_CDMA_PROXY_INTERFACE_
7
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
Eric Shienbrood9a245532012-03-07 14:20:39 -050019typedef base::Callback<void(uint32)> SignalQualitySignalCallback;
20typedef base::Callback<void(uint32, uint32)> RegistrationStateSignalCallback;
21
22typedef base::Callback<void(uint32, const Error &)> ActivationResultCallback;
23typedef base::Callback<void(uint32, const Error &)> SignalQualityCallback;
24typedef base::Callback<void(uint32, uint32,
25 const Error &)> RegistrationStateCallback;
26
Eric Shienbrood5de44ab2011-12-05 10:46:27 -050027// These are the methods that a ModemManager.Modem.CDMA proxy must support.
28// The interface is provided so that it can be mocked in tests.
Eric Shienbrood9a245532012-03-07 14:20:39 -050029// All calls are made asynchronously. Call completion is signalled via
30// the callbacks passed to the methods.
Darin Petkovbec79a22011-08-01 14:47:17 -070031class ModemCDMAProxyInterface {
32 public:
33 virtual ~ModemCDMAProxyInterface() {}
34
Eric Shienbrood9a245532012-03-07 14:20:39 -050035 virtual void Activate(const std::string &carrier, Error *error,
36 const ActivationResultCallback &callback,
37 int timeout) = 0;
38 virtual void GetRegistrationState(Error *error,
39 const RegistrationStateCallback &callback,
40 int timeout) = 0;
41 virtual void GetSignalQuality(Error *error,
42 const SignalQualityCallback &callback,
43 int timeout) = 0;
Darin Petkov975b5e72011-08-30 11:48:08 -070044
45 // Properties.
46 virtual const std::string MEID() = 0;
Darin Petkovd9661952011-08-03 16:25:42 -070047
Eric Shienbrood9a245532012-03-07 14:20:39 -050048 virtual void set_activation_state_callback(
49 const ActivationStateSignalCallback &callback) = 0;
50 virtual void set_signal_quality_callback(
51 const SignalQualitySignalCallback &callback) = 0;
52 virtual void set_registration_state_callback(
53 const RegistrationStateSignalCallback &callback) = 0;
Darin Petkovbec79a22011-08-01 14:47:17 -070054};
55
56} // namespace shill
57
58#endif // SHILL_MODEM_CDMA_PROXY_INTERFACE_