FC 05 40 -poruka 2B 15 -CRC (pise da je CCITT sa osnovom 0)
FC =const (1 bajt)
05 =ukupno bajtova koji se salje (od FC do kraja CRC) (1 bajt)
40 =komanda (1 bajt)
XX XX XX XX XX =moze biti jos nekih parametara za komande (<250 bajtova)
2B 15 =CRC (2 bajta)
To se i ja pitam kako se prave ova dva zadnja bajta :)
Citat:
The resulting CRC calculation for the character "T" is 0x1B26 or a decimal 6950. If you were going to use this computed CRC to append to a transmission you would divide the number by the Decimal number 256 and assign the result to the High Byte and the remainder to the Low Byte and then transmit the CRC Low Byte first High Byte second. In this case the Exact ASCII representation of the transmission would look like this.... "T&^[" or T&(ESC). The High Byte is an ASCII(27) which is equal to the escape key or ctrl-leftbracket (^[). The Low Byte is an ASCII(38) which is the ampersand (&).
-to sam nasao na nekom sajtu, ali kad probam to da primenim na checksum koji su mi izracunali neki sajtovi i programi (skoro svi su dali isto) nikako da dobijem ono sto treba.
Za nekoliko komandi imam primere, ali gde treba sa parametrima -fali mi CRC.