blob: c770e911458ebdb708d50cee9eb3eabcc71b9ecc [file] [log] [blame]
Amy016b7312019-09-16 15:51:28 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "android.hardware.tv.tuner@1.0-Lnb"
18
19#include "Lnb.h"
20#include <utils/Log.h>
21
22namespace android {
23namespace hardware {
24namespace tv {
25namespace tuner {
26namespace V1_0 {
27namespace implementation {
28
29Lnb::Lnb() {}
shubangfd882512020-04-22 14:59:03 -070030Lnb::Lnb(int id) {
31 mId = id;
32}
Amy016b7312019-09-16 15:51:28 -070033
34Lnb::~Lnb() {}
35
Kensuke Miyagiafe17c52021-12-16 01:06:15 -080036Return<Result> Lnb::setCallback(const sp<ILnbCallback>& callback) {
Amy016b7312019-09-16 15:51:28 -070037 ALOGV("%s", __FUNCTION__);
38
Kensuke Miyagiafe17c52021-12-16 01:06:15 -080039 mCallback = callback;
Amy016b7312019-09-16 15:51:28 -070040 return Result::SUCCESS;
41}
42
Amyb4b68012019-10-15 17:38:19 -070043Return<Result> Lnb::setVoltage(LnbVoltage /* voltage */) {
Amy016b7312019-09-16 15:51:28 -070044 ALOGV("%s", __FUNCTION__);
45
46 return Result::SUCCESS;
47}
48
Amyb4b68012019-10-15 17:38:19 -070049Return<Result> Lnb::setTone(LnbTone /* tone */) {
50 ALOGV("%s", __FUNCTION__);
51
52 return Result::SUCCESS;
53}
54
55Return<Result> Lnb::setSatellitePosition(LnbPosition /* position */) {
Amy016b7312019-09-16 15:51:28 -070056 ALOGV("%s", __FUNCTION__);
57
58 return Result::SUCCESS;
59}
60
Kensuke Miyagiafe17c52021-12-16 01:06:15 -080061Return<Result> Lnb::sendDiseqcMessage(const hidl_vec<uint8_t>& diseqcMessage) {
Amy42a5b4b2019-10-03 16:49:48 -070062 ALOGV("%s", __FUNCTION__);
63
Kensuke Miyagiafe17c52021-12-16 01:06:15 -080064 if (mCallback != nullptr) {
65 // The correct implementation should be to return the response from the
66 // device via onDiseqcMessage(). The below implementation is only to enable
67 // testing for LnbCallbacks.
68 ALOGV("[hidl] %s - this is for test purpose only, and must be replaced!", __FUNCTION__);
69 mCallback->onDiseqcMessage(diseqcMessage);
70 }
Amy42a5b4b2019-10-03 16:49:48 -070071 return Result::SUCCESS;
72}
73
Amy016b7312019-09-16 15:51:28 -070074Return<Result> Lnb::close() {
75 ALOGV("%s", __FUNCTION__);
76
77 return Result::SUCCESS;
78}
79
shubangfd882512020-04-22 14:59:03 -070080int Lnb::getId() {
81 return mId;
82}
83
Amy016b7312019-09-16 15:51:28 -070084} // namespace implementation
85} // namespace V1_0
86} // namespace tuner
87} // namespace tv
88} // namespace hardware
shubangfd882512020-04-22 14:59:03 -070089} // namespace android