Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 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/wimax_service.h" |
| 6 | |
Darin Petkov | e4b2702 | 2012-05-16 13:28:50 +0200 | [diff] [blame^] | 7 | #include <base/string_util.h> |
| 8 | #include <chromeos/dbus/service_constants.h> |
| 9 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 10 | #include "shill/technology.h" |
| 11 | #include "shill/wimax.h" |
| 12 | |
Ben Chan | c07362b | 2012-05-12 10:54:11 -0700 | [diff] [blame] | 13 | using std::string; |
| 14 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 15 | namespace shill { |
| 16 | |
| 17 | WiMaxService::WiMaxService(ControlInterface *control, |
| 18 | EventDispatcher *dispatcher, |
| 19 | Metrics *metrics, |
| 20 | Manager *manager, |
| 21 | const WiMaxRefPtr &wimax) |
| 22 | : Service(control, dispatcher, metrics, manager, Technology::kWiMax), |
Darin Petkov | e4b2702 | 2012-05-16 13:28:50 +0200 | [diff] [blame^] | 23 | wimax_(wimax), |
| 24 | storage_id_( |
| 25 | StringToLowerASCII(string(flimflam::kTypeWimax) + |
| 26 | "_" + |
| 27 | wimax_->address())) {} |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 28 | |
| 29 | WiMaxService::~WiMaxService() {} |
| 30 | |
| 31 | bool WiMaxService::TechnologyIs(const Technology::Identifier type) const { |
| 32 | return type == Technology::kWiMax; |
| 33 | } |
| 34 | |
| 35 | void WiMaxService::Connect(Error *error) { |
| 36 | Service::Connect(error); |
| 37 | wimax_->Connect(error); |
| 38 | } |
| 39 | |
| 40 | void WiMaxService::Disconnect(Error *error) { |
| 41 | Service::Disconnect(error); |
| 42 | wimax_->Disconnect(error); |
| 43 | } |
| 44 | |
Ben Chan | c07362b | 2012-05-12 10:54:11 -0700 | [diff] [blame] | 45 | string WiMaxService::GetStorageIdentifier() const { |
Darin Petkov | e4b2702 | 2012-05-16 13:28:50 +0200 | [diff] [blame^] | 46 | return storage_id_; |
Ben Chan | c07362b | 2012-05-12 10:54:11 -0700 | [diff] [blame] | 47 | } |
| 48 | |
| 49 | string WiMaxService::GetDeviceRpcId(Error *error) { |
Darin Petkov | e4b2702 | 2012-05-16 13:28:50 +0200 | [diff] [blame^] | 50 | return wimax_->GetRpcIdentifier(); |
Ben Chan | c07362b | 2012-05-12 10:54:11 -0700 | [diff] [blame] | 51 | } |
| 52 | |
Ben Chan | 99c8a4d | 2012-05-01 08:11:53 -0700 | [diff] [blame] | 53 | } // namespace shill |