ConsumerIrManager

class ConsumerIrManager
kotlin.Any
   ↳ android.hardware.ConsumerIrManager

Class that operates consumer infrared on the device.
Requires the PackageManager#FEATURE_CONSUMER_IR feature which can be detected using PackageManager.hasSystemFeature(String).
Requires API level 19 (Android 4.4, KitKat)

Summary

Nested classes

Represents a range of carrier frequencies (inclusive) on which the infrared transmitter can transmit
Requires API level 19 (Android 4.4, KitKat)

Public methods
Unit
transmit(carrierFrequency: Int, pattern: IntArray!)

Transmit an infrared pattern

Array<ConsumerIrManager.CarrierFrequencyRange!>!

Query the infrared transmitter's supported carrier frequencies
Requires API level 19 (Android 4.4, KitKat)

Boolean

Check whether the device has an infrared emitter.

Public methods

transmit

added in API level 19
fun transmit(carrierFrequency: Int, pattern: IntArray!): Unit

Transmit an infrared pattern

This method is synchronous; when it returns the pattern has been transmitted. Only patterns shorter than 2 seconds will be transmitted.


Requires API level 19 (Android 4.4, KitKat)
Parameters
carrierFrequency Int: The IR carrier frequency in Hertz.
pattern Int: The alternating on/off pattern in microseconds to transmit.

getCarrierFrequencies

added in API level 19
fun getCarrierFrequencies(): Array<ConsumerIrManager.CarrierFrequencyRange!>!

Query the infrared transmitter's supported carrier frequencies
Requires API level 19 (Android 4.4, KitKat)

Return
Array<ConsumerIrManager.CarrierFrequencyRange!>!: an array of android.hardware.ConsumerIrManager.CarrierFrequencyRange objects representing the ranges that the transmitter can support, or null if there was an error communicating with the Consumer IR Service.

hasIrEmitter

added in API level 19
fun hasIrEmitter(): Boolean

Check whether the device has an infrared emitter.
Requires API level 19 (Android 4.4, KitKat)

Return
Boolean: true if the device has an infrared emitter, else false.