Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame^] | 1 | // Copyright (c) 2012 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_MM1_MODEM_MODEMCDMA_PROXY_INTERFACE_ |
| 6 | #define SHILL_MM1_MODEM_MODEMCDMA_PROXY_INTERFACE_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/basictypes.h> |
| 11 | |
| 12 | #include "shill/dbus_properties.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | class AsyncCallHandler; |
| 16 | class Error; |
| 17 | |
| 18 | namespace mm1 { |
| 19 | |
| 20 | // These are the methods that a |
| 21 | // org.freedesktop.ModemManager1.Modem.ModemCdma proxy must support. |
| 22 | // The interface is provided so that it can be mocked in tests. All |
| 23 | // calls are made asynchronously. Call completion is signalled through |
| 24 | // the corresponding 'OnXXXCallback' method in the ProxyDelegate |
| 25 | // interface. |
| 26 | class ModemModemCdmaProxyInterface { |
| 27 | public: |
| 28 | virtual ~ModemModemCdmaProxyInterface() {} |
| 29 | |
| 30 | virtual void Activate(const std::string &carrier, |
| 31 | AsyncCallHandler *call_handler, |
| 32 | int timeout) = 0; |
| 33 | virtual void ActivateManual( |
| 34 | const DBusPropertiesMap &properties, |
| 35 | AsyncCallHandler *call_handler, int timeout) = 0; |
| 36 | |
| 37 | |
| 38 | // Properties. |
| 39 | virtual std::string Meid() = 0; |
| 40 | virtual std::string Esn() = 0; |
| 41 | virtual uint32_t Sid() = 0; |
| 42 | virtual uint32_t Nid() = 0; |
| 43 | virtual uint32_t Cdma1xRegistrationState() = 0; |
| 44 | virtual uint32_t EvdoRegistrationState() = 0; |
| 45 | }; |
| 46 | |
| 47 | |
| 48 | // ModemManager1.Modem.ModemCdma signal delegate to be associated with |
| 49 | // the proxy. |
| 50 | class ModemModemCdmaProxyDelegate { |
| 51 | public: |
| 52 | virtual ~ModemModemCdmaProxyDelegate() {} |
| 53 | |
| 54 | // handle signals |
| 55 | virtual void OnActivationStateChanged( |
| 56 | const uint32_t &activation_state, |
| 57 | const uint32_t &activation_error, |
| 58 | const DBusPropertiesMap &status_changes) = 0; |
| 59 | |
| 60 | // Handle async callbacks |
| 61 | virtual void OnActivateCallback(const Error &error, |
| 62 | AsyncCallHandler *call_handler) = 0; |
| 63 | virtual void OnActivateManualCallback( |
| 64 | const Error &error, |
| 65 | AsyncCallHandler *call_handler) = 0; |
| 66 | }; |
| 67 | |
| 68 | } // namespace mm1 |
| 69 | } // namespace shill |
| 70 | |
| 71 | #endif // SHILL_MM1_MODEM_MODEMCDMA_PROXY_INTERFACE_ |