View previous topic :: View next topic |
Author |
Message |
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Sun Sep 02, 2018 12:01 am Post subject: |
|
|
Bascom already has 6 types of CRC built in what is needed?
Regards Paul |
|
Back to top |
|
|
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
Posted: Sun Sep 02, 2018 10:00 am Post subject: |
|
|
Hi,
It shames me to say, but I do not want to think about it. The point is (from a pn532 manual):
Quote: |
- LEN 1 byte indicating the number of bytes in the data field
(TFI and PD0 to PDn),
- LCS 1 Packet Length Checksum LCS byte that satisfies the relation:
Lower byte of [LEN + LCS] = 0x00,
- TFI 1 byte frame identifier, the value of this byte depends
on the way of the message:
-- D4h in case of a frame from the host controller to the PN532,
-- D5h in case of a frame from the PN532 to the host controller.
- DATA LEN-1 bytes of Packet Data Information
The first byte PD0 is the Command Code,
- DCS 1 Data Checksum DCS byte that satisfies the relation:
Lower byte of [TFI + PD0 + PD1 + … + PDn + DCS] = 0x00,
|
Regards,
Martin |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Sep 08, 2018 8:31 pm Post subject: |
|
|
Thank you for sharing your code.
you can calculate LCS by adding value to the LEN till it becomes 0.
So if LEN is 200, and we add 55 we get 255, if we add another 1, the byte overflow into 0.
So the 'forumula' is LCS=256-LEN
That is, that is how i read it. _________________ Mark |
|
Back to top |
|
|
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Sep 08, 2018 8:45 pm Post subject: |
|
|
Thanks for the video
It seems to work excellent. Well done. _________________ Mark |
|
Back to top |
|
|
krolikbest
Joined: 02 Jan 2017 Posts: 112
|
Posted: Sat Sep 08, 2018 9:04 pm Post subject: |
|
|
Thanks |
|
Back to top |
|
|
|