1 /*
2  * Copyright (C) 2021 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  */
16 
17 package android.hardware.ir;
18 
19 import android.hardware.ir.ConsumerIrFreqRange;
20 
21 @VintfStability
22 interface IConsumerIr {
23     /**
24      * Enumerates which frequencies the IR transmitter supports.
25      *
26      * @return - an array of all supported frequency ranges.
27      */
getCarrierFreqs()28     ConsumerIrFreqRange[] getCarrierFreqs();
29 
30     /**
31      * Sends an IR pattern at a given frequency in HZ.
32      * This call must return when the transmit is complete or encounters an error.
33      *
34      * @param carrierFreq - Frequency of the transmission in HZ.
35      *
36      * @param pattern - Alternating series of on and off periods measured in
37      * microseconds. The carrier should be turned off at the end of a transmit
38      * even if there are an odd number of entries in the pattern array.
39      *
40      * @throws EX_UNSUPPORTED_OPERATION when the frequency is not supported.
41      */
transmit(in int carrierFreqHz, in int[] pattern)42     void transmit(in int carrierFreqHz, in int[] pattern);
43 }
44