Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -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/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 | |
| 19 | using std::string; |
| 20 | |
| 21 | namespace shill { |
| 22 | CellularService::CellularService(ControlInterface *control_interface, |
| 23 | EventDispatcher *dispatcher, |
Chris Masone | 6791a43 | 2011-07-12 13:23:19 -0700 | [diff] [blame^] | 24 | Manager *manager, |
Chris Masone | 2b10554 | 2011-06-22 10:58:09 -0700 | [diff] [blame] | 25 | const CellularRefPtr &device, |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 26 | const string &name) |
Chris Masone | 6791a43 | 2011-07-12 13:23:19 -0700 | [diff] [blame^] | 27 | : Service(control_interface, dispatcher, manager, name), |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 28 | strength_(0), |
mukesh agrawal | f60e406 | 2011-05-27 13:13:41 -0700 | [diff] [blame] | 29 | cellular_(device), |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 30 | type_(flimflam::kTypeCellular) { |
| 31 | |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 32 | store_.RegisterConstString(flimflam::kActivationStateProperty, |
| 33 | &activation_state_); |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 34 | |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 35 | store_.RegisterStringmap(flimflam::kCellularApnProperty, &apn_info_); |
| 36 | store_.RegisterConstStringmap(flimflam::kCellularLastGoodApnProperty, |
| 37 | &last_good_apn_info_); |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 38 | |
Chris Masone | 4d42df8 | 2011-07-02 17:09:39 -0700 | [diff] [blame] | 39 | store_.RegisterConstString(flimflam::kNetworkTechnologyProperty, |
| 40 | &network_tech_); |
| 41 | store_.RegisterConstString(flimflam::kOperatorNameProperty, &operator_name_); |
| 42 | store_.RegisterConstString(flimflam::kOperatorCodeProperty, &operator_code_); |
| 43 | store_.RegisterConstString(flimflam::kPaymentURLProperty, &payment_url_); |
| 44 | store_.RegisterConstString(flimflam::kRoamingStateProperty, &roaming_state_); |
| 45 | |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 46 | store_.RegisterConstUint8(flimflam::kSignalStrengthProperty, &strength_); |
Chris Masone | 27c4aa5 | 2011-07-02 13:10:14 -0700 | [diff] [blame] | 47 | store_.RegisterConstString(flimflam::kTypeProperty, &type_); |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | CellularService::~CellularService() { } |
| 51 | |
| 52 | void CellularService::Connect() { } |
| 53 | |
| 54 | void CellularService::Disconnect() { } |
| 55 | |
Chris Masone | 95207da | 2011-06-29 16:50:49 -0700 | [diff] [blame] | 56 | std::string CellularService::GetDeviceRpcId() { |
| 57 | return cellular_->GetRpcIdentifier(); |
| 58 | } |
| 59 | |
Chris Masone | 3bd3c8c | 2011-06-13 08:20:26 -0700 | [diff] [blame] | 60 | } // namespace shill |