Darin Petkov | a1e0a1c | 2011-08-25 15:08:33 -0700 | [diff] [blame] | 1 | // 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_gsm_network_proxy.h" |
| 6 | |
| 7 | #include <base/logging.h> |
| 8 | |
| 9 | using std::string; |
| 10 | |
| 11 | namespace shill { |
| 12 | |
| 13 | ModemGSMNetworkProxy::ModemGSMNetworkProxy( |
| 14 | ModemGSMNetworkProxyListener *listener, |
| 15 | DBus::Connection *connection, |
| 16 | const string &path, |
| 17 | const string &service) |
| 18 | : proxy_(listener, connection, path, service) {} |
| 19 | |
| 20 | ModemGSMNetworkProxy::~ModemGSMNetworkProxy() {} |
| 21 | |
| 22 | void ModemGSMNetworkProxy::Register(const string &network_id) { |
| 23 | proxy_.Register(network_id); |
| 24 | } |
| 25 | |
| 26 | ModemGSMNetworkProxy::Proxy::Proxy(ModemGSMNetworkProxyListener *listener, |
| 27 | DBus::Connection *connection, |
| 28 | const string &path, |
| 29 | const string &service) |
| 30 | : DBus::ObjectProxy(*connection, path, service.c_str()), |
| 31 | listener_(listener) {} |
| 32 | |
| 33 | ModemGSMNetworkProxy::Proxy::~Proxy() {} |
| 34 | |
| 35 | void ModemGSMNetworkProxy::Proxy::SignalQuality(const uint32 &quality) { |
| 36 | VLOG(2) << __func__ << "(" << quality << ")"; |
| 37 | listener_->OnGSMSignalQualityChanged(quality); |
| 38 | } |
| 39 | |
| 40 | void ModemGSMNetworkProxy::Proxy::RegistrationInfo( |
| 41 | const uint32_t &status, |
| 42 | const string &operator_code, |
| 43 | const string &operator_name) { |
| 44 | VLOG(2) << __func__ << "(" << status << ", " << operator_code << ", " |
| 45 | << operator_name << ")"; |
| 46 | listener_->OnGSMRegistrationInfoChanged(status, operator_code, operator_name); |
| 47 | } |
| 48 | |
| 49 | void ModemGSMNetworkProxy::Proxy::NetworkMode(const uint32_t &mode) { |
| 50 | VLOG(2) << __func__ << "(" << mode << ")"; |
| 51 | listener_->OnGSMNetworkModeChanged(mode); |
| 52 | } |
| 53 | |
| 54 | } // namespace shill |