blob: f9f78efaeb0179fb321c040fa3b26bd161613ea9 [file] [log] [blame]
/*
* Copyright (C) 2019 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.
*/
package android.hardware.tv.tuner@1.0;
import IFrontendCallback;
import ILnb;
/**
* A Tuner Frontend is used to tune to a frequency and lock signal. It provide
* live data feed to Tuner Demux interface.
*/
interface IFrontend {
/**
* Set the callback
*
* It is used by the client to receive events from the Frontend.
* Only one callback for one Frontend instance is supported. The callback
* will be replaced if it's set again.
*
* @param callback Callback object to pass Frontend events to the system.
* The previously registered callback must be replaced with this one.
* It can be null.
* @return result Result status of the operation.
* SUCCESS if successful,
* INVALID_STATE if callback can't be set at current stage,
* UNKNOWN_ERROR if callback setting failed for other reasons.
*/
setCallback(IFrontendCallback callback) generates (Result result);
/**
* Tuning Frontend
*
* It is used by the client to lock a frequency by providing signal
* delivery information. If previous tuning isn't completed, this call must
* stop previous tuning, and start a new tuning. Tune is a async call.
* LOCKED or NO_SIGNAL eventi is sent back to caller through callback.
*
* @param settings Signal delivery information which frontend can use to
* search and lock the signal.
*
* @return result Result status of the operation.
* SUCCESS if successful,
* INVALID_STATE if tuning can't be applied at current stage,
* UNKNOWN_ERROR if tuning failed for other reasons.
*/
tune(FrontendSettings settings) generates (Result result);
/**
* Stop the tuning
*
* It is used by the client to stop a previous tuning.
*
* @return result Result status of the operation.
* SUCCESS if successfully stop tuning.
* UNKNOWN_ERROR if failed for other reasons.
*/
stopTune() generates (Result result);
/**
* Release the Frontend instance
*
* It is used by the client to release the frontend instance. HAL clear
* underneath resource. client mustn't access the instance any more.
*
* @return result Result status of the operation.
* SUCCESS if successful,
* UNKNOWN_ERROR if failed for other reasons.
*/
close() generates (Result result);
/**
* Scan the frontend to use the settings given.
*
* This uses the frontend to start a scan from signal delivery information.
* If previous scan isn't completed, this call MUST stop previous scan,
* and start a new scan.
* Scan is an async call, with FrontendScanMessage sent via callback.
*
* @param settings Signal delivery information which the frontend uses to
* scan the signal.
* @param type the type which the frontend uses to scan the signal.
*
* @return result Result status of the operation.
* SUCCESS if successful,
* INVALID_STATE if tuning can't be applied at current stage,
* UNKNOWN_ERROR if tuning failed for other reasons.
*/
scan(FrontendSettings settings, FrontendScanType type) generates (Result result);
/**
* Stops a previous scanning.
*
* If the method completes successfully, the frontend stop previous
* scanning.
*
* @return result Result status of the operation.
* SUCCESS if successfully stop tuning.
* UNKNOWN_ERROR if failed for other reasons.
*/
stopScan() generates (Result result);
/**
* Gets the statuses of the frontend.
*
* This retrieve the statuses of the frontend for given status types.
*
* @param statusTypes an array of status type which the caller request.
*
* @return result Result status of the operation.
* SUCCESS if successful,
* INVALID_STATE if tuning can't be applied at current stage,
* UNKNOWN_ERROR if tuning failed for other reasons.
* @return statuses an array of statuses which response the caller's
* request.
*/
getStatus(vec<FrontendStatusType> statusTypes) generates (Result result, vec<FrontendStatus> statuses);
/**
* Sets Low-Noise Block downconverter (LNB) for satellite frontend.
*
* This assigns a hardware LNB resource to the satellite frontend. It can be
* called multiple times to update LNB assignment. The LNB resource must be
* released when the frontend is closed.
*
* @param lnbId the Id of assigned LNB resource.
*
* @return result Result status of the operation.
* SUCCESS if successful,
* INVALID_STATE if the frontend can't be set with a LNB, such as
* cable frontend.
* UNKNOWN_ERROR if failed for other reasons.
*/
setLnb(ILnb lnb) generates (Result result);
/**
* Enble or Disable Low Noise Amplifier (LNA).
*
* @param bEnable true if activate LNA module; false if deactivate LNA
*
* @return result Result status of the operation.
* SUCCESS if successful,
* INVALID_STATE if the frontend doesn't support LNA.
* UNKNOWN_ERROR if failed for other reasons.
*/
setLna(bool bEnable) generates (Result result);
/**
* Sends DiSEqC (Digital Satellite Equipment Control) message.
*
* Client sends DiSeqc message to DiSEqc compatible device through the
* frontend. The response message from the device comes back to the client
* through frontend's callback onDiseqcMessage.
*
* @param diseqcMessage a byte array of data for DiSEqC message which is
* specified by EUTELSAT Bus Functional Specification Version 4.2.
*
* @return result Result status of the operation.
* SUCCESS if successful,
* INVALID_STATE if the frontend can't send DiSEqc Message, such as
* cable frontend.
* UNKNOWN_ERROR if failed for other reasons.
*/
sendDiseqcMessage(vec<uint8_t> diseqcMessage) generates (Result result);
};