blob: 5070519dcb1cd607b83c260e379e9c01918c3d72 [file] [log] [blame]
Henry Fang0d5c8da2019-09-16 13:19:53 -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 */
Henry Fange5125a82019-10-14 13:49:21 -070016
Henry Fang0d5c8da2019-09-16 13:19:53 -070017package android.hardware.tv.tuner@1.0;
18
Henry Fange5125a82019-10-14 13:49:21 -070019import ILnbCallback;
20
Henry Fang0d5c8da2019-09-16 13:19:53 -070021/**
22 * A Tuner LNB (low-noise block downconverter) is used by satellite frontend
23 * to receive the microwave signal from the satellite, amplify it, and
24 * downconvert the frequency to a lower frequency.
25 */
26interface ILnb {
27 /**
Henry Fange5125a82019-10-14 13:49:21 -070028 * Set the lnb callback.
29 *
30 * ILnbCallback is used by the client to receive events from the Lnb.
31 * Only one callback per ILnb instance is supported. The callback
32 * will be replaced if it's set again.
33 *
34 * @param callback Callback object to pass Lnb events to the system.
35 * The previously registered callback must be replaced with this one.
36 * It can be null.
37 * @return result Result status of the operation.
38 * SUCCESS if successful,
39 * INVALID_STATE if callback can't be set at current stage,
40 * UNKNOWN_ERROR if callback setting failed for other reasons.
41 */
42 setCallback(ILnbCallback callback) generates (Result result);
43
44 /**
Henry Fang0d5c8da2019-09-16 13:19:53 -070045 * Set the lnb's power voltage.
46 *
47 * @param voltage the power's voltage the Lnb to use.
48 * @return result Result status of the operation.
49 * SUCCESS if successful,
50 * INVALID_ARGUMENT if the selected voltage isn't allowed,
51 * UNKNOWN_ERROR if failed for other reasons.
52 */
Henry Fange5125a82019-10-14 13:49:21 -070053 setVoltage(LnbVoltage voltage) generates (Result result);
Henry Fang0d5c8da2019-09-16 13:19:53 -070054
55 /**
56 * Set the lnb's tone mode.
57 *
58 * @param tone the tone mode the Lnb to use.
59 * @return result Result status of the operation.
60 * SUCCESS if successful,
61 * INVALID_ARGUMENT if the selected tone mode isn't allowed,
62 * UNKNOWN_ERROR if failed for other reasons.
63 */
Henry Fange5125a82019-10-14 13:49:21 -070064 setTone(LnbTone tone) generates (Result result);
Henry Fang0d5c8da2019-09-16 13:19:53 -070065
66 /**
67 * Select the lnb's position.
68 *
69 * @param position the position the Lnb to use.
70 * @return result Result status of the operation.
71 * SUCCESS if successful,
72 * INVALID_ARGUMENT if the selected position isn't allowed,
73 * UNKNOWN_ERROR if failed for other reasons.
74 */
Henry Fange5125a82019-10-14 13:49:21 -070075 setSatellitePosition(LnbPosition position) generates (Result result);
Henry Fang0d5c8da2019-09-16 13:19:53 -070076
77 /**
Henry Fang859ec122019-10-02 18:42:57 -070078 * Sends DiSEqC (Digital Satellite Equipment Control) message.
79 *
80 * Client sends DiSeqc message to DiSEqc to LNB. The response message from
81 * the device comes back to the client through frontend's callback
82 * onDiseqcMessage.
83 *
84 * @param diseqcMessage a byte array of data for DiSEqC message which is
85 * specified by EUTELSAT Bus Functional Specification Version 4.2.
86 *
87 * @return result Result status of the operation.
88 * SUCCESS if successful,
89 * INVALID_STATE if the frontend can't send DiSEqc Message, such as
90 * cable frontend.
91 * UNKNOWN_ERROR if failed for other reasons.
92 */
93 sendDiseqcMessage(vec<uint8_t> diseqcMessage) generates (Result result);
94
95 /**
Henry Fang0d5c8da2019-09-16 13:19:53 -070096 * Releases the LNB instance
97 *
98 * Associated resources are released. close may be called more than once.
99 * Calls to any other method after this will return an error
100 *
101 * @return result Result status of the operation.
102 * SUCCESS if successful,
103 * UNKNOWN_ERROR if failed for other reasons.
104 */
105 close() generates (Result result);
106};