/** * Copyright 2021, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_MEDIA_TUNERFLNB_H #define ANDROID_MEDIA_TUNERFLNB_H #include #include #include #include #include using Status = ::ndk::ScopedAStatus; using ::aidl::android::media::tv::tuner::BnTunerLnb; using ::aidl::android::media::tv::tuner::ITunerLnbCallback; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; using ::android::hardware::tv::tuner::V1_0::ILnb; using ::android::hardware::tv::tuner::V1_0::ILnbCallback; using ::android::hardware::tv::tuner::V1_0::LnbEventType; using namespace std; namespace android { class TunerLnb : public BnTunerLnb { public: TunerLnb(sp lnb, int id); virtual ~TunerLnb(); Status setCallback(const shared_ptr& tunerLnbCallback) override; Status setVoltage(int voltage) override; Status setTone(int tone) override; Status setSatellitePosition(int position) override; Status sendDiseqcMessage(const vector& diseqcMessage) override; Status close() override; int getId() { return mId; } struct LnbCallback : public ILnbCallback { LnbCallback(const shared_ptr tunerLnbCallback) : mTunerLnbCallback(tunerLnbCallback) {}; virtual Return onEvent(const LnbEventType lnbEventType); virtual Return onDiseqcMessage(const hidl_vec& diseqcMessage); shared_ptr mTunerLnbCallback; }; private: int mId; sp mLnb; }; } // namespace android #endif // ANDROID_MEDIA_TUNERFLNB_H