I decided to comment the part of the code which envolve the hardware and only leave the communication and here is part of the result:
From the command:
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,506,495
0,0,0,374,505,495
0,0,0,642,506,495
0,0,0,1011,506,495
0,0,0,1023,506,495
0,0,0,1023,506,495
0,0,0,1023,505,495
0,0,0,1023,506,495
0,0,0,1023,506,495
0,0,0,1023,506,495
0,0,0,987,506,495
0,0,0,842,506,495
0,0,0,736,505,495
0,0,0,627,505,495
0,0,0,487,506,495
0,0,0,421,505,495
0,0,0,421,505,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,422,506,495
0,0,0,421,505,495
0,0,0,421,505,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,421,505,495
0,0,0,421,506,495
0,0,0,422,505,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,419,505,495
0,0,0,321,505,495
0,0,0,209,505,495
0,0,0,120,505,495
0,0,0,22,505,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,506,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,506,495
0,0,0,0,505,495
From the car:
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,506,495
0,0,0,374,505,495
0,0,0,642,506,495
0,0,0,1011,506,495
0,0,0,1023,506,495
0,0,0,1023,506,495
0,0,0,1023,505,495
0,0,0,1023,506,495
0,0,0,1023,506,495
0,0,0,1023,506,495
0,0,0,987,506,495
0,0,0,842,506,495
0,0,0,736,505,495
0,0,0,627,505,495
0,0,0,487,506,495
0,0,0,421,505,495
0,0,0,421,505,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,422,506,495
0,0,0,421,505,495
0,0,0,421,505,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,421,505,495
0,0,0,421,506,495
0,0,0,422,505,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,421,506,495
0,0,0,419,505,495
0,0,0,321,505,495
0,0,0,209,505,495
0,0,0,120,505,495
0,0,0,22,505,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,506,495
0,0,0,0,505,495
0,0,0,0,505,495
0,0,0,0,506,495
0,0,0,0,505,495
As it is possible to see the signal received is completely equal to the one sent and the previous signals I haven't posted are the exact same case.
I think it has to do with the processing of the signal. Maybe by sending the acknowledge message in order to continue?