Most visited

Recently visited

Added in API level 19

ConsumerIrManager

public final class ConsumerIrManager
extends Object

java.lang.Object
   ↳ android.hardware.ConsumerIrManager


在设备上运行消费红外线的类。

要获得系统红外发射器的实例,请以 CONSUMER_IR_SERVICE为参数调用 Context.getSystemService()

Summary

Nested classes

class ConsumerIrManager.CarrierFrequencyRange

表示红外发射器可以在其上传输的一系列载波频率(包括)

Public methods

CarrierFrequencyRange[] getCarrierFrequencies()

查询红外发射器支持的载波频率

boolean hasIrEmitter()

检查设备是否有红外发射器。

void transmit(int carrierFrequency, int[] pattern)

发射红外图案

这种方法是同步的; 当它返回已经传输的模式时。

Inherited methods

From class java.lang.Object

Public methods

getCarrierFrequencies

Added in API level 19
CarrierFrequencyRange[] getCarrierFrequencies ()

查询红外发射器支持的载波频率

Returns
CarrierFrequencyRange[] an array of 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
boolean hasIrEmitter ()

检查设备是否有红外发射器。

Returns
boolean true if the device has an infrared emitter, else false.

transmit

Added in API level 19
void transmit (int carrierFrequency, 
                int[] pattern)

发射红外图案

这种方法是同步的; 当它返回已经传输的模式时。 只有短于2秒的模式才会被发送。

Parameters
carrierFrequency int: The IR carrier frequency in Hertz.
pattern int: The alternating on/off pattern in microseconds to transmit.

Hooray!