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 | |
Darin Petkov | ef34f18 | 2011-08-26 14:14:40 -0700 | [diff] [blame] | 12 | #include "shill/dbus_properties.h" |
| 13 | |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 14 | namespace shill { |
| 15 | |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 16 | class AsyncCallHandler; |
| 17 | class Error; |
| 18 | |
| 19 | // These are the methods that a ModemManager.Modem.CDMA proxy must support. |
| 20 | // The interface is provided so that it can be mocked in tests. |
| 21 | // All calls are made asynchronously. Call completion is signalled through |
| 22 | // the corresponding 'OnXXXCallback' method in the ProxyDelegate interface. |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 23 | class ModemCDMAProxyInterface { |
| 24 | public: |
| 25 | virtual ~ModemCDMAProxyInterface() {} |
| 26 | |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 27 | virtual void Activate(const std::string &carrier, |
| 28 | AsyncCallHandler *call_handler, int timeout) = 0; |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 29 | virtual void GetRegistrationState(uint32 *cdma_1x_state, |
| 30 | uint32 *evdo_state) = 0; |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 31 | virtual uint32 GetSignalQuality() = 0; |
Darin Petkov | 975b5e7 | 2011-08-30 11:48:08 -0700 | [diff] [blame] | 32 | |
| 33 | // Properties. |
| 34 | virtual const std::string MEID() = 0; |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 37 | // ModemManager.Modem.CDMA signal delegate to be associated with the proxy. |
| 38 | class ModemCDMAProxyDelegate { |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 39 | public: |
Darin Petkov | 580c7af | 2011-10-24 12:32:50 +0200 | [diff] [blame] | 40 | virtual ~ModemCDMAProxyDelegate() {} |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 41 | |
Darin Petkov | b27e544 | 2011-08-16 14:36:45 -0700 | [diff] [blame] | 42 | virtual void OnCDMAActivationStateChanged( |
| 43 | uint32 activation_state, |
| 44 | uint32 activation_error, |
| 45 | const DBusPropertiesMap &status_changes) = 0; |
Darin Petkov | d966195 | 2011-08-03 16:25:42 -0700 | [diff] [blame] | 46 | virtual void OnCDMARegistrationStateChanged(uint32 state_1x, |
| 47 | uint32 state_evdo) = 0; |
| 48 | virtual void OnCDMASignalQualityChanged(uint32 strength) = 0; |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 49 | virtual void OnActivateCallback(uint32 status, const Error &error, |
| 50 | AsyncCallHandler *call_handler) = 0; |
Darin Petkov | bec79a2 | 2011-08-01 14:47:17 -0700 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | } // namespace shill |
| 54 | |
| 55 | #endif // SHILL_MODEM_CDMA_PROXY_INTERFACE_ |