| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _ANDROID_MEDIA_TV_LNB_CLIENT_H_ |
| 18 |
#define _ANDROID_MEDIA_TV_LNB_CLIENT_H_ |
| 19 |
|
| 20 |
#include <aidl/android/hardware/tv/tuner/LnbPosition.h> |
| 21 |
#include <aidl/android/hardware/tv/tuner/LnbTone.h> |
| 22 |
#include <aidl/android/hardware/tv/tuner/LnbVoltage.h> |
| 23 |
#include <aidl/android/media/tv/tuner/BnTunerLnbCallback.h> |
| 24 |
#include <aidl/android/media/tv/tuner/ITunerLnb.h> |
| 25 |
#include <utils/RefBase.h> |
| 26 |
|
| 27 |
#include "ClientHelper.h" |
| 28 |
#include "LnbClientCallback.h" |
| 29 |
|
| 30 |
using Status = ::ndk::ScopedAStatus; |
| 31 |
|
| 32 |
using ::aidl::android::hardware::tv::tuner::LnbPosition; |
| 33 |
using ::aidl::android::hardware::tv::tuner::LnbTone; |
| 34 |
using ::aidl::android::hardware::tv::tuner::LnbVoltage; |
| 35 |
using ::aidl::android::media::tv::tuner::BnTunerLnbCallback; |
| 36 |
using ::aidl::android::media::tv::tuner::ITunerLnb; |
| 37 |
|
| 38 |
using namespace std; |
| 39 |
|
| 40 |
namespace android { |
| 41 |
|
| 42 |
class TunerLnbCallback : public BnTunerLnbCallback { |
| 43 |
|
| 44 |
public: |
| 45 |
TunerLnbCallback(sp<LnbClientCallback> lnbClientCallback); |
| 46 |
|
| 47 |
Status onEvent(LnbEventType lnbEventType); |
| 48 |
Status onDiseqcMessage(const vector<uint8_t>& diseqcMessage); |
| 49 |
|
| 50 |
private: |
| 51 |
sp<LnbClientCallback> mLnbClientCallback; |
| 52 |
}; |
| 53 |
|
| 54 |
struct LnbClient : public RefBase { |
| 55 |
|
| 56 |
public: |
| 57 |
LnbClient(shared_ptr<ITunerLnb> tunerLnb); |
| 58 |
~LnbClient(); |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
Result setCallback(sp<LnbClientCallback> cb); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
Result setVoltage(LnbVoltage voltage); |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
Result setTone(LnbTone tone); |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
Result setSatellitePosition(LnbPosition position); |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
Result sendDiseqcMessage(vector<uint8_t> diseqcMessage); |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
Result close(); |
| 89 |
|
| 90 |
shared_ptr<ITunerLnb> getAidlLnb() { return mTunerLnb; } |
| 91 |
|
| 92 |
private: |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
shared_ptr<ITunerLnb> mTunerLnb; |
| 98 |
}; |
| 99 |
} |
| 100 |
|
| 101 |
#endif |