blob: 3d08b655c519a67248c92188a2f70aa3acc977a0 [file] [log] [blame]
Ben Chan99c8a4d2012-05-01 08:11:53 -07001// 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 Petkove4b27022012-05-16 13:28:50 +02007#include <base/string_util.h>
8#include <chromeos/dbus/service_constants.h>
9
Ben Chan99c8a4d2012-05-01 08:11:53 -070010#include "shill/technology.h"
11#include "shill/wimax.h"
12
Ben Chanc07362b2012-05-12 10:54:11 -070013using std::string;
14
Ben Chan99c8a4d2012-05-01 08:11:53 -070015namespace shill {
16
17WiMaxService::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 Petkove4b27022012-05-16 13:28:50 +020023 wimax_(wimax),
24 storage_id_(
25 StringToLowerASCII(string(flimflam::kTypeWimax) +
26 "_" +
27 wimax_->address())) {}
Ben Chan99c8a4d2012-05-01 08:11:53 -070028
29WiMaxService::~WiMaxService() {}
30
31bool WiMaxService::TechnologyIs(const Technology::Identifier type) const {
32 return type == Technology::kWiMax;
33}
34
35void WiMaxService::Connect(Error *error) {
36 Service::Connect(error);
37 wimax_->Connect(error);
38}
39
40void WiMaxService::Disconnect(Error *error) {
41 Service::Disconnect(error);
42 wimax_->Disconnect(error);
43}
44
Ben Chanc07362b2012-05-12 10:54:11 -070045string WiMaxService::GetStorageIdentifier() const {
Darin Petkove4b27022012-05-16 13:28:50 +020046 return storage_id_;
Ben Chanc07362b2012-05-12 10:54:11 -070047}
48
49string WiMaxService::GetDeviceRpcId(Error *error) {
Darin Petkove4b27022012-05-16 13:28:50 +020050 return wimax_->GetRpcIdentifier();
Ben Chanc07362b2012-05-12 10:54:11 -070051}
52
Ben Chan99c8a4d2012-05-01 08:11:53 -070053} // namespace shill