shill: wimax: Implement WiMAX Manager and Device proxies.

Also, add a WiMax logging scope.

BUG=chrome-os-partner:9697
TEST=build and run unit tests

Change-Id: I8516ff2b55e54feb5fcdab089d0fe279551b4317
Reviewed-on: https://gerrit.chromium.org/gerrit/22695
Commit-Ready: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
diff --git a/wimax_manager_proxy.cc b/wimax_manager_proxy.cc
new file mode 100644
index 0000000..8a035d4
--- /dev/null
+++ b/wimax_manager_proxy.cc
@@ -0,0 +1,50 @@
+// 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.
+
+#include "shill/wimax_manager_proxy.h"
+
+#include <base/logging.h>
+
+#include "shill/error.h"
+#include "shill/scope_logger.h"
+
+using std::vector;
+
+namespace shill {
+
+namespace {
+// TODO(petkov): Declare these in chromeos/dbus/service_constants.h.
+const char kWiMaxManagerServicePath[] = "/org/chromium/WiMaxManager";
+const char kWiMaxManagerServiceName[] = "org.chromium.WiMaxManager";
+}  // namespace
+
+WiMaxManagerProxy::WiMaxManagerProxy(DBus::Connection *connection)
+    : proxy_(connection) {}
+
+WiMaxManagerProxy::~WiMaxManagerProxy() {}
+
+vector<RpcIdentifier> WiMaxManagerProxy::Devices(Error *error) {
+  SLOG(DBus, 2) << __func__;
+  vector<DBus::Path> dbus_devices;
+  try {
+    dbus_devices = proxy_.Devices();
+  } catch (const DBus::Error &e) {
+    Error::PopulateAndLog(error, Error::kOperationFailed, e.what());
+  }
+  vector<RpcIdentifier> devices;
+  for (vector<DBus::Path>::const_iterator it = dbus_devices.begin();
+       it != dbus_devices.end(); ++it) {
+    devices.push_back(*it);
+  }
+  return devices;
+}
+
+WiMaxManagerProxy::Proxy::Proxy(DBus::Connection *connection)
+    : DBus::ObjectProxy(*connection,
+                        kWiMaxManagerServicePath,
+                        kWiMaxManagerServiceName) {}
+
+WiMaxManagerProxy::Proxy::~Proxy() {}
+
+}  // namespace shill