blob: 98b085b0923271431a238efdf2b142be0dfb3ee2 [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 Petkov580c7af2011-10-24 12:32:50 +020013ModemProxy::ModemProxy(ModemProxyDelegate *delegate,
Darin Petkovc5f56562011-08-06 16:40:05 -070014 DBus::Connection *connection,
Darin Petkove9d12e02011-07-27 15:09:37 -070015 const string &path,
16 const string &service)
Darin Petkov580c7af2011-10-24 12:32:50 +020017 : proxy_(delegate, 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 Petkov580c7af2011-10-24 12:32:50 +020029ModemProxy::Proxy::Proxy(ModemProxyDelegate *delegate,
Darin Petkovc5f56562011-08-06 16:40:05 -070030 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()),
Darin Petkov580c7af2011-10-24 12:32:50 +020034 delegate_(delegate) {}
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 << ")";
Darin Petkov580c7af2011-10-24 12:32:50 +020042 delegate_->OnModemStateChanged(old, _new, reason);
Darin Petkove9d12e02011-07-27 15:09:37 -070043}
44
45} // namespace shill