shill: Add ModemManager1 proxy interfaces and classes
Add ModemManager1 proxy interfaces and classes.
BUG=chromium-os:27487
TEST=compile the code
Change-Id: I4700cc40e0d73e9d3d1cab14a28238bb7a4ab71b
Reviewed-on: https://gerrit.chromium.org/gerrit/17521
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
diff --git a/mm1_modem_simple_proxy.h b/mm1_modem_simple_proxy.h
new file mode 100644
index 0000000..a438df0
--- /dev/null
+++ b/mm1_modem_simple_proxy.h
@@ -0,0 +1,72 @@
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SHILL_MM1_MODEM_SIMPLE_PROXY_
+#define SHILL_MM1_MODEM_SIMPLE_PROXY_
+
+#include <string>
+
+#include "shill/dbus_bindings/mm1-modem-simple.h"
+#include "shill/dbus_properties.h"
+#include "shill/mm1_modem_simple_proxy_interface.h"
+
+namespace shill {
+namespace mm1 {
+
+class ModemSimpleProxy : public ModemSimpleProxyInterface {
+ public:
+ // Constructs a org.freedesktop.ModemManager1.Modem.Simple DBus
+ // object proxy at |path| owned by |service|. Caught signals and
+ // asynchronous method replies will be dispatched to |delegate|.
+ ModemSimpleProxy(ModemSimpleProxyDelegate *delegate,
+ DBus::Connection *connection,
+ const std::string &path,
+ const std::string &service);
+ virtual ~ModemSimpleProxy();
+
+ // Inherited methods from SimpleProxyInterface.
+ virtual void Connect(
+ const DBusPropertiesMap &properties,
+ AsyncCallHandler *call_handler,
+ int timeout);
+ virtual void Disconnect(const ::DBus::Path &bearer,
+ AsyncCallHandler *call_handler,
+ int timeout);
+ virtual void GetStatus(AsyncCallHandler *call_handler, int timeout);
+
+ private:
+ class Proxy : public org::freedesktop::ModemManager1::Modem::Simple_proxy,
+ public DBus::ObjectProxy {
+ public:
+ Proxy(ModemSimpleProxyDelegate *delegate,
+ DBus::Connection *connection,
+ const std::string &path,
+ const std::string &service);
+ virtual ~Proxy();
+
+ private:
+ // Method callbacks inherited from
+ // org::freedesktop::ModemManager1::Modem::SimpleProxy
+ virtual void ConnectCallback(const ::DBus::Path &bearer,
+ const ::DBus::Error &dberror,
+ void *data);
+ virtual void DisconnectCallback(const ::DBus::Error &dberror, void *data);
+ virtual void GetStatusCallback(
+ const DBusPropertiesMap &bearer,
+ const ::DBus::Error &dberror,
+ void *data);
+ ModemSimpleProxyDelegate *delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(Proxy);
+ };
+
+ Proxy proxy_;
+
+ DISALLOW_COPY_AND_ASSIGN(ModemSimpleProxy);
+};
+
+} // namespace mm1
+} // namespace shill
+
+#endif // SHILL_MM1_MODEM_SIMPLE_PROXY_