public final class ConsumerIrManager extends Object
To obtain an instance of the system infrared transmitter, call
Context.getSystemService()
with
Context.CONSUMER_IR_SERVICE
as the argument.
Modifier and Type | Class and Description |
---|---|
class |
ConsumerIrManager.CarrierFrequencyRange
Represents a range of carrier frequencies (inclusive) on which the
infrared transmitter can transmit
|
Constructor and Description |
---|
ConsumerIrManager(Context context) |
Modifier and Type | Method and Description |
---|---|
ConsumerIrManager.CarrierFrequencyRange[] |
getCarrierFrequencies()
Query the infrared transmitter's supported carrier frequencies
|
boolean |
hasIrEmitter()
Check whether the device has an infrared emitter.
|
void |
transmit(int carrierFrequency,
int[] pattern)
Transmit an infrared pattern
This method is synchronous; when it returns the pattern has
been transmitted.
|
public ConsumerIrManager(Context context)
public boolean hasIrEmitter()
public void transmit(int carrierFrequency, int[] pattern)
This method is synchronous; when it returns the pattern has been transmitted. Only patterns shorter than 2 seconds will be transmitted.
carrierFrequency
- The IR carrier frequency in Hertz.pattern
- The alternating on/off pattern in microseconds to transmit.public ConsumerIrManager.CarrierFrequencyRange[] getCarrierFrequencies()
ConsumerIrManager.CarrierFrequencyRange
objects representing the ranges that the transmitter can support, or
null if there was an error communicating with the Consumer IR Service.