Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 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_PROXY_INTERFACE_ |
| 6 | #define SHILL_MODEM_PROXY_INTERFACE_ |
| 7 | |
Hristo Stefanov | ed2c28c | 2011-11-29 15:37:30 -0800 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | ceb6817 | 2011-07-29 14:47:48 -0700 | [diff] [blame] | 10 | #include <dbus-c++/types.h> |
| 11 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 12 | #include "shill/callbacks.h" |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 13 | #include "shill/dbus_properties.h" |
| 14 | |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 15 | namespace shill { |
| 16 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 17 | class CallContext; |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 18 | class Error; |
| 19 | |
| 20 | typedef DBus::Struct<std::string, std::string, std::string> ModemHardwareInfo; |
| 21 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 22 | typedef base::Callback<void(uint32, |
| 23 | uint32, uint32)> ModemStateChangedSignalCallback; |
| 24 | typedef base::Callback<void(const ModemHardwareInfo &, |
| 25 | const Error &)> ModemInfoCallback; |
| 26 | |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 27 | // These are the methods that a ModemManager.Modem proxy must support. The |
Eric Shienbrood | 5de44ab | 2011-12-05 10:46:27 -0500 | [diff] [blame] | 28 | // interface is provided so that it can be mocked in tests. All calls are |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 29 | // made asynchronously. |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 30 | class ModemProxyInterface { |
| 31 | public: |
| 32 | virtual ~ModemProxyInterface() {} |
| 33 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 34 | virtual void Enable(bool enable, Error *error, |
| 35 | const ResultCallback &callback, int timeout) = 0; |
| 36 | virtual void Disconnect(Error *error, const ResultCallback &callback, |
| 37 | int timeout) = 0; |
| 38 | virtual void GetModemInfo(Error *error, const ModemInfoCallback &callback, |
| 39 | int timeout) = 0; |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 40 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 41 | virtual void set_state_changed_callback( |
| 42 | const ModemStateChangedSignalCallback &callback) = 0; |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
Darin Petkov | e9d12e0 | 2011-07-27 15:09:37 -0700 | [diff] [blame] | 45 | } // namespace shill |
| 46 | |
| 47 | #endif // SHILL_MODEM_PROXY_INTERFACE_ |