Darin Petkov | c37a9c4 | 2012-09-06 15:28:22 +0200 | [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_MODEM_GOBI_PROXY_H_ |
| 6 | #define SHILL_MODEM_GOBI_PROXY_H_ |
| 7 | |
Alex Vakulenko | 8a53229 | 2014-06-16 17:18:44 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
Darin Petkov | c37a9c4 | 2012-09-06 15:28:22 +0200 | [diff] [blame] | 10 | #include <base/basictypes.h> |
| 11 | |
Liam McLoughlin | ef342b4 | 2013-09-13 21:05:36 +0100 | [diff] [blame] | 12 | #include "shill/dbus_proxies/modem-gobi.h" |
Darin Petkov | c37a9c4 | 2012-09-06 15:28:22 +0200 | [diff] [blame] | 13 | #include "shill/modem_gobi_proxy_interface.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
mukesh agrawal | f407d59 | 2013-07-31 11:37:57 -0700 | [diff] [blame] | 17 | // A proxy to (old) ModemManager.Modem.Gobi. |
Darin Petkov | c37a9c4 | 2012-09-06 15:28:22 +0200 | [diff] [blame] | 18 | class ModemGobiProxy : public ModemGobiProxyInterface { |
| 19 | public: |
| 20 | // Constructs a ModemManager.Modem.Gobi DBus object proxy at |path| owned by |
| 21 | // |service|. |
| 22 | ModemGobiProxy(DBus::Connection *connection, |
| 23 | const std::string &path, |
| 24 | const std::string &service); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 25 | ~ModemGobiProxy() override; |
Darin Petkov | c37a9c4 | 2012-09-06 15:28:22 +0200 | [diff] [blame] | 26 | |
| 27 | // Inherited from ModemGobiProxyInterface. |
| 28 | virtual void SetCarrier(const std::string &carrier, |
| 29 | Error *error, const ResultCallback &callback, |
| 30 | int timeout); |
| 31 | |
| 32 | private: |
| 33 | class Proxy |
| 34 | : public org::chromium::ModemManager::Modem::Gobi_proxy, |
| 35 | public DBus::ObjectProxy { |
| 36 | public: |
| 37 | Proxy(DBus::Connection *connection, |
| 38 | const std::string &path, |
| 39 | const std::string &service); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 40 | ~Proxy() override; |
Darin Petkov | c37a9c4 | 2012-09-06 15:28:22 +0200 | [diff] [blame] | 41 | |
| 42 | private: |
| 43 | // Signal callbacks inherited from ModemManager::Modem::Gobi_proxy. |
| 44 | // [None] |
| 45 | |
| 46 | // Method callbacks inherited from ModemManager::Modem::Gobi_proxy. |
| 47 | virtual void SetCarrierCallback(const DBus::Error &dberror, void *data); |
| 48 | |
| 49 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 50 | }; |
| 51 | |
| 52 | Proxy proxy_; |
| 53 | |
| 54 | DISALLOW_COPY_AND_ASSIGN(ModemGobiProxy); |
| 55 | }; |
| 56 | |
| 57 | } // namespace shill |
| 58 | |
| 59 | #endif // SHILL_MODEM_GOBI_PROXY_H_ |