CRC Calculation example:
s[n] is a string containing the message
Polynomial:= 4129 (0x1021)
CRC:=0;
For Loop:=1 to Length(s) do
begin
Temp:=s[Loop];
CRC:= CRC xor (integer(Temp) * 256);
CRC:= CRC mod 65536;
for i:=7 downto 0 do
begin
if ( (CRC and 32768)=32768) then
begin
CRC:= CRC *2 ;
CRC:= CRC xor Polynomial;
end
else
begin
CRC:= CRC *2 ;
end;
CRC:=CRC mod 65536;
end;
end;
result:=CRC;
https://en.racelogic.support//Product_Info/Sensors/Single_and_Dual_Antenna_Speed_Sensors/VBOX_Speed_Sensor_User_Guide/
07_-_VBOX_Speed_Sensor_RS232%2F%2FNMEA_Output
39