battlecore::infrared

The infrared module configures the infrared encoding used by the device — the encoding style, timing tolerances, mark and space durations, and the lead-in — and installs or uninstalls the infrared handling. Include its declarations with include "./battlecore/infrared.bst";.

setEncodingStyle

Sets the infrared encoding style. Use a value from the IrEncodingStyle enum documented below. Returns whether the operation succeeded.

native bool battlecore::infrared.setEncodingStyle (int newVal);

setTolerance

Sets the timing tolerance. Returns whether the operation succeeded.

native bool battlecore::infrared.setTolerance (int newVal);

setMarkDuration

Sets the mark durations for a zero bit and a one bit. Returns whether the operation succeeded.

native bool battlecore::infrared.setMarkDuration (int zeroDuration, int oneDuration);

setSpaceDuration

Sets the space durations for a zero bit and a one bit. Returns whether the operation succeeded.

native bool battlecore::infrared.setSpaceDuration (int zeroDuration, int oneDuration);

setLeadIn

Sets the lead-in mark and space durations. Returns whether the operation succeeded.

native bool battlecore::infrared.setLeadIn (int markDuration, int spaceDuration);

install

Installs the infrared handling. Returns whether the operation succeeded.

native bool battlecore::infrared.install ();

uninstall

Uninstalls the infrared handling. Returns whether the operation succeeded.

native bool battlecore::infrared.uninstall ();

IrEncodingStyle enum

The encoding style values accepted by setEncodingStyle.

enum IrEncodingStyle {
	UNKNOWN = 0,
	PULSE_WIDTH = 1,
	PULSE_DISTANCE = 2,
	MANCHESTER = 3
}