blob: 1eb1b0cc18d1c25047edb070b6b47ab3c1aeb024 [file] [log] [blame]
Darin Petkove9d12e02011-07-27 15:09:37 -07001// Copyright (c) 2011 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/modem_proxy.h"
6
7#include <base/logging.h>
8
9using std::string;
10
11namespace shill {
12
Darin Petkovc5f56562011-08-06 16:40:05 -070013ModemProxy::ModemProxy(ModemProxyListener *listener,
14 DBus::Connection *connection,
Darin Petkove9d12e02011-07-27 15:09:37 -070015 const string &path,
16 const string &service)
Darin Petkovc5f56562011-08-06 16:40:05 -070017 : proxy_(listener, connection, path, service) {}
Darin Petkove9d12e02011-07-27 15:09:37 -070018
19ModemProxy::~ModemProxy() {}
20
21void ModemProxy::Enable(const bool enable) {
22 proxy_.Enable(enable);
23}
24
Darin Petkovceb68172011-07-29 14:47:48 -070025ModemProxyInterface::Info ModemProxy::GetInfo() {
26 return proxy_.GetInfo();
27}
28
Darin Petkovc5f56562011-08-06 16:40:05 -070029ModemProxy::Proxy::Proxy(ModemProxyListener *listener,
30 DBus::Connection *connection,
Darin Petkove9d12e02011-07-27 15:09:37 -070031 const string &path,
32 const string &service)
Darin Petkovc5f56562011-08-06 16:40:05 -070033 : DBus::ObjectProxy(*connection, path, service.c_str()),
34 listener_(listener) {}
Darin Petkove9d12e02011-07-27 15:09:37 -070035
36ModemProxy::Proxy::~Proxy() {}
37
Darin Petkov1ec741c2011-08-02 10:45:27 -070038void ModemProxy::Proxy::StateChanged(const uint32 &old,
39 const uint32 &_new,
Darin Petkove9d12e02011-07-27 15:09:37 -070040 const uint32 &reason) {
Darin Petkovc5f56562011-08-06 16:40:05 -070041 VLOG(2) << __func__ << "(" << old << ", " << _new << ", " << reason << ")";
42 listener_->OnModemStateChanged(old, _new, reason);
Darin Petkove9d12e02011-07-27 15:09:37 -070043}
44
45} // namespace shill