blob: 587cc0b52be6ccaf8793287de55f2e7cb43be523 [file] [log] [blame]
Darin Petkova1e0a1c2011-08-25 15:08:33 -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_gsm_network_proxy.h"
6
7#include <base/logging.h>
8
9using std::string;
10
11namespace shill {
12
13ModemGSMNetworkProxy::ModemGSMNetworkProxy(
14 ModemGSMNetworkProxyListener *listener,
15 DBus::Connection *connection,
16 const string &path,
17 const string &service)
18 : proxy_(listener, connection, path, service) {}
19
20ModemGSMNetworkProxy::~ModemGSMNetworkProxy() {}
21
22void ModemGSMNetworkProxy::Register(const string &network_id) {
23 proxy_.Register(network_id);
24}
25
26ModemGSMNetworkProxy::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
33ModemGSMNetworkProxy::Proxy::~Proxy() {}
34
35void ModemGSMNetworkProxy::Proxy::SignalQuality(const uint32 &quality) {
36 VLOG(2) << __func__ << "(" << quality << ")";
37 listener_->OnGSMSignalQualityChanged(quality);
38}
39
40void 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
49void ModemGSMNetworkProxy::Proxy::NetworkMode(const uint32_t &mode) {
50 VLOG(2) << __func__ << "(" << mode << ")";
51 listener_->OnGSMNetworkModeChanged(mode);
52}
53
54} // namespace shill