Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 1 | // 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 Petkov | c408e69 | 2011-08-17 13:47:15 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 10 | #include <base/basictypes.h> |
| 11 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 12 | #include "shill/callbacks.h" |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 13 | #include "shill/dbus_properties.h" |
| 14 | |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 15 | namespace shill { |
| 16 | |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 17 | class Error; |
| 18 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 19 | typedef base::Callback<void(uint32)> SignalQualitySignalCallback; |
| 20 | typedef base::Callback<void(uint32, uint32)> RegistrationStateSignalCallback; |
| 21 | |
| 22 | typedef base::Callback<void(uint32, const Error &)> ActivationResultCallback; |
| 23 | typedef base::Callback<void(uint32, const Error &)> SignalQualityCallback; |
| 24 | typedef base::Callback<void(uint32, uint32, |
| 25 | const Error &)> RegistrationStateCallback; |
| 26 | |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 27 | // 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 Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 29 | // All calls are made asynchronously. Call completion is signalled via |
| 30 | // the callbacks passed to the methods. |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 31 | class ModemCDMAProxyInterface { |
| 32 | public: |
| 33 | virtual ~ModemCDMAProxyInterface() {} |
| 34 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 35 | 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 Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 44 | |
| 45 | // Properties. |
| 46 | virtual const std::string MEID() = 0; |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 47 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 48 | 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 Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | } // namespace shill |
| 57 | |
| 58 | #endif // SHILL_MODEM_CDMA_PROXY_INTERFACE_ |