blob: 8a035d40bef11123f852f936efa490e5d172761b [file] [log] [blame]
Darin Petkov096b3472012-05-15 10:26:22 +02001// 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#include "shill/wimax_manager_proxy.h"
6
7#include <base/logging.h>
8
9#include "shill/error.h"
10#include "shill/scope_logger.h"
11
12using std::vector;
13
14namespace shill {
15
16namespace {
17// TODO(petkov): Declare these in chromeos/dbus/service_constants.h.
18const char kWiMaxManagerServicePath[] = "/org/chromium/WiMaxManager";
19const char kWiMaxManagerServiceName[] = "org.chromium.WiMaxManager";
20} // namespace
21
22WiMaxManagerProxy::WiMaxManagerProxy(DBus::Connection *connection)
23 : proxy_(connection) {}
24
25WiMaxManagerProxy::~WiMaxManagerProxy() {}
26
27vector<RpcIdentifier> WiMaxManagerProxy::Devices(Error *error) {
28 SLOG(DBus, 2) << __func__;
29 vector<DBus::Path> dbus_devices;
30 try {
31 dbus_devices = proxy_.Devices();
32 } catch (const DBus::Error &e) {
33 Error::PopulateAndLog(error, Error::kOperationFailed, e.what());
34 }
35 vector<RpcIdentifier> devices;
36 for (vector<DBus::Path>::const_iterator it = dbus_devices.begin();
37 it != dbus_devices.end(); ++it) {
38 devices.push_back(*it);
39 }
40 return devices;
41}
42
43WiMaxManagerProxy::Proxy::Proxy(DBus::Connection *connection)
44 : DBus::ObjectProxy(*connection,
45 kWiMaxManagerServicePath,
46 kWiMaxManagerServiceName) {}
47
48WiMaxManagerProxy::Proxy::~Proxy() {}
49
50} // namespace shill