Does anyone have Delphi code to calculate X.25 Frame Check Sequence (CRC-CCITT)?
Posted on 2001-07-10
Please can anyone help with some nice Delphi code that will calculate the X.25 Frame Check Sequence?
I am trying to receive and send X.25 packets from Windows 2000 via an ISDN line, without a PAD. I am trying to create the X.25 packets myself. I can get the SABM and DISC packets into a memo box, using APRO component TApdcom. However, next I need to send a UA (unnumbered acknowledgement), and an RR (ready to receive), and one day hopefully, a Call Request, and later, some data.
To do this, I need to calculate the 16-bit checksum to put into the outgoing X.25 packet. I have followed various web links and tried various available programs to (a) construct a table (b) use the table with complex XOR instructions that I don't really understand, but have slavishly copied. I can't get the same answers as the incoming SABM and DISC packets.
I should really appreciate any clues, pointers, and best of all some really nice working code!