blob: 756ab4650ee931a0f4516f679bf2ec2e5f4b3b36 [file] [log] [blame]
Henry Fangbca165e2019-08-01 16:28:33 -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 Fangbca165e2019-08-01 16:28:33 -070017package android.hardware.tv.tuner@1.0;
18
19import IFrontendCallback;
Henry Fang0d5c8da2019-09-16 13:19:53 -070020import ILnb;
Henry Fangbca165e2019-08-01 16:28:33 -070021
22/**
Nick Chalko7d6690e2019-08-16 12:11:19 -070023 * A Tuner Frontend is used to tune to a frequency and lock signal.
24 *
25 * IFrontend provides a bit stream to the Tuner Demux interface.
Henry Fangbca165e2019-08-01 16:28:33 -070026 */
27interface IFrontend {
28 /**
Nick Chalko7d6690e2019-08-16 12:11:19 -070029 * Set the frontend callback.
Henry Fangbca165e2019-08-01 16:28:33 -070030 *
Nick Chalko7d6690e2019-08-16 12:11:19 -070031 * IFrontendCallback is used by the client to receive events from the Frontend.
32 * Only one callback per IFrontend instance is supported. The callback
Henry Fangbca165e2019-08-01 16:28:33 -070033 * will be replaced if it's set again.
34 *
35 * @param callback Callback object to pass Frontend events to the system.
36 * The previously registered callback must be replaced with this one.
37 * It can be null.
38 * @return result Result status of the operation.
39 * SUCCESS if successful,
40 * INVALID_STATE if callback can't be set at current stage,
41 * UNKNOWN_ERROR if callback setting failed for other reasons.
42 */
43 setCallback(IFrontendCallback callback) generates (Result result);
44
45 /**
Nick Chalko7d6690e2019-08-16 12:11:19 -070046 * Tunes the frontend to using the settings given.
Henry Fangbca165e2019-08-01 16:28:33 -070047 *
Nick Chalko7d6690e2019-08-16 12:11:19 -070048 * This locks the frontend to a frequency by providing signal
49 * delivery information. If previous tuning isn't completed, this call MUST
50 * stop previous tuning, and start a new tuning.
51 * Tune is an async call, with LOCKED or NO_SIGNAL events sent via callback.
Henry Fangbca165e2019-08-01 16:28:33 -070052 *
Nick Chalko7d6690e2019-08-16 12:11:19 -070053 * @param settings Signal delivery information the frontend uses to
Henry Fangbca165e2019-08-01 16:28:33 -070054 * search and lock the signal.
55 *
56 * @return result Result status of the operation.
57 * SUCCESS if successful,
58 * INVALID_STATE if tuning can't be applied at current stage,
59 * UNKNOWN_ERROR if tuning failed for other reasons.
60 */
61 tune(FrontendSettings settings) generates (Result result);
62
63 /**
Nick Chalko7d6690e2019-08-16 12:11:19 -070064 * Stops a previous tuning.
Henry Fangbca165e2019-08-01 16:28:33 -070065 *
Nick Chalko7d6690e2019-08-16 12:11:19 -070066 * If the method completes successfully the frontend is no longer tuned and no data
67 * will be sent to attached demuxes.
Henry Fangbca165e2019-08-01 16:28:33 -070068 *
69 * @return result Result status of the operation.
70 * SUCCESS if successfully stop tuning.
71 * UNKNOWN_ERROR if failed for other reasons.
72 */
73 stopTune() generates (Result result);
74
75 /**
Nick Chalko7d6690e2019-08-16 12:11:19 -070076 * Releases the Frontend instance
Henry Fangbca165e2019-08-01 16:28:33 -070077 *
Nick Chalko7d6690e2019-08-16 12:11:19 -070078 * Associated resources are released. close may be called more than once.
79 * Calls to any other method after this will return an error
Henry Fangbca165e2019-08-01 16:28:33 -070080 *
81 * @return result Result status of the operation.
82 * SUCCESS if successful,
83 * UNKNOWN_ERROR if failed for other reasons.
84 */
85 close() generates (Result result);
Henry Fang0d5c8da2019-09-16 13:19:53 -070086
87 /**
88 * Scan the frontend to use the settings given.
89 *
90 * This uses the frontend to start a scan from signal delivery information.
91 * If previous scan isn't completed, this call MUST stop previous scan,
92 * and start a new scan.
93 * Scan is an async call, with FrontendScanMessage sent via callback.
94 *
95 * @param settings Signal delivery information which the frontend uses to
96 * scan the signal.
97 * @param type the type which the frontend uses to scan the signal.
98 *
99 * @return result Result status of the operation.
100 * SUCCESS if successful,
101 * INVALID_STATE if tuning can't be applied at current stage,
102 * UNKNOWN_ERROR if tuning failed for other reasons.
103 */
104 scan(FrontendSettings settings, FrontendScanType type) generates (Result result);
105
106 /**
107 * Stops a previous scanning.
108 *
109 * If the method completes successfully, the frontend stop previous
110 * scanning.
111 *
112 * @return result Result status of the operation.
113 * SUCCESS if successfully stop tuning.
114 * UNKNOWN_ERROR if failed for other reasons.
115 */
116 stopScan() generates (Result result);
117
118 /**
119 * Gets the statuses of the frontend.
120 *
121 * This retrieve the statuses of the frontend for given status types.
122 *
123 * @param statusTypes an array of status type which the caller request.
124 *
125 * @return result Result status of the operation.
126 * SUCCESS if successful,
127 * INVALID_STATE if tuning can't be applied at current stage,
128 * UNKNOWN_ERROR if tuning failed for other reasons.
129 * @return statuses an array of statuses which response the caller's
130 * request.
131 */
Henry Fange5125a82019-10-14 13:49:21 -0700132 getStatus(vec<FrontendStatusType> statusTypes)
133 generates (Result result, vec<FrontendStatus> statuses);
Henry Fang0d5c8da2019-09-16 13:19:53 -0700134
135 /**
136 * Sets Low-Noise Block downconverter (LNB) for satellite frontend.
137 *
138 * This assigns a hardware LNB resource to the satellite frontend. It can be
139 * called multiple times to update LNB assignment. The LNB resource must be
140 * released when the frontend is closed.
141 *
142 * @param lnbId the Id of assigned LNB resource.
143 *
144 * @return result Result status of the operation.
145 * SUCCESS if successful,
146 * INVALID_STATE if the frontend can't be set with a LNB, such as
147 * cable frontend.
148 * UNKNOWN_ERROR if failed for other reasons.
149 */
Henry Fang859ec122019-10-02 18:42:57 -0700150 setLnb(LnbId lnbId) generates (Result result);
Henry Fang0d5c8da2019-09-16 13:19:53 -0700151
152 /**
Nick Chalkoe36b09b2019-10-04 17:06:40 -0700153 * Enable or Disable Low Noise Amplifier (LNA).
Henry Fang0d5c8da2019-09-16 13:19:53 -0700154 *
155 * @param bEnable true if activate LNA module; false if deactivate LNA
156 *
157 * @return result Result status of the operation.
158 * SUCCESS if successful,
159 * INVALID_STATE if the frontend doesn't support LNA.
160 * UNKNOWN_ERROR if failed for other reasons.
161 */
162 setLna(bool bEnable) generates (Result result);
Henry Fangbca165e2019-08-01 16:28:33 -0700163};