So, I wanted repurpose some old boarding gate scanners and I'm trying to make use of their commands.
Now, I have a dump from an actual boarding gate PC and I've noticed that the commands only work if I send them as they are on the dump. If I change even a single byte, the scanner rejects the command. After some Googling, I came across the term 'CRC' and now I understand why that is the case.
I played around with some CRC calculators, but the scanner seems to have its own algorithm and I have trouble figuring it out.
For instance, the command that displays a message on the scanner's display is 'AD;MG#P#ATESTMESSAGE'.
Here's an example from the dump:
02 30 80 41 44 3B 4D 47 23 50 23 41 4E 4F 54 20 .0.AD;MG#P#ANOT
49 4E 20 55 53 45 0D 42 0D FF 03 3A 12 IN USE.B...:.
I noticed that the same exact command is sent in one more way that's slightly different:
02 31 80 41 44 3B 4D 47 23 50 23 41 4E 4F 54 20 .1.AD;MG#P#ANOT
49 4E 20 55 53 45 0D 42 0D FF 03 3B 92 IN USE.B...;.
Although the message is the exact same, the difference in the command header seems to have an effect on the last two bytes.
All command headers either start with '02 30 80' or '02 31 80' depending on the response header of the scanner. Kind of like 'ping-pong' (I couldn't think of a better way to describe this).
I have tried decompiling the scanner's firmware but I can't seem to locate the method where it checks for the CRC.
Here's a few more command pairs in case they help.
Any help is greatly appreciated!
P.S: I'm a completely new to all this, in case you couldn't tell.