blob: c9f9f849df2f7158e3e20309744f223aa1f2f5ee [file] [log] [blame]
Amy Zhangb0f63ab2021-01-06 17:19:27 -08001/*
2 * Copyright 2021 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 "LnbClient"
18
19#include <android-base/logging.h>
20#include <utils/Log.h>
21
22#include "LnbClient.h"
23
24using ::android::hardware::tv::tuner::V1_0::Result;
25
26namespace android {
27
28/////////////// LnbClient ///////////////////////
29
30// TODO: pending aidl interface
31LnbClient::LnbClient() {
32 //mTunerLnb = tunerLnb;
33}
34
35LnbClient::~LnbClient() {
36 //mTunerLnb = NULL;
37 mLnb = NULL;
38}
39
40// TODO: remove after migration to Tuner Service is done.
41void LnbClient::setHidlLnb(sp<ILnb> lnb) {
42 mLnb = lnb;
43}
44
45Result LnbClient::setCallback(sp<LnbClientCallback> /*cb*/) {
46 return Result::SUCCESS;
47}
48
49Result LnbClient::setVoltage(int /*voltage*/) {
50 return Result::SUCCESS;
51}
52
53Result LnbClient::setTone(int /*tone*/) {
54 return Result::SUCCESS;
55}
56
57Result LnbClient::setSatellitePosition(int /*position*/) {
58 return Result::SUCCESS;
59}
60
61Result LnbClient::sendDiseqcMessage(vector<uint8_t> /*diseqcMessage*/) {
62 return Result::SUCCESS;
63}
64
65Result LnbClient::close() {
66 return Result::SUCCESS;
67}
68
69/////////////// ILnbCallback ///////////////////////
70
71HidlLnbCallback::HidlLnbCallback(sp<LnbClientCallback> lnbClientCallback)
72 : mLnbClientCallback(lnbClientCallback) {}
73
74Return<void> HidlLnbCallback::onEvent(const LnbEventType lnbEventType) {
75 if (mLnbClientCallback != NULL) {
76 mLnbClientCallback->onEvent(lnbEventType);
77 }
78 return Void();
79}
80
81Return<void> HidlLnbCallback::onDiseqcMessage(const hidl_vec<uint8_t>& diseqcMessage) {
82 if (mLnbClientCallback != NULL) {
83 mLnbClientCallback->onDiseqcMessage(diseqcMessage);
84 }
85 return Void();
86}
87
88/////////////// LnbClient Helper Methods ///////////////////////
89
90} // namespace android