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 | |
Darin Petkov | 9bac6fe | 2011-08-26 12:49:05 -0700 | [diff] [blame] | 22 | ModemGSMNetworkProxyInterface::RegistrationInfo |
| 23 | ModemGSMNetworkProxy::GetRegistrationInfo() { |
| 24 | return proxy_.GetRegistrationInfo(); |
| 25 | } |
| 26 | |
Darin Petkov | 22b72bf | 2011-08-29 14:01:20 -0700 | [diff] [blame] | 27 | uint32 ModemGSMNetworkProxy::GetSignalQuality() { |
| 28 | return proxy_.GetSignalQuality(); |
| 29 | } |
| 30 | |
| 31 | void ModemGSMNetworkProxy::Register(const string &network_id) { |
| 32 | proxy_.Register(network_id); |
| 33 | } |
| 34 | |
Darin Petkov | c086531 | 2011-09-16 15:31:20 -0700 | [diff] [blame] | 35 | ModemGSMNetworkProxyInterface::ScanResults ModemGSMNetworkProxy::Scan() { |
| 36 | return proxy_.Scan(); |
| 37 | } |
| 38 | |
Darin Petkov | 9bac6fe | 2011-08-26 12:49:05 -0700 | [diff] [blame] | 39 | uint32 ModemGSMNetworkProxy::AccessTechnology() { |
| 40 | return proxy_.AccessTechnology(); |
| 41 | } |
| 42 | |
Darin Petkov | a1e0a1c | 2011-08-25 15:08:33 -0700 | [diff] [blame] | 43 | ModemGSMNetworkProxy::Proxy::Proxy(ModemGSMNetworkProxyListener *listener, |
| 44 | DBus::Connection *connection, |
| 45 | const string &path, |
| 46 | const string &service) |
| 47 | : DBus::ObjectProxy(*connection, path, service.c_str()), |
| 48 | listener_(listener) {} |
| 49 | |
| 50 | ModemGSMNetworkProxy::Proxy::~Proxy() {} |
| 51 | |
| 52 | void ModemGSMNetworkProxy::Proxy::SignalQuality(const uint32 &quality) { |
| 53 | VLOG(2) << __func__ << "(" << quality << ")"; |
| 54 | listener_->OnGSMSignalQualityChanged(quality); |
| 55 | } |
| 56 | |
| 57 | void ModemGSMNetworkProxy::Proxy::RegistrationInfo( |
| 58 | const uint32_t &status, |
| 59 | const string &operator_code, |
| 60 | const string &operator_name) { |
| 61 | VLOG(2) << __func__ << "(" << status << ", " << operator_code << ", " |
| 62 | << operator_name << ")"; |
| 63 | listener_->OnGSMRegistrationInfoChanged(status, operator_code, operator_name); |
| 64 | } |
| 65 | |
| 66 | void ModemGSMNetworkProxy::Proxy::NetworkMode(const uint32_t &mode) { |
| 67 | VLOG(2) << __func__ << "(" << mode << ")"; |
| 68 | listener_->OnGSMNetworkModeChanged(mode); |
| 69 | } |
| 70 | |
| 71 | } // namespace shill |