Amy | 7fb75d8 | 2019-08-09 16:25:12 -0700 | [diff] [blame] | 1 | /* |
| 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 | #ifndef ANDROID_HARDWARE_TV_TUNER_V1_0_FRONTEND_H_ |
| 18 | #define ANDROID_HARDWARE_TV_TUNER_V1_0_FRONTEND_H_ |
| 19 | |
| 20 | #include <android/hardware/tv/tuner/1.0/IFrontend.h> |
| 21 | #include <android/hardware/tv/tuner/1.0/ITuner.h> |
| 22 | |
| 23 | using namespace std; |
| 24 | |
| 25 | namespace android { |
| 26 | namespace hardware { |
| 27 | namespace tv { |
| 28 | namespace tuner { |
| 29 | namespace V1_0 { |
| 30 | namespace implementation { |
| 31 | |
| 32 | using ::android::hardware::tv::tuner::V1_0::FrontendId; |
| 33 | using ::android::hardware::tv::tuner::V1_0::FrontendType; |
| 34 | using ::android::hardware::tv::tuner::V1_0::IFrontend; |
| 35 | using ::android::hardware::tv::tuner::V1_0::IFrontendCallback; |
| 36 | using ::android::hardware::tv::tuner::V1_0::Result; |
| 37 | |
| 38 | class Frontend : public IFrontend { |
| 39 | public: |
| 40 | Frontend(); |
Amy | b9d0c8b | 2019-09-16 15:51:28 -0700 | [diff] [blame^] | 41 | |
Amy | 7fb75d8 | 2019-08-09 16:25:12 -0700 | [diff] [blame] | 42 | Frontend(FrontendType type, FrontendId id); |
| 43 | |
| 44 | virtual Return<Result> close() override; |
| 45 | |
| 46 | virtual Return<Result> setCallback(const sp<IFrontendCallback>& callback) override; |
| 47 | |
| 48 | virtual Return<Result> tune(const FrontendSettings& settings) override; |
| 49 | |
| 50 | virtual Return<Result> stopTune() override; |
| 51 | |
Amy | b9d0c8b | 2019-09-16 15:51:28 -0700 | [diff] [blame^] | 52 | virtual Return<Result> scan(const FrontendSettings& settings, FrontendScanType type) override; |
| 53 | |
| 54 | virtual Return<Result> stopScan() override; |
| 55 | |
| 56 | virtual Return<void> getStatus(const hidl_vec<FrontendStatusType>& statusTypes, |
| 57 | getStatus_cb _hidl_cb) override; |
| 58 | |
| 59 | virtual Return<Result> sendDiseqcMessage(const hidl_vec<uint8_t>& diseqcMessage) override; |
| 60 | |
| 61 | virtual Return<Result> setLna(bool bEnable) override; |
| 62 | |
| 63 | virtual Return<Result> setLnb(const sp<ILnb>& lnb) override; |
| 64 | |
Amy | 7fb75d8 | 2019-08-09 16:25:12 -0700 | [diff] [blame] | 65 | FrontendType getFrontendType(); |
| 66 | |
| 67 | FrontendId getFrontendId(); |
| 68 | |
| 69 | private: |
| 70 | virtual ~Frontend(); |
| 71 | sp<IFrontendCallback> mCallback; |
| 72 | FrontendType mType = FrontendType::UNDEFINED; |
| 73 | FrontendId mId = 0; |
| 74 | }; |
| 75 | |
| 76 | } // namespace implementation |
| 77 | } // namespace V1_0 |
| 78 | } // namespace tuner |
| 79 | } // namespace tv |
| 80 | } // namespace hardware |
| 81 | } // namespace android |
| 82 | |
| 83 | #endif // ANDROID_HARDWARE_TV_TUNER_V1_0_FRONTEND_H_ |