File:  [ELWIX - Embedded LightWeight unIX -] / libaitcrc / example / test.c
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Wed Jan 20 00:04:44 2010 UTC (14 years, 5 months ago) by misho
Branches: MAIN
CVS tags: crc2_3, crc2_2, crc2_1, crc2_0, crc1_2, HEAD, CRC2_2, CRC2_1, CRC2_0, CRC1_2, CRC1_1
version 1.1

    1: #include <stdio.h>
    2: #include <sys/types.h>
    3: #include <aitcrc.h>
    4: 
    5: 
    6: int main()
    7: {
    8: 	register int cx = 0;
    9: 	int opt;
   10: 	char buf[200];
   11:        	u_char pd[7] = { 0xFF, 0x01, 0x00, 0x04, 0x3F, 0x00, 0x01 };
   12: 	u_char pp[8] = { 0xA0, 0x00, 0x00, 0x04, 0x20, 0x00, 0xAF, 0x01 };
   13: 
   14: 	printf("reflect=%lu\n", crcReflect(3001123, 32));
   15: 
   16: 	printf("pelco_d=0x%x pelco_p=0x%x\n", crcPelco('d', pd), crcPelco('p', pp));
   17: 
   18: 	return 0;
   19: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>