Your Universal Remote Control Center
RemoteCentral.com
Discrete Code Hunter Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 3 made on Thursday March 5, 2020 at 11:40
theremoteman
Junior Member
Joined:
Posts:
January 2020
18
I understand.

So, after reading some in google and trying to understand the protocols and the way android sends IR codes ([Link: developer.android.com]))

Let's try to send this code (this is a code for skyQ remote that someone postd on this forum):
0000 0073 0000 001E 0060 0020 0010 0010 0010 0010 0010 0020 0010 0020 0020 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0020 0020 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0020 0010 0010 0020 0020 0020 0020 0020 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0E10

I first grab the frequency. because of the '0000' at the start I know it is denotes a raw IR signal with modulation.
now, '0073' is the frequency, so lets extract it out of it like so:
frequency = Integer.parseInt("0073", 16);
frequency = (int) (1000000 / (frequency * 0.241246));

so freq is: 36044

then I generate the new pronto hex:
1. first convert all the values from the forth element (0060) from hexadecimal to decimal:
96 32 16 16 16 16 16 32 16 32 ...

2. next, I run this method on the values I got [96 32 16 16 16 16 16 32 16 32 ...] :
cycles = [96 32 16 16 16 16 16 32 16 32 ...]
int[] intervals = new int[cycles.length];
int k = 1000000 / frequency;
for (int i = 0; i < intervals.length; i++) {
intervals[i] = cycles[i] * k;
}
return intervals

3. which gives me now the new values:
2592 864 432 432 432 432 432 864 432 864 864 432 432 432 ...

so I finally sends the new pronto hex above with the freq of 36044
transmit (36044, [2592 864 432 432 432 432 432 864 432 864 864 432 432 432 ...])
by android API, the array I send should be pattern in microseconds to transmit.

IS IT OK? SHOULD IT WORK?

and, for the other IR code, this one:
9000 4500 560 565 560 1690 560 565 560 565 560 1690 560 1690 560 1690 560 565 560 1690 560 565 560 1690 560 1690 560 1690 560 565 560 1690 560 1690 560 565 560 1690 560 1690 560 1690 560 565 560 565 560 565 560 565 560 1690 560 565 560 565 560 565 560 1690 560 1690 560 1690 560 1690 560

I don't do this algorithm because the frequency turns to be 536 which is wrong.
so, I send this code with frequency of 38KHz, and do you think I need to also change the pronto code or I can send it as is through the android consumerIrManager as is, like so:
transmit (38000, [9000 4500 560 565 560 1690 560 565 560 565 560 1690 ...])


Hosting Services by ipHouse