I want to try to open my (old) car (who have an IR receptor) with a simple app.
On the electronic board in the key I have a paper with a code (Exemple : 06495 167.5 ) I think that the code in this exemple is only 06495, based on this source : http://farancullas.blogspot.fr/2012/10/recodificacion-receptor-infrarojo.html
On android you have to send a HEX code converted to dec ? This is a part of my code (working because no exeption, and blue led on my note 3).
I Just need some help to proper format the IR_CODE variable. I can send any string it seems to work because the led is flashing. Have you and idea to format this code ? I think It's something like hex2dec("195F") ? 195F is 6495 in hex
It can be : IR_CODE=hex2dec(Integer.toHexString(Integer.decode(IR_CODE))); Based on this source : https://github.com/rngtng/IrDude/blob/master/src/com/rngtng/irdude/MainActivity.java , but I'm not sure, and I can't test the app too much.
String IR_CODE="06495";
Class irClass = irService.getClass();
Class params[] = new Class[1];
params[0] = String.class;
try {
Method sendIR = irClass.getMethod("write_irsend", params);
for(int i=0;i<2;i++)
sendIR.invoke(irService, IR_CODE);
}
Can you help me to format IR_CODE ? Thank you !