public void onClick(View v) { StringBuilder b = new StringBuilder(); if (!mCIR.hasIrEmitter()) { mFreqsText.setText("No IR Emitter found!"); Log.e(TAG, "No IR Emitter found!\n"); return; } // Get the available carrier frequency ranges ConsumerIrManager.CarrierFrequencyRange[] freqs = mCIR.getCarrierFrequencies(); b.append("IR Carrier Frequencies:\n"); for (ConsumerIrManager.CarrierFrequencyRange range : freqs) { b.append( String.format(" %d - %d\n", range.getMinFrequency(), range.getMaxFrequency())); } mFreqsText.setText(b.toString()); }
public void onClick(View v) { if (!mCIR.hasIrEmitter()) { Log.e(TAG, "No IR Emitter found\n"); return; } // A pattern of alternating series of carrier on and off periods measured in // microseconds. int[] pattern = { 1901, 4453, 625, 1614, 625, 1588, 625, 1614, 625, 442, 625, 442, 625, 468, 625, 442, 625, 494, 572, 1614, 625, 1588, 625, 1614, 625, 494, 572, 442, 651, 442, 625, 442, 625, 442, 625, 1614, 625, 1588, 651, 1588, 625, 442, 625, 494, 598, 442, 625, 442, 625, 520, 572, 442, 625, 442, 625, 442, 651, 1588, 625, 1614, 625, 1588, 625, 1614, 625, 1588, 625, 48958 }; // transmit the pattern at 38.4KHz mCIR.transmit(38400, pattern); }