|
|
|
|
#1 |
|
Registered
Join Date: 2005/12
Posts: 11
|
635 - CRC - perl
Hello !
I have tried the perl code included in the data sheet, and here is the output: ~/dev/lcdlib/TestsStandalone> ./cftest.pl A CRC of Packet (800105) Should Equal (5584) ffff b24c b959 fe7e ba0d eadc 7a25 85da So I get 85da instead of 5584. Before I go to the cellar to get my old lessons on data integrity could someone tell me if this example should work ? I'm getting confused between ord, char, hexa, decimal, carcters... when saying type '80', it is 0x80, correct ? 10000000 in binary ? What should be the CRC for 0x80 ? Thanks ! Vincent |
|
|
|
|
|
#2 |
|
Administrator
Join Date: 2001/03
Location: Spokane, Washington
Posts: 4,015
|
Aye, I couldn't PERL meself out of a wet paper bag. The person that submitted the PERL example to us stated it worked, but beyond that . . .
Here are a couple of debugger screenshots of packets showing the exact byte order, right before they go out the port. Unfortunately, they are for the CFA-633, and the commands 7 & 8 used as examples have been deprecated in the CFA-635. http://www.crystalfontz.com/backligh...est_packet.pdf |
|
|
|
|
|
#3 |
|
Registered
Join Date: 2005/12
Posts: 11
|
Thanks for the update and the nice snapshot. I'll also check on the wintest app when I get the 635.
The CRC is calculated the same way on 633 and 635 ? Vincent. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: 2001/03
Location: Spokane, Washington
Posts: 4,015
|
Yes
|
|
|
|
|
|
#5 | |
|
Registered
Join Date: 2005/12
Posts: 11
|
Quote:
I really don't see how the perl example in the appendix can work. The value 80 should be 0x80, as it is hexa, and not decimal Moreover using the concatenation operato r "." generates 6 cars, and not 3 bytes: 800105. All in all, I got the example to work succesfully by doing this: my $type = 0x00; my $length = 0x02; my $data = 0xff; my $packet = pack 'C4',$type,$length,$data,$data; Thsi is a ping packet, with 2 bytes set to 0xff. The calculated CRC for this packet is: b9de, as the packet debugger tells me. So now, I need to make the packet generator more versatile. Vincent. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|