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, |
| 24 | Cellular *device, |
| 25 | const string &name) |
| 26 | : Service(control_interface, dispatcher, device, name), |
| 27 | cellular_(device), |
| 28 | strength_(0), |
| 29 | type_(flimflam::kTypeCellular) { |
| 30 | |
| 31 | RegisterConstString(flimflam::kActivationStateProperty, &activation_state_); |
| 32 | RegisterConstString(flimflam::kOperatorNameProperty, &operator_name_); |
| 33 | RegisterConstString(flimflam::kOperatorCodeProperty, &operator_code_); |
| 34 | RegisterConstString(flimflam::kNetworkTechnologyProperty, &network_tech_); |
| 35 | RegisterConstString(flimflam::kRoamingStateProperty, &roaming_state_); |
| 36 | RegisterConstString(flimflam::kPaymentURLProperty, &payment_url_); |
| 37 | |
| 38 | RegisterStringmap(flimflam::kCellularApnProperty, &apn_info_); |
| 39 | RegisterConstStringmap(flimflam::kCellularLastGoodApnProperty, |
| 40 | &last_good_apn_info_); |
| 41 | |
| 42 | RegisterConstUint8(flimflam::kSignalStrengthProperty, &strength_); |
| 43 | // RegisterDerivedString(flimflam::kStateProperty, |
| 44 | // &Service::CalculateState, |
| 45 | // NULL); |
| 46 | RegisterConstString(flimflam::kTypeProperty, &type_); |
| 47 | } |
| 48 | |
| 49 | CellularService::~CellularService() { } |
| 50 | |
| 51 | void CellularService::Connect() { } |
| 52 | |
| 53 | void CellularService::Disconnect() { } |
| 54 | |
| 55 | bool CellularService::Contains(const string &property) { |
| 56 | return (Service::Contains(property) || |
| 57 | uint8_properties_.find(property) != uint8_properties_.end() || |
| 58 | stringmap_properties_.find(property) != stringmap_properties_.end()); |
| 59 | } |
| 60 | |
| 61 | } // namespace shill |