Darin Petkov | 096b347 | 2012-05-15 10:26: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 | #include "shill/wimax_manager_proxy.h" |
| 6 | |
| 7 | #include <base/logging.h> |
Ben Chan | b879d14 | 2012-05-15 11:10:32 -0700 | [diff] [blame^] | 8 | #include <chromeos/dbus/service_constants.h> |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 9 | |
| 10 | #include "shill/error.h" |
| 11 | #include "shill/scope_logger.h" |
| 12 | |
| 13 | using std::vector; |
| 14 | |
| 15 | namespace shill { |
| 16 | |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 17 | WiMaxManagerProxy::WiMaxManagerProxy(DBus::Connection *connection) |
| 18 | : proxy_(connection) {} |
| 19 | |
| 20 | WiMaxManagerProxy::~WiMaxManagerProxy() {} |
| 21 | |
| 22 | vector<RpcIdentifier> WiMaxManagerProxy::Devices(Error *error) { |
| 23 | SLOG(DBus, 2) << __func__; |
| 24 | vector<DBus::Path> dbus_devices; |
| 25 | try { |
| 26 | dbus_devices = proxy_.Devices(); |
| 27 | } catch (const DBus::Error &e) { |
| 28 | Error::PopulateAndLog(error, Error::kOperationFailed, e.what()); |
| 29 | } |
| 30 | vector<RpcIdentifier> devices; |
| 31 | for (vector<DBus::Path>::const_iterator it = dbus_devices.begin(); |
| 32 | it != dbus_devices.end(); ++it) { |
| 33 | devices.push_back(*it); |
| 34 | } |
| 35 | return devices; |
| 36 | } |
| 37 | |
| 38 | WiMaxManagerProxy::Proxy::Proxy(DBus::Connection *connection) |
| 39 | : DBus::ObjectProxy(*connection, |
Ben Chan | b879d14 | 2012-05-15 11:10:32 -0700 | [diff] [blame^] | 40 | wimax_manager::kWiMaxManagerServicePath, |
| 41 | wimax_manager::kWiMaxManagerServiceName) {} |
Darin Petkov | 096b347 | 2012-05-15 10:26:22 +0200 | [diff] [blame] | 42 | |
| 43 | WiMaxManagerProxy::Proxy::~Proxy() {} |
| 44 | |
| 45 | } // namespace shill |