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 | |
Ben Chan | 74924d8 | 2013-06-15 17:52:55 -0700 | [diff] [blame] | 5 | #ifndef SHILL_MM1_MODEM_PROXY_INTERFACE_H_ |
| 6 | #define SHILL_MM1_MODEM_PROXY_INTERFACE_H_ |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/basictypes.h> |
| 11 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 12 | #include "shill/callbacks.h" |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 13 | |
| 14 | namespace shill { |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 15 | class Error; |
| 16 | |
| 17 | namespace mm1 { |
| 18 | |
Nathan Williams | a31e79c | 2012-03-30 15:07:00 -0400 | [diff] [blame] | 19 | typedef base::Callback<void(int32, |
| 20 | int32, uint32)> ModemStateChangedSignalCallback; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 21 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 22 | // These are the methods that a org.freedesktop.ModemManager1.Modem |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 23 | // proxy must support. The interface is provided so that it can be |
| 24 | // mocked in tests. All calls are made asynchronously. Call completion |
| 25 | // is signalled via the callbacks passed to the methods. |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 26 | class ModemProxyInterface { |
| 27 | public: |
| 28 | virtual ~ModemProxyInterface() {} |
| 29 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 30 | virtual void Enable(bool enable, |
| 31 | Error *error, |
| 32 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 33 | int timeout) = 0; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 34 | virtual void ListBearers(Error *error, |
| 35 | const DBusPathsCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 36 | int timeout) = 0; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 37 | virtual void CreateBearer(const DBusPropertiesMap &properties, |
| 38 | Error *error, |
| 39 | const DBusPathCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 40 | int timeout) = 0; |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 41 | virtual void DeleteBearer(const ::DBus::Path &bearer, |
| 42 | Error *error, |
| 43 | const ResultCallback &callback, |
| 44 | int timeout) = 0; |
| 45 | virtual void Reset(Error *error, |
| 46 | const ResultCallback &callback, |
| 47 | int timeout) = 0; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 48 | virtual void FactoryReset(const std::string &code, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 49 | Error *error, |
| 50 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 51 | int timeout) = 0; |
Ben Chan | 74924d8 | 2013-06-15 17:52:55 -0700 | [diff] [blame] | 52 | virtual void SetCurrentCapabilities(const uint32_t &capabilities, |
| 53 | Error *error, |
| 54 | const ResultCallback &callback, |
| 55 | int timeout) = 0; |
| 56 | virtual void SetCurrentModes(const ::DBus::Struct<uint32_t, uint32_t> &modes, |
| 57 | Error *error, |
| 58 | const ResultCallback &callback, |
| 59 | int timeout) = 0; |
| 60 | virtual void SetCurrentBands(const std::vector<uint32_t> &bands, |
| 61 | Error *error, |
| 62 | const ResultCallback &callback, |
| 63 | int timeout) = 0; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 64 | virtual void Command(const std::string &cmd, |
| 65 | const uint32_t &user_timeout, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 66 | Error *error, |
| 67 | const StringCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 68 | int timeout) = 0; |
Arman Uguray | ee464d3 | 2013-02-13 17:14:36 -0800 | [diff] [blame] | 69 | virtual void SetPowerState(const uint32_t &power_state, |
| 70 | Error *error, |
| 71 | const ResultCallback &callback, |
| 72 | int timeout) = 0; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 73 | |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 74 | |
| 75 | virtual void set_state_changed_callback( |
| 76 | const ModemStateChangedSignalCallback &callback) = 0; |
| 77 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 78 | // Properties. |
| 79 | virtual const ::DBus::Path Sim() = 0; |
Ben Chan | 74924d8 | 2013-06-15 17:52:55 -0700 | [diff] [blame] | 80 | virtual const std::vector<uint32_t> SupportedCapabilities() = 0; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 81 | virtual uint32_t CurrentCapabilities() = 0; |
| 82 | virtual uint32_t MaxBearers() = 0; |
| 83 | virtual uint32_t MaxActiveBearers() = 0; |
| 84 | virtual const std::string Manufacturer() = 0; |
| 85 | virtual const std::string Model() = 0; |
| 86 | virtual const std::string Revision() = 0; |
| 87 | virtual const std::string DeviceIdentifier() = 0; |
| 88 | virtual const std::string Device() = 0; |
Ben Chan | 34e5d68 | 2012-08-24 19:10:49 -0700 | [diff] [blame] | 89 | virtual const std::vector<std::string> Drivers() = 0; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 90 | virtual const std::string Plugin() = 0; |
| 91 | virtual const std::string EquipmentIdentifier() = 0; |
| 92 | virtual uint32_t UnlockRequired() = 0; |
Ben Chan | 74924d8 | 2013-06-15 17:52:55 -0700 | [diff] [blame] | 93 | virtual const std::map<uint32_t, uint32_t> UnlockRetries() = 0; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 94 | virtual uint32_t State() = 0; |
| 95 | virtual uint32_t AccessTechnologies() = 0; |
Ben Chan | 74924d8 | 2013-06-15 17:52:55 -0700 | [diff] [blame] | 96 | virtual const ::DBus::Struct<uint32_t, bool> SignalQuality() = 0; |
| 97 | virtual const std::vector<std::string> OwnNumbers() = 0; |
| 98 | virtual const std::vector<::DBus::Struct<uint32_t, uint32_t>> |
| 99 | SupportedModes() = 0; |
| 100 | virtual const ::DBus::Struct<uint32_t, uint32_t> CurrentModes() = 0; |
| 101 | virtual const std::vector<uint32_t> SupportedBands() = 0; |
| 102 | virtual const std::vector<uint32_t> CurrentBands() = 0; |
| 103 | virtual uint32_t SupportedIpFamilies() = 0; |
Arman Uguray | ee464d3 | 2013-02-13 17:14:36 -0800 | [diff] [blame] | 104 | virtual uint32_t PowerState() = 0; |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 105 | }; |
| 106 | |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 107 | } // namespace mm1 |
| 108 | } // namespace shill |
| 109 | |
Ben Chan | 74924d8 | 2013-06-15 17:52:55 -0700 | [diff] [blame] | 110 | #endif // SHILL_MM1_MODEM_PROXY_INTERFACE_H_ |