blob: bf718405c72e20a4b7fe2afc1d945b3f770645e8 [file] [log] [blame]
Chris Masone3bd3c8c2011-06-13 08:20:26 -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/cellular_service.h"
6
7#include <string>
8
9#include <base/logging.h>
10#include <chromeos/dbus/service_constants.h>
11
12#include "shill/cellular.h"
13#include "shill/control_interface.h"
14#include "shill/device.h"
15#include "shill/device_info.h"
16#include "shill/manager.h"
17#include "shill/shill_event.h"
18
19using std::string;
20
21namespace shill {
22CellularService::CellularService(ControlInterface *control_interface,
23 EventDispatcher *dispatcher,
Chris Masone2b105542011-06-22 10:58:09 -070024 const CellularRefPtr &device,
Chris Masone3bd3c8c2011-06-13 08:20:26 -070025 const string &name)
Chris Masone2b105542011-06-22 10:58:09 -070026 : Service(control_interface, dispatcher, name),
Chris Masone3bd3c8c2011-06-13 08:20:26 -070027 cellular_(device),
28 strength_(0),
29 type_(flimflam::kTypeCellular) {
30
Chris Masone27c4aa52011-07-02 13:10:14 -070031 store_.RegisterConstString(flimflam::kActivationStateProperty,
32 &activation_state_);
33 store_.RegisterConstString(flimflam::kOperatorNameProperty, &operator_name_);
34 store_.RegisterConstString(flimflam::kOperatorCodeProperty, &operator_code_);
35 store_.RegisterConstString(flimflam::kNetworkTechnologyProperty,
36 &network_tech_);
37 store_.RegisterConstString(flimflam::kRoamingStateProperty, &roaming_state_);
38 store_.RegisterConstString(flimflam::kPaymentURLProperty, &payment_url_);
Chris Masone3bd3c8c2011-06-13 08:20:26 -070039
Chris Masone27c4aa52011-07-02 13:10:14 -070040 store_.RegisterStringmap(flimflam::kCellularApnProperty, &apn_info_);
41 store_.RegisterConstStringmap(flimflam::kCellularLastGoodApnProperty,
42 &last_good_apn_info_);
Chris Masone3bd3c8c2011-06-13 08:20:26 -070043
Chris Masone27c4aa52011-07-02 13:10:14 -070044 store_.RegisterConstUint8(flimflam::kSignalStrengthProperty, &strength_);
45 // HelpRegisterDerivedString(flimflam::kStateProperty,
Chris Masone3bd3c8c2011-06-13 08:20:26 -070046 // &Service::CalculateState,
47 // NULL);
Chris Masone27c4aa52011-07-02 13:10:14 -070048 store_.RegisterConstString(flimflam::kTypeProperty, &type_);
Chris Masone3bd3c8c2011-06-13 08:20:26 -070049}
50
51CellularService::~CellularService() { }
52
53void CellularService::Connect() { }
54
55void CellularService::Disconnect() { }
56
Chris Masone95207da2011-06-29 16:50:49 -070057std::string CellularService::GetDeviceRpcId() {
58 return cellular_->GetRpcIdentifier();
59}
60
Chris Masone3bd3c8c2011-06-13 08:20:26 -070061} // namespace shill