2019-08-02 01:28:33 +02:00
|
|
|
/*
|
|
|
|
* 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;
|
2019-09-16 22:19:53 +02:00
|
|
|
import ILnb;
|
2019-08-02 01:28:33 +02:00
|
|
|
|
|
|
|
/**
|
2019-08-16 21:11:19 +02:00
|
|
|
* A Tuner Frontend is used to tune to a frequency and lock signal.
|
|
|
|
*
|
|
|
|
* IFrontend provides a bit stream to the Tuner Demux interface.
|
2019-08-02 01:28:33 +02:00
|
|
|
*/
|
|
|
|
interface IFrontend {
|
|
|
|
/**
|
2019-08-16 21:11:19 +02:00
|
|
|
* Set the frontend callback.
|
2019-08-02 01:28:33 +02:00
|
|
|
*
|
2019-08-16 21:11:19 +02:00
|
|
|
* IFrontendCallback is used by the client to receive events from the Frontend.
|
|
|
|
* Only one callback per IFrontend instance is supported. The callback
|
2019-08-02 01:28:33 +02:00
|
|
|
* 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);
|
|
|
|
|
|
|
|
/**
|
2019-08-16 21:11:19 +02:00
|
|
|
* Tunes the frontend to using the settings given.
|
2019-08-02 01:28:33 +02:00
|
|
|
*
|
2019-08-16 21:11:19 +02:00
|
|
|
* This locks the frontend to 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 an async call, with LOCKED or NO_SIGNAL events sent via callback.
|
2019-08-02 01:28:33 +02:00
|
|
|
*
|
2019-08-16 21:11:19 +02:00
|
|
|
* @param settings Signal delivery information the frontend uses to
|
2019-08-02 01:28:33 +02:00
|
|
|
* 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);
|
|
|
|
|
|
|
|
/**
|
2019-08-16 21:11:19 +02:00
|
|
|
* Stops a previous tuning.
|
2019-08-02 01:28:33 +02:00
|
|
|
*
|
2019-08-16 21:11:19 +02:00
|
|
|
* If the method completes successfully the frontend is no longer tuned and no data
|
|
|
|
* will be sent to attached demuxes.
|
2019-08-02 01:28:33 +02:00
|
|
|
*
|
|
|
|
* @return result Result status of the operation.
|
|
|
|
* SUCCESS if successfully stop tuning.
|
|
|
|
* UNKNOWN_ERROR if failed for other reasons.
|
|
|
|
*/
|
|
|
|
stopTune() generates (Result result);
|
|
|
|
|
|
|
|
/**
|
2019-08-16 21:11:19 +02:00
|
|
|
* Releases the Frontend instance
|
2019-08-02 01:28:33 +02:00
|
|
|
*
|
2019-08-16 21:11:19 +02:00
|
|
|
* Associated resources are released. close may be called more than once.
|
|
|
|
* Calls to any other method after this will return an error
|
2019-08-02 01:28:33 +02:00
|
|
|
*
|
|
|
|
* @return result Result status of the operation.
|
|
|
|
* SUCCESS if successful,
|
|
|
|
* UNKNOWN_ERROR if failed for other reasons.
|
|
|
|
*/
|
|
|
|
close() generates (Result result);
|
2019-09-16 22:19:53 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
2019-08-02 01:28:33 +02:00
|
|
|
};
|