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_MODEM3GPP_PROXY_ |
| 6 | #define SHILL_MM1_MODEM_MODEM3GPP_PROXY_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "shill/dbus_bindings/mm1-modem-modem3gpp.h" |
| 11 | #include "shill/dbus_properties.h" |
| 12 | #include "shill/mm1_modem_modem3gpp_proxy_interface.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | namespace mm1 { |
| 16 | |
| 17 | class ModemModem3gppProxy : public ModemModem3gppProxyInterface { |
| 18 | public: |
| 19 | // Constructs a org.freedesktop.ModemManager1.Modem.Modem3gpp DBus |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 20 | // object proxy at |path| owned by |service|. |
| 21 | ModemModem3gppProxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 22 | const std::string &path, |
| 23 | const std::string &service); |
| 24 | virtual ~ModemModem3gppProxy(); |
| 25 | // Inherited methods from ModemModem3gppProxyInterface. |
| 26 | virtual void Register(const std::string &operator_id, |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 27 | Error *error, |
| 28 | const ResultCallback &callback, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 29 | int timeout); |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 30 | virtual void Scan(Error *error, |
| 31 | const DBusPropertyMapsCallback &callback, |
| 32 | int timeout); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 33 | |
| 34 | // Inherited properties from Modem3gppProxyInterface. |
| 35 | virtual std::string Imei(); |
| 36 | virtual uint32_t RegistrationState(); |
| 37 | virtual std::string OperatorCode(); |
| 38 | virtual std::string OperatorName(); |
| 39 | virtual uint32_t EnabledFacilityLocks(); |
| 40 | |
| 41 | private: |
| 42 | class Proxy : public org::freedesktop::ModemManager1::Modem::Modem3gpp_proxy, |
| 43 | public DBus::ObjectProxy { |
| 44 | public: |
Eric Shienbrood | 9a24553 | 2012-03-07 14:20:39 -0500 | [diff] [blame] | 45 | Proxy(DBus::Connection *connection, |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 46 | const std::string &path, |
| 47 | const std::string &service); |
| 48 | virtual ~Proxy(); |
| 49 | |
| 50 | private: |
| 51 | // Method callbacks inherited from |
| 52 | // org::freedesktop::ModemManager1::Modem::Modem3gppProxy |
| 53 | virtual void RegisterCallback(const ::DBus::Error& dberror, void *data); |
| 54 | virtual void ScanCallback( |
| 55 | const std::vector<DBusPropertiesMap> &results, |
| 56 | const ::DBus::Error& dberror, void *data); |
Jason Glasgow | ee1081c | 2012-03-06 15:14:53 -0500 | [diff] [blame] | 57 | |
| 58 | DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 59 | }; |
| 60 | |
| 61 | Proxy proxy_; |
| 62 | |
| 63 | DISALLOW_COPY_AND_ASSIGN(ModemModem3gppProxy); |
| 64 | }; |
| 65 | |
| 66 | } // namespace mm1 |
| 67 | } // namespace shill |
| 68 | |
| 69 | #endif // MM1_SHILL_MODEM_MODEM3GPP_PROXY_ |