Compare commits

...

2 Commits
master ... 7DH0

Author SHA1 Message Date
3d2cbc09fc sw0101 2024-12-07 17:00:42 +08:00
61fd7c9a40 删除DTC和上下左右 2024-11-28 22:55:34 +08:00
40 changed files with 8882 additions and 17796 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4105
ECU_APP/OutPut/ECU_APP.S19 Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,16 @@
[FORDHEADER]
APPLICATION=FORD FNOS-Secondary Bootloader
MASK NUMBER=Must be adapted by TIER I
;FILE NAME=appl.hex ; Will be filled out automatically if not present.
;RELEASE DATE=02/18/2005
MODULE TYPE=Restraint Control Module
PRODUCTION MODULE PART NUMBER=XL5A-14B321-AA
WERS NOTICE=DE00E10757919001
COMMENTS=Henrys header for flashdata
RELEASED BY=Armin Happel
MODULE NAME=RESTRAINTS CONTROL MODULE
MODULE ID=0x7B0
DOWNLOAD FORMAT=0x01
;FILE CHECKSUM=0x0A33
;FLASH INDICATOR=1 Set to 0 if not present
;FLASH ERASE SECTORS=:0xF0000,0x4000:0xF4000,0x4000:0xF8000,0x4000:0xFC000,0x4000:0xFD800,0x0400

View File

@ -0,0 +1 @@
</SW-CNT>

View File

@ -0,0 +1,57 @@
<!DOCTYPE SW-CNT PUBLIC "-//Volkswagen AG//DTD Datencontainer fuer die SG-Programmierung V00.80:MiniDC08.DTD//GE" "minidc08.dtd">
<SW-CNT>
<IDENT>
<CNT-DATEI>3D0909601A.sgm</CNT-DATEI>
<CNT-VERSION-TYP>cvt_pfu_01</CNT-VERSION-TYP>
<CNT-VERSION-INHALT>0.80</CNT-VERSION-INHALT>
<CNT-IDENT-TEXT>MyProject</CNT-IDENT-TEXT>
<SW-VERSION-KURZ>0815A</SW-VERSION-KURZ>
<SW-VERSION-LANG>3D4711A</SW-VERSION-LANG>
</IDENT>
<INFO>
<ADRESSEN>
<ADRESSE>
<FIRMENNAME>S/W-Development GmbH</FIRMENNAME>
<ROLLE>Entwicklung VAG-Software</ROLLE>
<ABTEILUNG>ESVG</ABTEILUNG>
<PERSON>Klaus Mustermann</PERSON>
<ANSCHRIFT>Gewerbestrasse 40, D-03421 Ingolsheim</ANSCHRIFT>
<TELEFON>+49-6234-123-456</TELEFON>
<FAX>+49-6234-123-200</FAX>
<EMAIL>Klaus.Mustermann@sw-develop.de</EMAIL>
</ADRESSE>
</ADRESSEN>
<REVISIONEN>
<REVISION>
<WANN></WANN>
<WER></WER>
<WAS></WAS>
<WARUM></WARUM>
<VERSION></VERSION>
</REVISION>
</REVISIONEN>
</INFO>
<ABLAEUFE>
<ABLAUF>
<ABLAUF-NAME>abn_pfu</ABLAUF-NAME>
<KWP-2000>
<KWP-2000-TGT>0x62</KWP-2000-TGT>
<KWP-2000-REI>
<KWP-2000-PSTAT-BIT0>255</KWP-2000-PSTAT-BIT0>
<KWP-2000-PSTAT-BIT1>6</KWP-2000-PSTAT-BIT1>
<KWP-2000-PSTAT-BIT2>10</KWP-2000-PSTAT-BIT2>
<KWP-2000-PSTAT-BIT3>0</KWP-2000-PSTAT-BIT3>
<KWP-2000-PSTAT-BIT4>0</KWP-2000-PSTAT-BIT4>
<KWP-2000-PSTAT-BIT5>0</KWP-2000-PSTAT-BIT5>
<KWP-2000-PSTAT-BIT6>0</KWP-2000-PSTAT-BIT6>
<KWP-2000-PSTAT-BIT7>0</KWP-2000-PSTAT-BIT7>
</KWP-2000-REI>
<KWP-2000-ACP>
<KWP-2000-P2MIN>0xFF</KWP-2000-P2MIN>
<KWP-2000-P2MAX>0xFF</KWP-2000-P2MAX>
<KWP-2000-P3MIN>0xFF</KWP-2000-P3MIN>
<KWP-2000-P3MAX>0xFF</KWP-2000-P3MAX>
<KWP-2000-P4MIN>0xFF</KWP-2000-P4MIN>
</KWP-2000-ACP>
<KWP-2000-SA2>0x12,0x23,0x23,0x34,0x45,0x56C</KWP-2000-SA2>
</KWP-2000>

View File

@ -0,0 +1,2 @@
</ABLAUF>
</ABLAEUFE>

View File

@ -0,0 +1,128 @@
S0110000486578766965772056312E30352EA6
S123900058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F70717273747576775C
S123902078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F90919293949596973C
S123904098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B71C
S1239060B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7FC
S1239080D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7DC
S12390A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617BC
S12390C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F30313233343536379C
S12390E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556577C
S123910058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F70717273747576775B
S123912078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F90919293949596973B
S123914098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B71B
S1239160B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7FB
S1239180D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7DB
S12391A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617BB
S12391C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F30313233343536379B
S12391E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556577B
S123920058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F70717273747576775A
S123922078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F90919293949596973A
S123924098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B71A
S1239260B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7FA
S1239280D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7DA
S12392A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617BA
S12392C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F30313233343536379A
S12392E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556577A
S123930058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767759
S123932078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969739
S123934098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B719
S1239360B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F9
S1239380D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D9
S12393A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B9
S12393C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363799
S12393E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565779
S123940058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767758
S123942078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969738
S123944098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B718
S1239460B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F8
S1239480D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D8
S12394A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B8
S12394C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363798
S12394E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565778
S123950058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767757
S123952078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969737
S123954098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B717
S1239560B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F7
S1239580D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D7
S12395A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B7
S12395C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363797
S12395E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565777
S123960058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767756
S123962078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969736
S123964098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B716
S1239660B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F6
S1239680D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D6
S12396A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B6
S12396C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363796
S12396E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565776
S123970058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767755
S123972078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969735
S123974098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B715
S1239760B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F5
S1239780D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D5
S12397A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B5
S12397C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363795
S12397E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565775
S123980058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767754
S123982078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969734
S123984098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B714
S1239860B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F4
S1239880D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D4
S12398A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B4
S12398C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363794
S12398E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565774
S123990058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767753
S123992078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969733
S123994098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B713
S1239960B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F3
S1239980D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D3
S12399A0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B3
S12399C018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363793
S12399E038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565773
S1239A0058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767752
S1239A2078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969732
S1239A4098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B712
S1239A60B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F2
S1239A80D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D2
S1239AA0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B2
S1239AC018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363792
S1239AE038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565772
S1239B0058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767751
S1239B2078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969731
S1239B4098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B711
S1239B60B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F1
S1239B80D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D1
S1239BA0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B1
S1239BC018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363791
S1239BE038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565771
S1239C0058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767750
S1239C2078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969730
S1239C4098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B710
S1239C60B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7F0
S1239C80D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7D0
S1239CA0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617B0
S1239CC018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363790
S1239CE038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565770
S1239D0058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F70717273747576774F
S1239D2078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F90919293949596972F
S1239D4098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B70F
S1239D60B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7EF
S1239D80D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7CF
S1239DA0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617AF
S1239DC018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F30313233343536378F
S1239DE038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556576F
S1239E0058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F70717273747576774E
S1239E2078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F90919293949596972E
S1239E4098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B70E
S1239E60B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7EE
S1239E80D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7CE
S1239EA0F8F9FAFBFCFDFEFF000102030405060708090A0B0C0D0E0F1011121314151617AE
S1239EC018191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F30313233343536378E
S1239EE038393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F50515253545556576E
S1239F0058595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F70717273747576774D
S1239F2078797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F90919293949596972D
S1239F4098999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B70D
S1239F60B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7ED
S1239F80D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7CD
S1059FA0F8F9CA
S9030000FC

View File

@ -0,0 +1,118 @@
[FORDHEADER]
APPLICATION=FORD FNOS-DemoIL
MASK NUMBER=7 or later
FILE NAME=APPL.hex
RELEASE DATE=10/05/2001
MODULE TYPE=Restraint Control Module
PRODUCTION MODULE PART NUMBER=XL5A-14B321-AA
WERS NOTICE=DE00E10757919001
COMMENTS=Henrys header for flashdata
RELEASED BY=Armin Happel
MODULE NAME=RESTRAINTS CONTROL MODULE
MODULE ID=0x7B0
DOWNLOAD FORMAT=0x01
;FILE CHECKSUM=0x0A33
FLASH INDICATOR=1
;FLASH ERASE SECTORS=:0xF0000,0x4000:0xF4000,0x4000:0xF8000,0x4000:0xFC000,0x4000:0xFD800,0x0400
[VBFHEADER]
SW_PART_NUMBER=12345678
SW_PART_TYPE=EXE
SW_CALL_ADDRESS=
FRAME_FORMAT=CAN_STANDARD
DESCRIPTION1=This the demo application for
DESCRIPTION2=the FJ16LX FBL-Ford FNOS-I3.
NETWORK=CAN_MS
ECU_ADDRESS=0x7E0
VBF_VERSION=2.5
DATA_FORMAT_ID=
DATPROC_PARAM=
DATPROC_METHOD=0
SW_VERSION=ABC
[FIATINFO]
; HFIType: Header Format Identifier. Should be 4 for 07209 or 2 for 07274
HFIType=4
; DownloadMethod or Fingerprint (FPM): 0=all Fingerprints, 1=Prog+Data, 2=Prog-only
DownloadMethod=0
; ChecksumMethod: 0=Segment+File, 1=File
ChecksumMethod=1
; ChecksumType=Type of Checksum calculation
ChecksumType=1
ECUAddress=32
TesterAddress=241
TesterCanID=0x18da20f1
EcuCanID=0x18daf120
TypeOfSeedKey=0
AccessMethod=0
ReqDLMethod=0
ReqDLType=0
P2Min=5
P2Max=2
P3Min=1
P3Max=20
P4=0
PartialPrmFile=page3a_partial.prm
PartialRange=0x9100,0x100
UsePartialDownload=1
AddressLengthSize=0x33
ReqDLParam=
[C_EXPORT]
Decryption=0
Decryptvalue=202
Prefix=flashDrv
WordSize=0
WordType=0
; Steuerdatei für VAG-Daten Container Export
; Datei muss gleichlauten mit geladener Record-Datei.
[SGMDATA]
; SGMHEADERPRE verweist auf Datei des SGML-Headers.
; Wird immer an den Anfang des Headers kopiert.
SGMHEADERPRE=header1.log
; Datenverweise werden hier zwischen eingefügt.
; Anschliessend Dateiinhalt, auf den SGMHEADERPOST verweist.
SGMHEADERPOST=header2.log
; SGMFOOTER wird immer ans Ende der Dateien kopiert.
SGMFOOTER=footer.log
; Verweist FLASHDRV auf eine lesbare HEX-Datei, wird
; Der Inhalt als erste Datei in den Container kopiert
; (Noch nicht implementiert).
; Es muss sich hierbei um eine Intel-HEX oder S-Record Datei handeln.
FLASHDRV=D:\Usr\Armin\VC\HexView\FLASHCODE_SH70XXF_704.hex
; DATENBLOCKNAME ist der Name, der innerhalb der Datenblöcke für den Verweis verwendet wird.
DATENBLOCKNAME=dav_pfu
; Die Checksummenmethode aus EXPDATPROC.DLL
; Der Integerwert ist der Index für Checksummenmethode.
CHECKSUMTYPE=2
;Setup data pre-processing from expdatproc.dll (index is type of calcualation).
;If parameter is negative, no data processing will be performed.
DATAPROCESSINGTYPE=0
;Parameter to the data processing unit
DATAPROCESSINGPARAMETER=1234567890
[FLASH_KERNEL_CONFIG]
;FLASH_KERNEL_NAME="S12kernel.fkl"
FLASH_KERNEL_COMMENT="XCP Flash Kernel for HC12D60 Version 1.0.0"
;FLASH_KERNEL_FILE_ADDR=0x039A
;FLASH_KERNEL_SIZE=0x0426
;FLASH_KERNEL_RAM_ADDR=0x039A
FLASH_KERNEL_RAM_START=0x211d
[CANFLASH]
SELITEMCANFLASH=2
SELITEMCFG=0
SELITEMECU=0
SELITEMAUTOFLASH=0
CFGNAME=sw_GMLAN_example
ECUNAME=DUT
[GACHEADERINFO]
Dcid_0=0xFF
Dcid_1=0xFF
Dcid_2=0xFF
SoftwareVersion="123"
SoftwarePartNumber="1234567890ABCD"
AppOrCalVersion="123"
EcuCodeAndSupplierId="123456789"

View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{852F39CC-464E-4970-B66B-C074CBB4FB82}</ProjectGuid>
<RootNamespace>_expdatproc</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v100</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v100</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(ProjectDir)\Impl_actCLib;$(ProjectDir)\Impl_ESLib</IncludePath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(ProjectDir)\Impl_actCLib;$(ProjectDir)\Impl_ESLib</IncludePath>
<CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">CopyFilesToOutputDirectory</CustomBuildAfterTargets>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/expdatproc.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/expdatproc.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0407</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>libcmt.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\Release/expdatproc.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<ProgramDatabaseFile>.\Release/expdatproc.pdb</ProgramDatabaseFile>
<ImportLibrary>.\Release/expdatproc.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<EntryPointSymbol>DllEntryPoint</EntryPointSymbol>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/expdatproc.bsc</OutputFile>
</Bscmake>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<CustomBuildStep>
<Message>
</Message>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>./expdatproc.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/expdatproc.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<BrowseInformation>true</BrowseInformation>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0407</Culture>
</ResourceCompile>
<Link>
<AdditionalDependencies>odbc32.lib;odbccp32.lib;msvcrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>.\Debug/expdatproc.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>./expdatproc.pdb</ProgramDatabaseFile>
<ImportLibrary>./expdatproc.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>./expdatproc.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="expdatproc.c" />
<ClCompile Include="expdat_csum.c" />
<ClCompile Include="expdat_csumTables.c" />
<ClCompile Include="expdat_datproc.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\Application_Exe\trunk\expdat.h" />
<ClInclude Include="expdat_csum.h" />
<ClInclude Include="expdat_csumTables.h" />
<ClInclude Include="expdat_datproc.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,284 @@
/////////////////////////////////////////////////////////
//
// Filename: EXPDAT.H
//
// Descripition: Specifies the Export types.
//
// Used for checksum and data processing during the data-export.
// This is the interface header-file between EXPDATPROC.DLL and the Hex-View Program.
//
// 2015-01-03 V03.00.00 Interface version incremented because functions to allocate memory
// from host have been introduced in ExportDataInfo.
// Change valid since expodatproc.dll V2.00.
//
// 2018-01-30 V5.00.00 Supporting streaming API for several operations.
#ifndef __EXPDAT_H__
#define __EXPDAT_H__
#ifdef _WIN32
#include <Windows.h>
#endif
/* Re-defined in v_def.h and AUTOSAR types */
# ifndef BYTE
# define BYTE unsigned char
# endif
# ifndef WORD
# define WORD unsigned short
# endif
# ifndef DWORD
# define DWORD unsigned long
# endif
# ifndef __cplusplus
# define bool boolean
# define true TRUE
# define false FALSE
# endif
// Used in csum an datproc
#define ExpDat_AllocWorkspace(size) malloc(size)
#define ExpDat_FreeWorkspace(p) if (*p!=NULL) { \
free(*(p)); \
} \
*p=NULL
/* Give FORMAT parameter in the expdat proc a meaning */
#define EXPDAT_FORMAT_GENERAL_PARAM_BINARY 0x27u
/* Define the update mode for data processing and signature verification. */
/* The mode bits must be set in the DoDataOperation flag byte */
#define DODATA_START 0x01 // Flag is set when starting the update of a data block.
#define DODATA_UPDATE 0x02 // Flag is set when more data to be processed (start operation flag was already given).
#define DODATA_FINISH 0x04 // Flag is set when the operation will be concluded.
#define DODATA_START_UPDATE (DODATA_START|DODATA_UPDATE)
#define DODATA_START_UPDATE_FINISH (DODATA_START|DODATA_UPDATE|DODATA_FINISH)
#define DODATA_UPDATE_FINISH (DODATA_UPDATE|DODATA_FINISH)
// Export type (unused).
typedef enum EExportType
{
ExportTypeSRecord
,ExportTypeIntelHex
,ExportTypeFiatBinary
} EExportType;
enum EInterfaceVersion {
DllInterfaceVersion=0005
,DllInterfaceVersion_0004=0004
,DllInterfaceVersion_0003=0003 // Used for compatibility checks.
,DllVersionIllegal=-1
};
// Streaming operation.
typedef enum EChecksumAction
{
CSumActionBegin,
CSumActionDoData,
CSumActionEnd
} EChecksumAction;
// Error codes.
typedef enum EExportStatus
{
ExportStateIdle=0
,ExportStateDllInterfaceVersionError
,ExportStateChecksumCalculationError
,ExportStateNoConstDataResults
,ExportStateDataCompressionCalculationError
,ExportStateDataEncryptionError
,ExportStateChecksumAddressMisalignedError
,ExportStateChecksumLengthMisalignedError
,ExportStateUnknownActionItemOrActionType
,ExportStateParamterMissingForDataProcessing
,ExportStateKeyGeneralError
,ExportStateKeyDuplicateParamter
,ExportStateKeyParameterMissing
,ExportStateKeyIsHMAC
,ExportStateKeyIsRSA
,ExportStateWrongBytesPerBlockType
,ExportStateWrongAESBlockSize
,ExportStateWrongAESParameterExtension
,ExportStateGeneralRSAError
,ExportStateRSAInvalidLength
,ExportStateSignatureVerificationFailed
,ExportStatePublicKeyInvalid
,ExportStateSignatureInvalidSize
,ExportStateDynamicLengthOperationNotPossible
} EExportStatus;
/* Declare user interface functions as DLL */
#ifdef _USRDLL
#define DLL_FUNC(retval) retval __declspec(dllexport) __cdecl
#else
/* Normal C-Interfaces */
#define DLL_FUNC(retval) retval
#endif
// Used to identify the name of the DLL in function 'LoadLibrary'.
#define EXPDAT_DLL_NAME "EXPDATPROC.DLL"
#define EXPDAT_RESULTS_MAXSIZE 1024
// Functions used to allocate and deallocate host memory.
// Used when segOutData array need to be extended or changed.
typedef void * (*TAllocHostMemory)(int size);
typedef void (*TFreeHostMemory)(void *ptr);
typedef struct TExportDataInfo
{
enum EInterfaceVersion DllInterfaceVersion;
// Input-section:
// =============
// Segment data information
EExportType exType; // Provides information of export type (see above).
int index; // Selected service index.
BYTE format; // format byte (taken from the dialog).
char *generalParam; // General purpose string (will be taken from the dialogs).
DWORD segInAddress; // These information are not valid during Init and Deinit.
DWORD segInLength;
char *segInData;
// Output section:
// ==============
// Segment data information
DWORD segOutAddress; // On call to Checksum and process data, outXxx
DWORD segOutLength; // and InXxx are identically. OutXxx will be
char *segOutData; // taken for output data from ProcessData.
EExportStatus exState; // Call function can provide more detailed
// status information here.
DWORD maxSegLen; // max.number of bytes allowed for segInLength.
void *voidPtr; // used for future general purpose pointer (e.g. context data).
BYTE expDatResults[EXPDAT_RESULTS_MAXSIZE];
WORD expDatResultSize;
TAllocHostMemory HostAllocMemory; // DLL calls this function to re-allocate host memory.
TFreeHostMemory HostFreeMemory; // or release it.
BYTE doDataOperation; // This flag field indicates the mode of operation for data processing (START|UPDATE|FINISH).
DWORD segInTotalLength; // Provides the total segment length of a buffer.
LPCSTR segInPath; // This is the path of the to a file in case the data are located in a file.
LPCSTR segOutPath; // The target file where the data will be located to.
DWORD reserved[8]; // Space in the struct for future and backward compatible operation.
} TExportDataInfo;
// Interface function names.
#define EXPNAME_CSUMFCTCOUNT "GetChecksumFunctionCount"
#define EXPNAME_CSUMFCTNAME "GetChecksumFunctionName"
#define EXPNAME_INITCSUM "InitChecksum"
#define EXPNAME_DEINITCSUM "DeinitChecksum"
#define EXPNAME_DOCSUM "DoCalculateChecksum"
#define EXPNAME_CSUMRESULTSIZE "GetChecksumSizeOfResult"
#define EXPNAME_STATEINFO "GetExportStateInfo"
#define EXPNAME_DPROCFCTCOUNT "GetDataProcessingFunctionCount"
#define EXPNAME_DPROCFCTNAME "GetDataProcessingFunctionName"
#define EXPNAME_INITDPROC "InitDataProcessing"
#define EXPNAME_DEINITDPROC "DeinitDataProcessing"
#define EXPNAME_DODPROC "DoDataProcessing"
#define EXPNAME_SIGNVERFCTCOUNT "GetSignVerifyFunctionCount"
#define EXPNAME_SIGNVERFCTNAME "GetSignVerifyFunctionName"
#define EXPNAME_INITSIGNVER "InitSignVerify"
#define EXPNAME_DEINITSIGNVER "DeinitSignVerify"
#define EXPNAME_DOSIGNVER "DoSignVerify"
#ifdef STATIC_EXPDATPROC_DLL
extern "C" int __declspec(dllimport) __cdecl GetChecksumFunctionCount(void);
extern "C" bool __declspec(dllimport) __cdecl GetChecksumFunctionName(int index, char * name, int size);
extern "C" int __declspec(dllimport) __cdecl GetChecksumSizeOfResult(int index);
extern "C" bool __declspec(dllimport) __cdecl InitChecksum( TExportDataInfo *info ) ;
extern "C" bool __declspec(dllimport) __cdecl DeinitChecksum( TExportDataInfo *info ) ;
extern "C" bool __declspec(dllimport) __cdecl DoCalculateChecksum(TExportDataInfo *info,
EChecksumAction actionState);
extern "C" void __declspec(dllimport) __cdecl GetExportStateInfo(char **infoText, enum EExportStatus actionState ) ;
extern "C" int __declspec(dllimport) __cdecl GetDataProcessingFunctionCount(void);
extern "C" bool __declspec(dllimport) __cdecl GetDataProcessingFunctionName(int index, char * name, int size);
extern "C" bool __declspec(dllimport) __cdecl InitDataProcessing( TExportDataInfo *info ) ;
extern "C" bool __declspec(dllimport) __cdecl DeinitDataProcessing(TExportDataInfo *info ) ;
extern "C" bool __declspec(dllimport) __cdecl DoDataProcessing( TExportDataInfo *info ) ;
extern "C" int __declspec(dllimport) __cdecl GetSignVerifyFunctionCount(void);
extern "C" bool __declspec(dllimport) __cdecl GetSignVerifyFunctionName(int index, char * name, int size);
extern "C" bool __declspec(dllimport) __cdecl InitSignVerify( TExportDataInfo *info ) ;
extern "C" bool __declspec(dllimport) __cdecl DeinitSignVerify(TExportDataInfo *info ) ;
extern "C" bool __declspec(dllimport) __cdecl DoSignVerify( TExportDataInfo *info ) ;
#endif
#if defined(_USRDLL) || defined (PROGRAM_HEXVIEW)
typedef int (* TGetChecksumFunctionCount)(void);
typedef bool (* TGetChecksumFunctionName)(int index, char * name, int maxNamelen);
typedef bool (* TInitChecksum)( TExportDataInfo *info );
typedef bool (* TDeinitChecksum)( TExportDataInfo *info );
typedef bool (* TDoCalculateChecksum)( TExportDataInfo *info, EChecksumAction actionState );
typedef int (* TGetChecksumSizeOfResult)( int index );
typedef void (* TGetExportStateInfo) ( char **infoText, enum EExportStatus actionState );
typedef int (* TGetDataProcessingFunctionCount)(void);
typedef bool (* TGetDataProcessingFunctionName)(int index, char * name, int maxNamelen);
typedef bool (* TInitDataProcessing)( TExportDataInfo *info);
typedef bool (* TDeinitDataProcessing)( TExportDataInfo *info);
typedef bool (* TDoDataProcessing)( TExportDataInfo *info);
typedef int (* TGetSignVerifyFunctionCount)(void);
typedef bool (* TGetSignVerifyFunctionName)(int index, char * name, int maxNamelen);
typedef bool (* TInitSignVerify)( TExportDataInfo *info);
typedef bool (* TDeinitSignVerify)( TExportDataInfo *info);
typedef bool (* TDoSignVerify)( TExportDataInfo *info);
#else
#ifdef __cplusplus
extern "C" {
#endif
int GetChecksumFunctionCount(void);
bool GetChecksumFunctionName(int index, char * name, int maxNamelen);
bool InitChecksum( TExportDataInfo *info );
bool DeinitChecksum( TExportDataInfo *info );
bool DoCalculateChecksum( TExportDataInfo *info, EChecksumAction actionState );
int GetChecksumSizeOfResult( int index );
void GetExportStateInfo ( char **infoText, enum EExportStatus actionState );
int GetDataProcessingFunctionCount(void);
bool GetDataProcessingFunctionName(int index, char * name, int maxNamelen);
bool InitDataProcessing( TExportDataInfo *info);
bool DeinitDataProcessing( TExportDataInfo *info);
bool DoDataProcessing( TExportDataInfo *info);
int GetSignVerifyFunctionCount(void);
bool GetSignVerifyFunctionName(int index, char * name, int maxNamelen);
bool InitSignVerify( TExportDataInfo *info);
bool DeinitSignVerify( TExportDataInfo *info);
bool DoDataSignVerify( TExportDataInfo *info);
void ExpDat_Init(TExportDataInfo *expdat, int type);
#ifdef __cplusplus
}
#endif
#endif
#endif /* __EXPDAT_H__ */

View File

@ -0,0 +1,614 @@
/**********************************************************************************************************************
* COPYRIGHT
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
* Copyright (c) 2014 by Vector Informatik GmbH. All rights reserved.
*
* This software is copyright protected and proprietary to Vector Informatik GmbH.
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
* All other rights remain with Vector Informatik GmbH.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -----------------------------------------------------------------------------------------------------------------*/
/** \file expdat_csum.cpp
* \brief Implementation of the checksum calculation functions.
*
* \details This file contains the interface functions for the checksum calculations.
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* AUTHOR IDENTITY
* -------------------------------------------------------------------------------------------------------------------
* Name Initials Company
* -------------------------------------------------------------------------------------------------------------------
* Armin Happel vishp Vector Informatik GmbH
* -------------------------------------------------------------------------------------------------------------------
* REVISION HISTORY
* -------------------------------------------------------------------------------------------------------------------
* Version Date Author Change Id Description
* -------------------------------------------------------------------------------------------------------------------
* 01.00.00 2014-12-18 vishp Creation
*********************************************************************************************************************/
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#endif
#include <string.h>
#include <stdio.h>
#include "expdat.h"
#include "expdat_csum.h"
#include "expdat_csumTables.h"
/**********************************************************************************************************************
* LOCAL CONSTANT MACROS
**********************************************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************************************************************************************
* LOCAL FUNCTION MACROS
**********************************************************************************************************************/
/**********************************************************************************************************************
* LOCAL DATA TYPES AND STRUCTURES
**********************************************************************************************************************/
/**********************************************************************************************************************
* LOCAL DATA
**********************************************************************************************************************/
static const char *csumFunctionName[] = {
"ByteSum into 16-Bit, BE-out"
, "ByteSum into 16-Bit, LE-out"
, "Wordsum BE into 16-Bit, BE-Out"
, "Wordsum LE into 16-Bit, LE-Out"
, "ByteSum w/ 2s complement into 16-Bit BE (GM old-style)"
, "Wordsum BE into 16-Bit, 2's Compl BE-Out (GM new style)"
, "Wordsum LE into 16-Bit, 2's Compl LE-Out (GM new style)"
, "CRC16 CCITT X.25 LE-Out (CAFE)"
, "CRC16 CCITT X.25 BE-Out (CAFE)"
};
/**********************************************************************************************************************
* GLOBAL DATA
**********************************************************************************************************************/
/** Declaration of global and uninitialized vars ***********************************************************************/
/**********************************************************************************************************************
* LOCAL FUNCTION PROTOTYPES
**********************************************************************************************************************/
static bool BeginChecksumCalculation(TExportDataInfo *info);
static bool DoChecksumCalculation(TExportDataInfo *info);
static bool EndChecksumCalculation(TExportDataInfo *info, BYTE *pResult, WORD *pResultLen);
static int GetChecksumLength(int index);
/**********************************************************************************************************************
**********************************************************************************************************************
* LOCAL FUNCTIONS
**********************************************************************************************************************
**********************************************************************************************************************/
/**********************************************************************************************************************
* GetChecksumLength()
**********************************************************************************************************************/
/*! \brief Provides the length of the results in bytes.
* \param[in] index: The index number of the operation.
* \return The length of the operation results in bytes.
**********************************************************************************************************************/
static int GetChecksumLength(int index)
{
int result=0;
switch (index)
{
case kCsumBytesum___Into16Bit_BEout:
case kCsumBytesum___Into16Bit_LEout:
case kCsumWordsumBE_Into16Bit_BEout:
case kCsumWordsumLE_Into16Bit_LEout:
case kCsumBytesum___Into2Compl16Bit_BEout:
case kCsumWordsumBE_Into2Compl16Bit_BEout:
case kCsumWordsumLE_Into2Compl16Bit_LEout:
case kCsumCRC16CCITT_X25_LEout_CAFE:
case kCsumCRC16CCITT_X25_BEout_CAFE:
result = 2;
break;
default: result = 0;
}
return result;
}
/**********************************************************************************************************************
* BeginChecksumCalculation()
**********************************************************************************************************************/
/*! \brief Called when checksum operaton shall begin [DoCalculateChecksum(info, csumActionBegin)].
* \details Work to do: initialize your workspace parameters
* \param[in] info: Pointer to the context buffer with its workspace.
* \return TRUE if the operation has succeeded,
* False otherwise.
**********************************************************************************************************************/
static bool BeginChecksumCalculation(TExportDataInfo *info)
{
bool result=false;
unsigned short *pwCS;
// -------------------------------------
// Action item: Initialize system layer.
// -------------------------------------
switch (info->index) {
// 2-Complement without carry -> unsigned short
case kCsumBytesum___Into16Bit_BEout:
case kCsumBytesum___Into16Bit_LEout:
case kCsumWordsumBE_Into16Bit_BEout:
case kCsumWordsumLE_Into16Bit_LEout:
case kCsumBytesum___Into2Compl16Bit_BEout:
case kCsumWordsumBE_Into2Compl16Bit_BEout:
case kCsumWordsumLE_Into2Compl16Bit_LEout:
/* Set the checksum start value */
pwCS = (unsigned short *)info->voidPtr;
*pwCS = 0;
result = true;
break;
case kCsumCRC16CCITT_X25_LEout_CAFE:
case kCsumCRC16CCITT_X25_BEout_CAFE:
pwCS = (unsigned short *)info->voidPtr;
*pwCS = 0xCAFE;//0xCAFE;
result = true;
break;
}
return result;
}
/**********************************************************************************************************************
* DoChecksumCalculation()
**********************************************************************************************************************/
/*! \brief Called when checksum operaton shall be executed on data [DoCalculateChecksum(info, csumActionDoData)].
* \details Work to do: Calculate the checksum
* \param[in] info: Pointer to the context buffer with its workspace.
* \return TRUE if the operation has succeeded,
* False otherwise.
* \note This function will be called several times, each time per block (continuous address space).
**********************************************************************************************************************/
static bool DoChecksumCalculation(TExportDataInfo *info)
{
bool result=false;
unsigned short *pwCS;
DWORD i;
switch (info->index)
{
case kCsumBytesum___Into16Bit_BEout:
case kCsumBytesum___Into16Bit_LEout:
pwCS = (unsigned short *)info->voidPtr;
for (i=0l; i < info->segInLength; i++)
{
*pwCS += (BYTE) (((unsigned char)info->segInData[i])&0xff);
}
result = true;
break;
case kCsumWordsumBE_Into16Bit_BEout:
case kCsumWordsumBE_Into2Compl16Bit_BEout:
pwCS = (unsigned short *)info->voidPtr;
// if address/length correction necessary
// do this here in segOutLength and segOutAddress.
if (info->segInAddress&(DWORD)1)
{
info->exState = ExportStateChecksumAddressMisalignedError;
return false;
}
if (info->segInLength&(DWORD)1)
{
info->exState = ExportStateChecksumLengthMisalignedError;
return false;
}
for (i=0l; i < info->segInLength; i+=2)
{
WORD tmp;
/* This is big endian summary of 16-bit values */
tmp = (WORD)info->segInData[i+1] & 0x00ff;
tmp |= (((WORD)info->segInData[i])*256) & 0xff00;
*pwCS += tmp;
}
result = true;
break;
case kCsumBytesum___Into2Compl16Bit_BEout:
pwCS = (unsigned short *)info->voidPtr;
for (i=0l; i < info->segInLength; i++)
{
*pwCS += (BYTE) (((~(unsigned char)info->segInData[i])&0xff) + 1);
}
result = true;
break;
case kCsumWordsumLE_Into16Bit_LEout:
case kCsumWordsumLE_Into2Compl16Bit_LEout:
case kCsumCRC16CCITT_X25_LEout_CAFE:
case kCsumCRC16CCITT_X25_BEout_CAFE:
{
BYTE table_index;
pwCS = (unsigned short *) info->voidPtr;
for( i=0; i < info->segInLength; i++)
{
table_index = (((BYTE)((*pwCS) >> 8)) ^ ((BYTE)info->segInData[i]));
(*pwCS) = (((WORD)((*pwCS) << 8)) ^ kausCrcTable16_cafe[table_index]);
}
result = true;
}
break;
default:
break;
}
return result;
}
/**********************************************************************************************************************
* EndtChecksumCalculation()
**********************************************************************************************************************/
/*! \brief Called when checksum operaton is finished on all data [DoCalculateChecksum(info, csumActionEnd)].
* \details Work to do: Finalize the calculation and present the result
* \param[in] info: Pointer to the context buffer with its workspace.
* \return TRUE if the operation has succeeded,
* False otherwise.
* \note This function typically provides the results of the operation in info->segOutData/info->segOutLength.
**********************************************************************************************************************/
static bool EndChecksumCalculation(TExportDataInfo *info, BYTE *pResult, WORD *pResultLen)
{
bool result=false;
WORD resultLen;
unsigned short *pwCS;
resultLen = GetChecksumLength(info->index);
if (resultLen > *pResultLen)
{
resultLen = *pResultLen;
}
else
{
*pResultLen = resultLen;
}
switch (info->index)
{
case kCsumBytesum___Into16Bit_LEout:
case kCsumWordsumLE_Into16Bit_LEout:
memcpy(pResult, info->voidPtr, resultLen);
result = true;
break;
case kCsumWordsumBE_Into16Bit_BEout:
case kCsumBytesum___Into16Bit_BEout:
pwCS = (unsigned short *)info->voidPtr;
{
int tmp;
// swap lo- and hi-byte-
tmp = (*pwCS>>8)&0xff;
*pwCS <<= 8;
*pwCS &= 0xff00;
*pwCS |= tmp;
}
memcpy(pResult, info->voidPtr, resultLen);
result = true;
break;
case kCsumBytesum___Into2Compl16Bit_BEout:
pwCS = (unsigned short *)info->voidPtr;
{
int tmp;
// swap lo- and hi-byte-
tmp = (*pwCS>>8)&0xff;
*pwCS <<= 8;
*pwCS &= 0xff00;
*pwCS |= tmp;
}
memcpy(pResult, info->voidPtr, resultLen);
result = true;
break;
case kCsumWordsumBE_Into2Compl16Bit_BEout:
pwCS = (unsigned short *)info->voidPtr;
{
int tmp;
// Make 2's complement.
*pwCS = ~*pwCS + 1;
// swap lo- and hi-byte-
tmp = (*pwCS>>8)&0xff;
*pwCS <<= 8;
*pwCS &= 0xff00;
*pwCS |= tmp;
}
memcpy(pResult, info->voidPtr, resultLen);
result = true;
break;
case kCsumWordsumLE_Into2Compl16Bit_LEout:
pwCS = (unsigned short *)info->voidPtr;
// Make 2's complement.
*pwCS = ~*pwCS + 1;
memcpy(pResult, info->voidPtr, resultLen);
result = true;
break;
default:
break;
}
return result;
}
/**********************************************************************************************************************
**********************************************************************************************************************
* GLOBAL FUNCTIONS
**********************************************************************************************************************
**********************************************************************************************************************/
/**********************************************************************************************************************
* GetChecksumFunctionCount()
**********************************************************************************************************************/
/*! \brief Provides the total number of available checksum functions.
* \return The number of available checksum functions.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
**********************************************************************************************************************/
DLL_FUNC(int) GetChecksumFunctionCount()
{
return kCsumItems;
}
/**********************************************************************************************************************
* GetChecksumFunctionName()
**********************************************************************************************************************/
/*! \brief Provides a verbal name of the checksum function used in dialog boxes.
* \param[in] index: The index number of the operation.
* \param[out] Pointer to the string buffer where the text will be placed to.
* \param[in] Size: Number of bytes available in the space where name points to.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* IMPORTANT: Enough space must be available for name in the calling routine or string is cut off!!
**********************************************************************************************************************/
DLL_FUNC(bool) GetChecksumFunctionName(int index, char * name, int size)
{
/* Not enough string elements available as requested */
if (index >= (sizeof(csumFunctionName)/sizeof(const unsigned char *)))
{
return false;
}
sprintf(name, "%2d:", index);
size -= (int)strlen(name);
size--; // char. termination.
strncat(name, csumFunctionName[index], size);
return true;
}
/**********************************************************************************************************************
* GetChecksumSizeOfResult()
**********************************************************************************************************************/
/*! \brief Provides the length of the results in bytes.
* \param[in] index: The index number of the operation.
* \return The length of the operation results in bytes.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
**********************************************************************************************************************/
DLL_FUNC(int) GetChecksumSizeOfResult(int index)
{
return GetChecksumLength(index);
}
/**********************************************************************************************************************
* InitChecksum()
**********************************************************************************************************************/
/*! \brief This function is called from the main EXE to initialize the checksum calculation.
* \details Work to do: The function allocates a workspace for the upcoming operation.
* \param[in] info: The workspace for the operation.
* \return True if operation was successful
* False otherwise.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* If the return value is false, then the exState contains a more detailed error indication.
* Important: Thus, after a succesful Init, a deinitialisation is required to free the workspace!
**********************************************************************************************************************/
DLL_FUNC(bool) InitChecksum( TExportDataInfo *info )
{
bool rval=false;
/* Check for interface version */
if (info->DllInterfaceVersion != DllInterfaceVersion)
{
info->exState = ExportStateDllInterfaceVersionError;
return false;
}
// Default error info.
info->exState = ExportStateUnknownActionItemOrActionType;
info->expDatResultSize = 0;
info->voidPtr = NULL;
// -----------------------------------------
// Create the context pointer to data memory.
// -----------------------------------------
switch (info->index)
{
case kCsumBytesum___Into16Bit_BEout:
case kCsumBytesum___Into16Bit_LEout:
case kCsumWordsumBE_Into16Bit_BEout:
case kCsumWordsumLE_Into16Bit_LEout:
case kCsumBytesum___Into2Compl16Bit_BEout:
case kCsumWordsumBE_Into2Compl16Bit_BEout:
case kCsumWordsumLE_Into2Compl16Bit_LEout:
case kCsumCRC16CCITT_X25_LEout_CAFE:
case kCsumCRC16CCITT_X25_BEout_CAFE:
info->voidPtr = ExpDat_AllocWorkspace(sizeof(unsigned short));
rval = true;
break;
default:
break;
}
return rval;
}
/**********************************************************************************************************************
* DoCalculateChecksum()
**********************************************************************************************************************/
/*! \brief Does the checksum operation.
* \details This function runs the checksum calculation. It can be called several times.
* At least three times per block (see actionState).
* \param[in] info: The workspace for the operation.
* \param[in] actionState: One of the three action states in sequence:
* csumActionBegin: Initialises the checksum operation.
* csumActionDoData: Performs the operation on the given data of a block.
* Can be called multiple times, one time per data block (continuous address space).
* csumActionEnd: Concludes the checksum operation and provides the result.
* \return True if operation was successful
* False otherwise.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* If the return value is false, then the exState contains a more detailed error indication.
**********************************************************************************************************************/
DLL_FUNC(bool) DoCalculateChecksum(TExportDataInfo *info,
EChecksumAction actionState)
{
bool result=false;
/* Check for interface version */
if (info->DllInterfaceVersion != DllInterfaceVersion)
{
info->exState = ExportStateDllInterfaceVersionError;
return false;
}
// Default error info.
info->exState = ExportStateUnknownActionItemOrActionType;
if (actionState==CSumActionBegin)
{
/* Initialise the workspace per operation */
result = BeginChecksumCalculation(info);
}
else if (actionState==CSumActionDoData)
{
/* Run the checksum calculation */
result = DoChecksumCalculation(info);
}
else if (actionState==CSumActionEnd)
{
/* Conclude the checksum calculation and provide the results */
info->expDatResultSize = EXPDAT_RESULTS_MAXSIZE;
result = EndChecksumCalculation(info, info->expDatResults, &(info->expDatResultSize));
/* A copy is placed in a special buffer for the commandline */
if (result==true)
{
info->segOutData = (char *)info->expDatResults;
info->segOutLength = info->expDatResultSize; // 2 byte data in output.
}
else
{
info->expDatResultSize = 0;
}
}
return result;
}
/**********************************************************************************************************************
* DeinitChecksum()
**********************************************************************************************************************/
/*! \brief Concludes a checksum operation.
* \param[in] info: The workspace for the operation.
* \return True if operation was successful
* False otherwise.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* If the return value is false, then the exState contains a more detailed error indication.
**********************************************************************************************************************/
DLL_FUNC(bool) DeinitChecksum( TExportDataInfo *info )
{
bool rval=false;
/* Check for interface version */
if (info->DllInterfaceVersion != DllInterfaceVersion)
{
info->exState = ExportStateDllInterfaceVersionError;
return false;
}
// Default error info.
info->exState = ExportStateUnknownActionItemOrActionType;
// -----------------------------------------
// Delete the context data memory
// -----------------------------------------
switch (info->index)
{
case kCsumBytesum___Into16Bit_BEout:
case kCsumBytesum___Into16Bit_LEout:
case kCsumWordsumBE_Into16Bit_BEout:
case kCsumWordsumLE_Into16Bit_LEout:
case kCsumBytesum___Into2Compl16Bit_BEout:
case kCsumWordsumBE_Into2Compl16Bit_BEout:
case kCsumWordsumLE_Into2Compl16Bit_LEout:
case kCsumCRC16CCITT_X25_LEout_CAFE:
case kCsumCRC16CCITT_X25_BEout_CAFE:
ExpDat_FreeWorkspace((void **)&(info->voidPtr));
rval = true;
break;
default:
break;
}
return rval;
}
#ifdef __cplusplus
}
#endif
/**********************************************************************************************************************
* END OF FILE: expdat_csum.cpp
*********************************************************************************************************************/

View File

@ -0,0 +1,111 @@
/**********************************************************************************************************************
* COPYRIGHT
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
* Copyright (c) 2014 by Vector Informatik GmbH. All rights reserved.
*
* This software is copyright protected and proprietary to Vector Informatik GmbH.
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
* All other rights remain with Vector Informatik GmbH.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -----------------------------------------------------------------------------------------------------------------*/
/** \file expdat_csum.h
* \brief Implementation of the checksum calculation functions.
*
* \details This file contains the interface functions for the checksum calculations.
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* AUTHOR IDENTITY
* -------------------------------------------------------------------------------------------------------------------
* Name Initials Company
* -------------------------------------------------------------------------------------------------------------------
* Armin Happel vishp Vector Informatik GmbH
* -------------------------------------------------------------------------------------------------------------------
* REVISION HISTORY
* -------------------------------------------------------------------------------------------------------------------
* Version Date Author Change Id Description
* -------------------------------------------------------------------------------------------------------------------
* 01.00.00 2014-12-18 vishp Creation
*********************************************************************************************************************/
#if !defined (__EXPDAT_CSUM_H__)
#define __EXPDAT_CSUM_H__
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL CONSTANT MACROS
*********************************************************************************************************************/
typedef enum
{
kCsumBytesum___Into16Bit_BEout //0 // VAG-style (A)
,kCsumBytesum___Into16Bit_LEout //1 // VAG-style (B)
,kCsumWordsumBE_Into16Bit_BEout //2
,kCsumWordsumLE_Into16Bit_LEout //3
,kCsumBytesum___Into2Compl16Bit_BEout //4 // GM old style
,kCsumWordsumBE_Into2Compl16Bit_BEout //5
,kCsumWordsumLE_Into2Compl16Bit_LEout //6
,kCsumCRC16Standard_LEout // 7
,kCsumCRC16CCITT_LEout // 8 // unused and errorneous
,kCsumCRC32Standard_LEout // 9
,kCsumHashSHA1 // 10
,kCsumHashRIPEMD160 // 11
,kCsumWordsumLE_Into2Compl16Bit_BEout // 12
,kCsumCRC16CCITTTable_LEout //13
,kCsumCRC16CCITTTable_BEout // 14
,kCsumHashMD5 // 15
,kCsumConstant //16
,kCsumCRC16CCITT_X25_LEout //17 /* Hella specific */
,kCsumCRC16CCITT_X25_BEout //18 /* Hella specific */
, kCsumHashSHA512 //19
, kCsumHashSHA256 //20
,kCsumCRC16CCITT_X25_LEout_CAFE // 21 PREH specific X.25 calculation
,kCsumCRC16CCITT_X25_BEout_CAFE // 22: Same as 21, but with different result endianess
,kCsumItems // /* Total number of items in Csum. Must always be the last entry. */
} ECsumMethodNames;
/**********************************************************************************************************************
* GLOBAL FUNCTION MACROS
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL DATA TYPES AND STRUCTURES
*********************************************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************************************************************************************
* GLOBAL DATA PROTOTYPES
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL FUNCTION PROTOTYPES
*********************************************************************************************************************/
/* Global function prototypes can be found in expdat.h */
#ifdef __cplusplus
}
#endif
#endif /* __EXPDAT_CSUM_H__ */
/**********************************************************************************************************************
* END OF FILE: expdat_csum.h
*********************************************************************************************************************/

View File

@ -0,0 +1,346 @@
/**********************************************************************************************************************
* COPYRIGHT
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
* Copyright (c) 2014 by Vector Informatik GmbH. All rights reserved.
*
* This software is copyright protected and proprietary to Vector Informatik GmbH.
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
* All other rights remain with Vector Informatik GmbH.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -----------------------------------------------------------------------------------------------------------------*/
/** \file expdat_csumTables.cpp
* \brief Contains the checksum tables for CRC calculaton.
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* AUTHOR IDENTITY
* -------------------------------------------------------------------------------------------------------------------
* Name Initials Company
* -------------------------------------------------------------------------------------------------------------------
* Armin Happel vishp Vector Informatik GmbH
* -------------------------------------------------------------------------------------------------------------------
* REVISION HISTORY
* -------------------------------------------------------------------------------------------------------------------
* Version Date Author Change Id Description
* -------------------------------------------------------------------------------------------------------------------
* 01.00.00 2014-12-18 vishp Creation
*********************************************************************************************************************/
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#endif
#include "expdat.h"
#include "expdat_csum.h"
#include "expdat_csumTables.h"
/**********************************************************************************************************************
* LOCAL CONSTANT MACROS
**********************************************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************************************************************************************
* LOCAL FUNCTION MACROS
**********************************************************************************************************************/
/**********************************************************************************************************************
* LOCAL DATA TYPES AND STRUCTURES
**********************************************************************************************************************/
/**********************************************************************************************************************
* LOCAL DATA
**********************************************************************************************************************/
/** Declaration of local and uninitialized vars ***********************************************************************/
/**********************************************************************************************************************
* GLOBAL DATA
**********************************************************************************************************************/
/** Declaration of global and initialized vars ***********************************************************************/
const WORD CRC16CCITTtab[256] = {
#if defined ( XCP_ENABLE_CRC16CCITT_REFLECTED )
0x0000,0x1189,0x2312,0x329B,0x4624,0x57AD,0x6536,0x74BF,
0x8C48,0x9DC1,0xAF5A,0xBED3,0xCA6C,0xDBE5,0xE97E,0xF8F7,
0x1081,0x0108,0x3393,0x221A,0x56A5,0x472C,0x75B7,0x643E,
0x9CC9,0x8D40,0xBFDB,0xAE52,0xDAED,0xCB64,0xF9FF,0xE876,
0x2102,0x308B,0x0210,0x1399,0x6726,0x76AF,0x4434,0x55BD,
0xAD4A,0xBCC3,0x8E58,0x9FD1,0xEB6E,0xFAE7,0xC87C,0xD9F5,
0x3183,0x200A,0x1291,0x0318,0x77A7,0x662E,0x54B5,0x453C,
0xBDCB,0xAC42,0x9ED9,0x8F50,0xFBEF,0xEA66,0xD8FD,0xC974,
0x4204,0x538D,0x6116,0x709F,0x0420,0x15A9,0x2732,0x36BB,
0xCE4C,0xDFC5,0xED5E,0xFCD7,0x8868,0x99E1,0xAB7A,0xBAF3,
0x5285,0x430C,0x7197,0x601E,0x14A1,0x0528,0x37B3,0x263A,
0xDECD,0xCF44,0xFDDF,0xEC56,0x98E9,0x8960,0xBBFB,0xAA72,
0x6306,0x728F,0x4014,0x519D,0x2522,0x34AB,0x0630,0x17B9,
0xEF4E,0xFEC7,0xCC5C,0xDDD5,0xA96A,0xB8E3,0x8A78,0x9BF1,
0x7387,0x620E,0x5095,0x411C,0x35A3,0x242A,0x16B1,0x0738,
0xFFCF,0xEE46,0xDCDD,0xCD54,0xB9EB,0xA862,0x9AF9,0x8B70,
0x8408,0x9581,0xA71A,0xB693,0xC22C,0xD3A5,0xE13E,0xF0B7,
0x0840,0x19C9,0x2B52,0x3ADB,0x4E64,0x5FED,0x6D76,0x7CFF,
0x9489,0x8500,0xB79B,0xA612,0xD2AD,0xC324,0xF1BF,0xE036,
0x18C1,0x0948,0x3BD3,0x2A5A,0x5EE5,0x4F6C,0x7DF7,0x6C7E,
0xA50A,0xB483,0x8618,0x9791,0xE32E,0xF2A7,0xC03C,0xD1B5,
0x2942,0x38CB,0x0A50,0x1BD9,0x6F66,0x7EEF,0x4C74,0x5DFD,
0xB58B,0xA402,0x9699,0x8710,0xF3AF,0xE226,0xD0BD,0xC134,
0x39C3,0x284A,0x1AD1,0x0B58,0x7FE7,0x6E6E,0x5CF5,0x4D7C,
0xC60C,0xD785,0xE51E,0xF497,0x8028,0x91A1,0xA33A,0xB2B3,
0x4A44,0x5BCD,0x6956,0x78DF,0x0C60,0x1DE9,0x2F72,0x3EFB,
0xD68D,0xC704,0xF59F,0xE416,0x90A9,0x8120,0xB3BB,0xA232,
0x5AC5,0x4B4C,0x79D7,0x685E,0x1CE1,0x0D68,0x3FF3,0x2E7A,
0xE70E,0xF687,0xC41C,0xD595,0xA12A,0xB0A3,0x8238,0x93B1,
0x6B46,0x7ACF,0x4854,0x59DD,0x2D62,0x3CEB,0x0E70,0x1FF9,
0xF78F,0xE606,0xD49D,0xC514,0xB1AB,0xA022,0x92B9,0x8330,
0x7BC7,0x6A4E,0x58D5,0x495C,0x3DE3,0x2C6A,0x1EF1,0x0F78
#else
0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7u,
0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1efu,
0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6u,
0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3deu,
0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485u,
0xa56a,0xb54b,0x8528,0x9509,0xe5ee,0xf5cf,0xc5ac,0xd58du,
0x3653,0x2672,0x1611,0x0630,0x76d7,0x66f6,0x5695,0x46b4u,
0xb75b,0xa77a,0x9719,0x8738,0xf7df,0xe7fe,0xd79d,0xc7bcu,
0x48c4,0x58e5,0x6886,0x78a7,0x0840,0x1861,0x2802,0x3823u,
0xc9cc,0xd9ed,0xe98e,0xf9af,0x8948,0x9969,0xa90a,0xb92bu,
0x5af5,0x4ad4,0x7ab7,0x6a96,0x1a71,0x0a50,0x3a33,0x2a12u,
0xdbfd,0xcbdc,0xfbbf,0xeb9e,0x9b79,0x8b58,0xbb3b,0xab1au,
0x6ca6,0x7c87,0x4ce4,0x5cc5,0x2c22,0x3c03,0x0c60,0x1c41u,
0xedae,0xfd8f,0xcdec,0xddcd,0xad2a,0xbd0b,0x8d68,0x9d49u,
0x7e97,0x6eb6,0x5ed5,0x4ef4,0x3e13,0x2e32,0x1e51,0x0e70u,
0xff9f,0xefbe,0xdfdd,0xcffc,0xbf1b,0xaf3a,0x9f59,0x8f78u,
0x9188,0x81a9,0xb1ca,0xa1eb,0xd10c,0xc12d,0xf14e,0xe16fu,
0x1080,0x00a1,0x30c2,0x20e3,0x5004,0x4025,0x7046,0x6067u,
0x83b9,0x9398,0xa3fb,0xb3da,0xc33d,0xd31c,0xe37f,0xf35eu,
0x02b1,0x1290,0x22f3,0x32d2,0x4235,0x5214,0x6277,0x7256u,
0xb5ea,0xa5cb,0x95a8,0x8589,0xf56e,0xe54f,0xd52c,0xc50du,
0x34e2,0x24c3,0x14a0,0x0481,0x7466,0x6447,0x5424,0x4405u,
0xa7db,0xb7fa,0x8799,0x97b8,0xe75f,0xf77e,0xc71d,0xd73cu,
0x26d3,0x36f2,0x0691,0x16b0,0x6657,0x7676,0x4615,0x5634u,
0xd94c,0xc96d,0xf90e,0xe92f,0x99c8,0x89e9,0xb98a,0xa9abu,
0x5844,0x4865,0x7806,0x6827,0x18c0,0x08e1,0x3882,0x28a3u,
0xcb7d,0xdb5c,0xeb3f,0xfb1e,0x8bf9,0x9bd8,0xabbb,0xbb9au,
0x4a75,0x5a54,0x6a37,0x7a16,0x0af1,0x1ad0,0x2ab3,0x3a92u,
0xfd2e,0xed0f,0xdd6c,0xcd4d,0xbdaa,0xad8b,0x9de8,0x8dc9u,
0x7c26,0x6c07,0x5c64,0x4c45,0x3ca2,0x2c83,0x1ce0,0x0cc1u,
0xef1f,0xff3e,0xcf5d,0xdf7c,0xaf9b,0xbfba,0x8fd9,0x9ff8u,
0x6e17,0x7e36,0x4e55,0x5e74,0x2e93,0x3eb2,0x0ed1,0x1ef0u
#endif /* defined ( XCP_ENABLE_CRC16CCITT_REFLECTED ) */
};
/* Table for 32-Bit CRC */
const DWORD crc32Table[256] =
{
0x00000000uL, 0x77073096uL, 0xEE0E612CuL, 0x990951BAuL,
0x076DC419uL, 0x706AF48FuL, 0xE963A535uL, 0x9E6495A3uL,
0x0EDB8832uL, 0x79DCB8A4uL, 0xE0D5E91EuL, 0x97D2D988uL,
0x09B64C2BuL, 0x7EB17CBDuL, 0xE7B82D07uL, 0x90BF1D91uL,
0x1DB71064uL, 0x6AB020F2uL, 0xF3B97148uL, 0x84BE41DEuL,
0x1ADAD47DuL, 0x6DDDE4EBuL, 0xF4D4B551uL, 0x83D385C7uL,
0x136C9856uL, 0x646BA8C0uL, 0xFD62F97AuL, 0x8A65C9ECuL,
0x14015C4FuL, 0x63066CD9uL, 0xFA0F3D63uL, 0x8D080DF5uL,
0x3B6E20C8uL, 0x4C69105EuL, 0xD56041E4uL, 0xA2677172uL,
0x3C03E4D1uL, 0x4B04D447uL, 0xD20D85FDuL, 0xA50AB56BuL,
0x35B5A8FAuL, 0x42B2986CuL, 0xDBBBC9D6uL, 0xACBCF940uL,
0x32D86CE3uL, 0x45DF5C75uL, 0xDCD60DCFuL, 0xABD13D59uL,
0x26D930ACuL, 0x51DE003AuL, 0xC8D75180uL, 0xBFD06116uL,
0x21B4F4B5uL, 0x56B3C423uL, 0xCFBA9599uL, 0xB8BDA50FuL,
0x2802B89EuL, 0x5F058808uL, 0xC60CD9B2uL, 0xB10BE924uL,
0x2F6F7C87uL, 0x58684C11uL, 0xC1611DABuL, 0xB6662D3DuL,
0x76DC4190uL, 0x01DB7106uL, 0x98D220BCuL, 0xEFD5102AuL,
0x71B18589uL, 0x06B6B51FuL, 0x9FBFE4A5uL, 0xE8B8D433uL,
0x7807C9A2uL, 0x0F00F934uL, 0x9609A88EuL, 0xE10E9818uL,
0x7F6A0DBBuL, 0x086D3D2DuL, 0x91646C97uL, 0xE6635C01uL,
0x6B6B51F4uL, 0x1C6C6162uL, 0x856530D8uL, 0xF262004EuL,
0x6C0695EDuL, 0x1B01A57BuL, 0x8208F4C1uL, 0xF50FC457uL,
0x65B0D9C6uL, 0x12B7E950uL, 0x8BBEB8EAuL, 0xFCB9887CuL,
0x62DD1DDFuL, 0x15DA2D49uL, 0x8CD37CF3uL, 0xFBD44C65uL,
0x4DB26158uL, 0x3AB551CEuL, 0xA3BC0074uL, 0xD4BB30E2uL,
0x4ADFA541uL, 0x3DD895D7uL, 0xA4D1C46DuL, 0xD3D6F4FBuL,
0x4369E96AuL, 0x346ED9FCuL, 0xAD678846uL, 0xDA60B8D0uL,
0x44042D73uL, 0x33031DE5uL, 0xAA0A4C5FuL, 0xDD0D7CC9uL,
0x5005713CuL, 0x270241AAuL, 0xBE0B1010uL, 0xC90C2086uL,
0x5768B525uL, 0x206F85B3uL, 0xB966D409uL, 0xCE61E49FuL,
0x5EDEF90EuL, 0x29D9C998uL, 0xB0D09822uL, 0xC7D7A8B4uL,
0x59B33D17uL, 0x2EB40D81uL, 0xB7BD5C3BuL, 0xC0BA6CADuL,
0xEDB88320uL, 0x9ABFB3B6uL, 0x03B6E20CuL, 0x74B1D29AuL,
0xEAD54739uL, 0x9DD277AFuL, 0x04DB2615uL, 0x73DC1683uL,
0xE3630B12uL, 0x94643B84uL, 0x0D6D6A3EuL, 0x7A6A5AA8uL,
0xE40ECF0BuL, 0x9309FF9DuL, 0x0A00AE27uL, 0x7D079EB1uL,
0xF00F9344uL, 0x8708A3D2uL, 0x1E01F268uL, 0x6906C2FEuL,
0xF762575DuL, 0x806567CBuL, 0x196C3671uL, 0x6E6B06E7uL,
0xFED41B76uL, 0x89D32BE0uL, 0x10DA7A5AuL, 0x67DD4ACCuL,
0xF9B9DF6FuL, 0x8EBEEFF9uL, 0x17B7BE43uL, 0x60B08ED5uL,
0xD6D6A3E8uL, 0xA1D1937EuL, 0x38D8C2C4uL, 0x4FDFF252uL,
0xD1BB67F1uL, 0xA6BC5767uL, 0x3FB506DDuL, 0x48B2364BuL,
0xD80D2BDAuL, 0xAF0A1B4CuL, 0x36034AF6uL, 0x41047A60uL,
0xDF60EFC3uL, 0xA867DF55uL, 0x316E8EEFuL, 0x4669BE79uL,
0xCB61B38CuL, 0xBC66831AuL, 0x256FD2A0uL, 0x5268E236uL,
0xCC0C7795uL, 0xBB0B4703uL, 0x220216B9uL, 0x5505262FuL,
0xC5BA3BBEuL, 0xB2BD0B28uL, 0x2BB45A92uL, 0x5CB36A04uL,
0xC2D7FFA7uL, 0xB5D0CF31uL, 0x2CD99E8BuL, 0x5BDEAE1DuL,
0x9B64C2B0uL, 0xEC63F226uL, 0x756AA39CuL, 0x026D930AuL,
0x9C0906A9uL, 0xEB0E363FuL, 0x72076785uL, 0x05005713uL,
0x95BF4A82uL, 0xE2B87A14uL, 0x7BB12BAEuL, 0x0CB61B38uL,
0x92D28E9BuL, 0xE5D5BE0DuL, 0x7CDCEFB7uL, 0x0BDBDF21uL,
0x86D3D2D4uL, 0xF1D4E242uL, 0x68DDB3F8uL, 0x1FDA836EuL,
0x81BE16CDuL, 0xF6B9265BuL, 0x6FB077E1uL, 0x18B74777uL,
0x88085AE6uL, 0xFF0F6A70uL, 0x66063BCAuL, 0x11010B5CuL,
0x8F659EFFuL, 0xF862AE69uL, 0x616BFFD3uL, 0x166CCF45uL,
0xA00AE278uL, 0xD70DD2EEuL, 0x4E048354uL, 0x3903B3C2uL,
0xA7672661uL, 0xD06016F7uL, 0x4969474DuL, 0x3E6E77DBuL,
0xAED16A4AuL, 0xD9D65ADCuL, 0x40DF0B66uL, 0x37D83BF0uL,
0xA9BCAE53uL, 0xDEBB9EC5uL, 0x47B2CF7FuL, 0x30B5FFE9uL,
0xBDBDF21CuL, 0xCABAC28AuL, 0x53B39330uL, 0x24B4A3A6uL,
0xBAD03605uL, 0xCDD70693uL, 0x54DE5729uL, 0x23D967BFuL,
0xB3667A2EuL, 0xC4614AB8uL, 0x5D681B02uL, 0x2A6F2B94uL,
0xB40BBE37uL, 0xC30C8EA1uL, 0x5A05DF1BuL, 0x2D02EF8DuL
};
/* Table for 16-Bit CRC */
const unsigned short crc16Table[256] = /* CRC lookup table */
{
0x0000u, 0xC0C1u, 0xC181u, 0x0140u, 0xC301u, 0x03C0u, 0x0280u, 0xC241u,
0xC601u, 0x06C0u, 0x0780u, 0xC741u, 0x0500u, 0xC5C1u, 0xC481u, 0x0440u,
0xCC01u, 0x0CC0u, 0x0D80u, 0xCD41u, 0x0F00u, 0xCFC1u, 0xCE81u, 0x0E40u,
0x0A00u, 0xCAC1u, 0xCB81u, 0x0B40u, 0xC901u, 0x09C0u, 0x0880u, 0xC841u,
0xD801u, 0x18C0u, 0x1980u, 0xD941u, 0x1B00u, 0xDBC1u, 0xDA81u, 0x1A40u,
0x1E00u, 0xDEC1u, 0xDF81u, 0x1F40u, 0xDD01u, 0x1DC0u, 0x1C80u, 0xDC41u,
0x1400u, 0xD4C1u, 0xD581u, 0x1540u, 0xD701u, 0x17C0u, 0x1680u, 0xD641u,
0xD201u, 0x12C0u, 0x1380u, 0xD341u, 0x1100u, 0xD1C1u, 0xD081u, 0x1040u,
0xF001u, 0x30C0u, 0x3180u, 0xF141u, 0x3300u, 0xF3C1u, 0xF281u, 0x3240u,
0x3600u, 0xF6C1u, 0xF781u, 0x3740u, 0xF501u, 0x35C0u, 0x3480u, 0xF441u,
0x3C00u, 0xFCC1u, 0xFD81u, 0x3D40u, 0xFF01u, 0x3FC0u, 0x3E80u, 0xFE41u,
0xFA01u, 0x3AC0u, 0x3B80u, 0xFB41u, 0x3900u, 0xF9C1u, 0xF881u, 0x3840u,
0x2800u, 0xE8C1u, 0xE981u, 0x2940u, 0xEB01u, 0x2BC0u, 0x2A80u, 0xEA41u,
0xEE01u, 0x2EC0u, 0x2F80u, 0xEF41u, 0x2D00u, 0xEDC1u, 0xEC81u, 0x2C40u,
0xE401u, 0x24C0u, 0x2580u, 0xE541u, 0x2700u, 0xE7C1u, 0xE681u, 0x2640u,
0x2200u, 0xE2C1u, 0xE381u, 0x2340u, 0xE101u, 0x21C0u, 0x2080u, 0xE041u,
0xA001u, 0x60C0u, 0x6180u, 0xA141u, 0x6300u, 0xA3C1u, 0xA281u, 0x6240u,
0x6600u, 0xA6C1u, 0xA781u, 0x6740u, 0xA501u, 0x65C0u, 0x6480u, 0xA441u,
0x6C00u, 0xACC1u, 0xAD81u, 0x6D40u, 0xAF01u, 0x6FC0u, 0x6E80u, 0xAE41u,
0xAA01u, 0x6AC0u, 0x6B80u, 0xAB41u, 0x6900u, 0xA9C1u, 0xA881u, 0x6840u,
0x7800u, 0xB8C1u, 0xB981u, 0x7940u, 0xBB01u, 0x7BC0u, 0x7A80u, 0xBA41u,
0xBE01u, 0x7EC0u, 0x7F80u, 0xBF41u, 0x7D00u, 0xBDC1u, 0xBC81u, 0x7C40u,
0xB401u, 0x74C0u, 0x7580u, 0xB541u, 0x7700u, 0xB7C1u, 0xB681u, 0x7640u,
0x7200u, 0xB2C1u, 0xB381u, 0x7340u, 0xB101u, 0x71C0u, 0x7080u, 0xB041u,
0x5000u, 0x90C1u, 0x9181u, 0x5140u, 0x9301u, 0x53C0u, 0x5280u, 0x9241u,
0x9601u, 0x56C0u, 0x5780u, 0x9741u, 0x5500u, 0x95C1u, 0x9481u, 0x5440u,
0x9C01u, 0x5CC0u, 0x5D80u, 0x9D41u, 0x5F00u, 0x9FC1u, 0x9E81u, 0x5E40u,
0x5A00u, 0x9AC1u, 0x9B81u, 0x5B40u, 0x9901u, 0x59C0u, 0x5880u, 0x9841u,
0x8801u, 0x48C0u, 0x4980u, 0x8941u, 0x4B00u, 0x8BC1u, 0x8A81u, 0x4A40u,
0x4E00u, 0x8EC1u, 0x8F81u, 0x4F40u, 0x8D01u, 0x4DC0u, 0x4C80u, 0x8C41u,
0x4400u, 0x84C1u, 0x8581u, 0x4540u, 0x8701u, 0x47C0u, 0x4680u, 0x8641u,
0x8201u, 0x42C0u, 0x4380u, 0x8341u, 0x4100u, 0x81C1u, 0x8081u, 0x4040u
};
/* Table for 16-Bit CCITT X.25 CRC */
const int gCrc16X25Table[256] = /* CRC lookup table */
{
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
0x11231, 0x10210, 0x13273, 0x12252, 0x152b5, 0x14294, 0x172f7, 0x162d6,
0x19339, 0x18318, 0x1b37b, 0x1a35a, 0x1d3bd, 0x1c39c, 0x1f3ff, 0x1e3de,
0x22462, 0x23443, 0x20420, 0x21401, 0x264e6, 0x274c7, 0x244a4, 0x25485,
0x2a56a, 0x2b54b, 0x28528, 0x29509, 0x2e5ee, 0x2f5cf, 0x2c5ac, 0x2d58d,
0x33653, 0x32672, 0x31611, 0x30630, 0x376d7, 0x366f6, 0x35695, 0x346b4,
0x3b75b, 0x3a77a, 0x39719, 0x38738, 0x3f7df, 0x3e7fe, 0x3d79d, 0x3c7bc,
0x448c4, 0x458e5, 0x46886, 0x478a7, 0x40840, 0x41861, 0x42802, 0x43823,
0x4c9cc, 0x4d9ed, 0x4e98e, 0x4f9af, 0x48948, 0x49969, 0x4a90a, 0x4b92b,
0x55af5, 0x54ad4, 0x57ab7, 0x56a96, 0x51a71, 0x50a50, 0x53a33, 0x52a12,
0x5dbfd, 0x5cbdc, 0x5fbbf, 0x5eb9e, 0x59b79, 0x58b58, 0x5bb3b, 0x5ab1a,
0x66ca6, 0x67c87, 0x64ce4, 0x65cc5, 0x62c22, 0x63c03, 0x60c60, 0x61c41,
0x6edae, 0x6fd8f, 0x6cdec, 0x6ddcd, 0x6ad2a, 0x6bd0b, 0x68d68, 0x69d49,
0x77e97, 0x76eb6, 0x75ed5, 0x74ef4, 0x73e13, 0x72e32, 0x71e51, 0x70e70,
0x7ff9f, 0x7efbe, 0x7dfdd, 0x7cffc, 0x7bf1b, 0x7af3a, 0x79f59, 0x78f78,
0x89188, 0x881a9, 0x8b1ca, 0x8a1eb, 0x8d10c, 0x8c12d, 0x8f14e, 0x8e16f,
0x81080, 0x800a1, 0x830c2, 0x820e3, 0x85004, 0x84025, 0x87046, 0x86067,
0x983b9, 0x99398, 0x9a3fb, 0x9b3da, 0x9c33d, 0x9d31c, 0x9e37f, 0x9f35e,
0x902b1, 0x91290, 0x922f3, 0x932d2, 0x94235, 0x95214, 0x96277, 0x97256,
0xab5ea, 0xaa5cb, 0xa95a8, 0xa8589, 0xaf56e, 0xae54f, 0xad52c, 0xac50d,
0xa34e2, 0xa24c3, 0xa14a0, 0xa0481, 0xa7466, 0xa6447, 0xa5424, 0xa4405,
0xba7db, 0xbb7fa, 0xb8799, 0xb97b8, 0xbe75f, 0xbf77e, 0xbc71d, 0xbd73c,
0xb26d3, 0xb36f2, 0xb0691, 0xb16b0, 0xb6657, 0xb7676, 0xb4615, 0xb5634,
0xcd94c, 0xcc96d, 0xcf90e, 0xce92f, 0xc99c8, 0xc89e9, 0xcb98a, 0xca9ab,
0xc5844, 0xc4865, 0xc7806, 0xc6827, 0xc18c0, 0xc08e1, 0xc3882, 0xc28a3,
0xdcb7d, 0xddb5c, 0xdeb3f, 0xdfb1e, 0xd8bf9, 0xd9bd8, 0xdabbb, 0xdbb9a,
0xd4a75, 0xd5a54, 0xd6a37, 0xd7a16, 0xd0af1, 0xd1ad0, 0xd2ab3, 0xd3a92,
0xefd2e, 0xeed0f, 0xedd6c, 0xecd4d, 0xebdaa, 0xead8b, 0xe9de8, 0xe8dc9,
0xe7c26, 0xe6c07, 0xe5c64, 0xe4c45, 0xe3ca2, 0xe2c83, 0xe1ce0, 0xe0cc1,
0xfef1f, 0xfff3e, 0xfcf5d, 0xfdf7c, 0xfaf9b, 0xfbfba, 0xf8fd9, 0xf9ff8,
0xf6e17, 0xf7e36, 0xf4e55, 0xf5e74, 0xf2e93, 0xf3eb2, 0xf0ed1, 0xf1ef0
};
/* Specific X25 table from PREH */
const WORD kausCrcTable16_cafe[256] = {
0x0000u, 0x1021u, 0x2042u, 0x3063u, 0x4084u, 0x50a5u, 0x60c6u, 0x70e7u, 0x8108u, 0x9129u, 0xa14au, 0xb16bu, 0xc18cu, 0xd1adu, 0xe1ceu, 0xf1efu,
0x1231u, 0x0210u, 0x3273u, 0x2252u, 0x52b5u, 0x4294u, 0x72f7u, 0x62d6u, 0x9339u, 0x8318u, 0xb37bu, 0xa35au, 0xd3bdu, 0xc39cu, 0xf3ffu, 0xe3deu,
0x2462u, 0x3443u, 0x0420u, 0x1401u, 0x64e6u, 0x74c7u, 0x44a4u, 0x5485u, 0xa56au, 0xb54bu, 0x8528u, 0x9509u, 0xe5eeu, 0xf5cfu, 0xc5acu, 0xd58du,
0x3653u, 0x2672u, 0x1611u, 0x0630u, 0x76d7u, 0x66f6u, 0x5695u, 0x46b4u, 0xb75bu, 0xa77au, 0x9719u, 0x8738u, 0xf7dfu, 0xe7feu, 0xd79du, 0xc7bcu,
0x48c4u, 0x58e5u, 0x6886u, 0x78a7u, 0x0840u, 0x1861u, 0x2802u, 0x3823u, 0xc9ccu, 0xd9edu, 0xe98eu, 0xf9afu, 0x8948u, 0x9969u, 0xa90au, 0xb92bu,
0x5af5u, 0x4ad4u, 0x7ab7u, 0x6a96u, 0x1a71u, 0x0a50u, 0x3a33u, 0x2a12u, 0xdbfdu, 0xcbdcu, 0xfbbfu, 0xeb9eu, 0x9b79u, 0x8b58u, 0xbb3bu, 0xab1au,
0x6ca6u, 0x7c87u, 0x4ce4u, 0x5cc5u, 0x2c22u, 0x3c03u, 0x0c60u, 0x1c41u, 0xedaeu, 0xfd8fu, 0xcdecu, 0xddcdu, 0xad2au, 0xbd0bu, 0x8d68u, 0x9d49u,
0x7e97u, 0x6eb6u, 0x5ed5u, 0x4ef4u, 0x3e13u, 0x2e32u, 0x1e51u, 0x0e70u, 0xff9fu, 0xefbeu, 0xdfddu, 0xcffcu, 0xbf1bu, 0xaf3au, 0x9f59u, 0x8f78u,
0x9188u, 0x81a9u, 0xb1cau, 0xa1ebu, 0xd10cu, 0xc12du, 0xf14eu, 0xe16fu, 0x1080u, 0x00a1u, 0x30c2u, 0x20e3u, 0x5004u, 0x4025u, 0x7046u, 0x6067u,
0x83b9u, 0x9398u, 0xa3fbu, 0xb3dau, 0xc33du, 0xd31cu, 0xe37fu, 0xf35eu, 0x02b1u, 0x1290u, 0x22f3u, 0x32d2u, 0x4235u, 0x5214u, 0x6277u, 0x7256u,
0xb5eau, 0xa5cbu, 0x95a8u, 0x8589u, 0xf56eu, 0xe54fu, 0xd52cu, 0xc50du, 0x34e2u, 0x24c3u, 0x14a0u, 0x0481u, 0x7466u, 0x6447u, 0x5424u, 0x4405u,
0xa7dbu, 0xb7fau, 0x8799u, 0x97b8u, 0xe75fu, 0xf77eu, 0xc71du, 0xd73cu, 0x26d3u, 0x36f2u, 0x0691u, 0x16b0u, 0x6657u, 0x7676u, 0x4615u, 0x5634u,
0xd94cu, 0xc96du, 0xf90eu, 0xe92fu, 0x99c8u, 0x89e9u, 0xb98au, 0xa9abu, 0x5844u, 0x4865u, 0x7806u, 0x6827u, 0x18c0u, 0x08e1u, 0x3882u, 0x28a3u,
0xcb7du, 0xdb5cu, 0xeb3fu, 0xfb1eu, 0x8bf9u, 0x9bd8u, 0xabbbu, 0xbb9au, 0x4a75u, 0x5a54u, 0x6a37u, 0x7a16u, 0x0af1u, 0x1ad0u, 0x2ab3u, 0x3a92u,
0xfd2eu, 0xed0fu, 0xdd6cu, 0xcd4du, 0xbdaau, 0xad8bu, 0x9de8u, 0x8dc9u, 0x7c26u, 0x6c07u, 0x5c64u, 0x4c45u, 0x3ca2u, 0x2c83u, 0x1ce0u, 0x0cc1u,
0xef1fu, 0xff3eu, 0xcf5du, 0xdf7cu, 0xaf9bu, 0xbfbau, 0x8fd9u, 0x9ff8u, 0x6e17u, 0x7e36u, 0x4e55u, 0x5e74u, 0x2e93u, 0x3eb2u, 0x0ed1u, 0x1ef0u
};
/* Hella shift value */
#define HELLA_B8 0x0008U
/**********************************************************************************************************************
* LOCAL FUNCTION PROTOTYPES
**********************************************************************************************************************/
/**********************************************************************************************************************
**********************************************************************************************************************
* LOCAL FUNCTIONS
**********************************************************************************************************************
**********************************************************************************************************************/
/**********************************************************************************************************************
**********************************************************************************************************************
* GLOBAL FUNCTIONS
**********************************************************************************************************************
**********************************************************************************************************************/
#ifdef __cplusplus
}
#endif
/**********************************************************************************************************************
* END OF FILE: expdat_csum.cpp
*********************************************************************************************************************/

View File

@ -0,0 +1,90 @@
/**********************************************************************************************************************
* COPYRIGHT
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
* Copyright (c) 2014 by Vector Informatik GmbH. All rights reserved.
*
* This software is copyright protected and proprietary to Vector Informatik GmbH.
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
* All other rights remain with Vector Informatik GmbH.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -----------------------------------------------------------------------------------------------------------------*/
/** \file expdat_csum.h
* \brief Implementation of the checksum calculation functions.
*
* \details This file contains the interface functions for the checksum calculations.
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* AUTHOR IDENTITY
* -------------------------------------------------------------------------------------------------------------------
* Name Initials Company
* -------------------------------------------------------------------------------------------------------------------
* Armin Happel vishp Vector Informatik GmbH
* -------------------------------------------------------------------------------------------------------------------
* REVISION HISTORY
* -------------------------------------------------------------------------------------------------------------------
* Version Date Author Change Id Description
* -------------------------------------------------------------------------------------------------------------------
* 01.00.00 2014-12-18 vishp Creation
*********************************************************************************************************************/
#if !defined (__EXPDAT_CSUMTABLES_H__)
#define __EXPDAT_CSUMTABLES_H__
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL CONSTANT MACROS
*********************************************************************************************************************/
/* Hella shift value */
#define B8 0x0008U
/**********************************************************************************************************************
* GLOBAL FUNCTION MACROS
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL DATA TYPES AND STRUCTURES
*********************************************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************************************************************************************
* GLOBAL DATA PROTOTYPES
*********************************************************************************************************************/
extern const WORD CRC16CCITTtab[256];
extern const DWORD crc32Table[256];
extern const unsigned short crc16Table[256]; /* CRC lookup table */
extern const int gCrc16X25Table[256];
/* The PREH specific X.25 table */
extern const WORD kausCrcTable16_cafe[256];
/**********************************************************************************************************************
* GLOBAL FUNCTION PROTOTYPES
*********************************************************************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* __EXPDAT_CSUM_H__ */
/**********************************************************************************************************************
* END OF FILE: expdat_csum.h
*********************************************************************************************************************/

View File

@ -0,0 +1,430 @@
/**********************************************************************************************************************
* COPYRIGHT
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
* Copyright (c) 2014-2018 by Vector Informatik GmbH. All rights reserved.
*
* This software is copyright protected and proprietary to Vector Informatik GmbH.
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
* All other rights remain with Vector Informatik GmbH.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -----------------------------------------------------------------------------------------------------------------*/
/** \file expdat_datproc.cpp
* \brief Implementation of the dataprocessing functions.
*
* \details This file contains the interface functions for the dataprocessing routines.
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* AUTHOR IDENTITY
* -------------------------------------------------------------------------------------------------------------------
* Name Initials Company
* -------------------------------------------------------------------------------------------------------------------
* Armin Happel vishp Vector Informatik GmbH
* -------------------------------------------------------------------------------------------------------------------
* REVISION HISTORY
* -------------------------------------------------------------------------------------------------------------------
* Version Date Author Change Id Description
* -------------------------------------------------------------------------------------------------------------------
* 01.00.00 2014-12-18 vishp Creation
* 01.00.01 2015-07-25 vishp Correcting RSA decryption with private key.
* 01.00.02 2015-08-26 vishp Remove check for private key from GetRsaKeys(), moved to the calls on RsaEncrypt/decrypt.
* 01.01.00 2016-10-13 vishp Support for ED25519 signature
* Add support for CMAC.
* 01.02.00 2018-01-05 vishp Adding streaming support for Hash and AES data processing operations.
*********************************************************************************************************************/
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
#ifdef _WIN32
#include <windows.h>
#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "expdat.h"
#include "expdat_datproc.h"
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************************************************************************************
* LOCAL CONSTANT MACROS
**********************************************************************************************************************/
#ifndef _WIN32
#define _strnicmp strncasecmp
#endif
#ifndef _MAX_PATH
#define _MAX_PATH 256
#endif
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifdef __cplusplus
#define EXP_MEM_ALLOC(type, size) new type[(size)]
#define EXP_MEM_FREE(ptr) delete [] (ptr)
#else
#define EXP_MEM_ALLOC(type, size) malloc(sizeof(type)*size)
#define EXP_MEM_FREE(ptr) free(ptr)
#endif
/**********************************************************************************************************************
* LOCAL FUNCTION MACROS
**********************************************************************************************************************/
/**********************************************************************************************************************
* LOCAL DATA TYPES AND STRUCTURES
**********************************************************************************************************************/
/*! \brief XOR data structure */
typedef struct tXorParam
{
int xorLen;
int xorCurrent;
BYTE *xorData;
} tXorParam;
/**********************************************************************************************************************
* LOCAL DATA
**********************************************************************************************************************/
/* Name of the data processing functions (appears in the dialog field) */
static const char *dpFunctionName[] = {
"No action"
,"XOR data with byte parameter"
};
/**********************************************************************************************************************
* GLOBAL DATA
**********************************************************************************************************************/
/**********************************************************************************************************************
* LOCAL FUNCTION PROTOTYPES
**********************************************************************************************************************/
static int StringToBytes(const char *textBuffer, unsigned char *data, const int maxDataLen);
/**********************************************************************************************************************
**********************************************************************************************************************
* LOCAL FUNCTIONS
**********************************************************************************************************************
**********************************************************************************************************************/
/********************************************************/
/**********************************************************************************************************************
* InitXorOperation()
**********************************************************************************************************************/
/*! \brief Initializes the AES workspace data structure.
* \param[in] info: Pointer to the complete dataprocessing workspace.
* \param[out] xorParam: Pointer to the XOR workspace.
* \return TRUE: Initialisation successfully completed.
* FALSE: Initialisation failed. Detailed error code in info->exState.
**********************************************************************************************************************/
static bool InitXorOperation(TExportDataInfo *info, tXorParam *xorParam)
{
char keyBuffer[1024];
int maxLen=0;
if ((info->generalParam!=NULL) && (maxLen=strlen(info->generalParam)) > 0)
{
strncpy(keyBuffer, info->generalParam, sizeof(keyBuffer)-1 );
keyBuffer[sizeof(keyBuffer)-1] = '\0';
maxLen = (int)strlen(keyBuffer);
}
if (maxLen == 0) // No data in buffer or NULL-string
{
maxLen = 1;
xorParam->xorData = (BYTE *)ExpDat_AllocWorkspace(sizeof(unsigned char));
xorParam->xorLen = 1;
xorParam->xorData[0] = 0xFF;
}
else
{
xorParam->xorData = (BYTE *)ExpDat_AllocWorkspace( (sizeof(unsigned char) * maxLen) );
xorParam->xorLen = StringToBytes((const char *)info->generalParam,xorParam->xorData,maxLen);
}
xorParam->xorCurrent=0; /* Begin with first byte */
return true;
}
/**********************************************************************************************************************
* StringToBytes()
**********************************************************************************************************************/
/*! \brief Converts the hex string into a byte array.
* \param[in] textBuffer: NULL terminated string that contains HEX-ormatted string, e.g. 0xE4 or EA36DE7.
* \params[out] data: Points to a buffer where the results of the data are placed to.
* \param[in] Max. length of the output buffer.
**********************************************************************************************************************/
static int StringToBytes(const char *textBuffer, unsigned char *data, const int maxDataLen)
{
char tempStr[5];
int rc=0;
while (*textBuffer)
{
// Skip any blanks or commas.
if (*textBuffer == ' ' || *textBuffer == ',')
{
textBuffer++;
continue;
}
if (rc == maxDataLen) return rc;
// If hex-byte starts with '0x'
if ((textBuffer[0]=='0') && (textBuffer[1]=='x'))
{
textBuffer++;
textBuffer++;
}
// make the byte a hex string.
tempStr[0] = '0';
tempStr[1] = 'x';
tempStr[2] = *textBuffer++;
if (*textBuffer) tempStr[3] = *textBuffer++;
else tempStr[3] = '\0';
tempStr[4] = '\0';
data[rc] = (unsigned char)strtoul(tempStr, NULL, 0);
rc++;
}
return rc;
}
/**********************************************************************************************************************
**********************************************************************************************************************
* GLOBAL FUNCTIONS
**********************************************************************************************************************
**********************************************************************************************************************/
/**********************************************************************************************************************
* GetDataProcessingFunctionCount()
**********************************************************************************************************************/
/*! \brief Provides the total number of available dataprocessing functions.
* \return The number of available checksum functions.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
**********************************************************************************************************************/
DLL_FUNC(int) GetDataProcessingFunctionCount(void)
{
return kDatProcItems;
}
/**********************************************************************************************************************
* GetDataProcessingFunctionName()
**********************************************************************************************************************/
/*! \brief Provides a verbal name of the dataprocessing function used in dialog boxes.
* \param[in] index: The index number of the operation.
* \param[out] Pointer to the string buffer where the text will be placed to.
* \param[in] Size: Number of bytes available in the space where name points to.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* IMPORTANT: Enough space must be available for name in the calling routine or string is cut off!!
**********************************************************************************************************************/
DLL_FUNC(bool) GetDataProcessingFunctionName(int index, char * name, int size)
{
/* Not enough string elements available as requested */
if (index >= (sizeof(dpFunctionName)/sizeof(const unsigned char *)))
{
return false;
}
sprintf(name, "%2d:", index);
size -= (int)strlen(name);
size--; // char. termination.
strncat(name, dpFunctionName[index], size);
return true;
}
/**********************************************************************************************************************
* InitDataProcessing()
**********************************************************************************************************************/
/*! \brief This function is called from the main EXE to initialize the data processing operation.
* \details Work to do: The function allocates a workspace for the upcoming operation.
* In many cases, the function takes a parameter string for input.
* \param[in] info: The workspace for the operation.
* \return True if operation was successful
* False otherwise.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* If the return value is false, then the exState contains a more detailed error indication.
* Important: Thus, after a succesful Init, a deinitialisation is required to free the workspace!
**********************************************************************************************************************/
DLL_FUNC(bool) InitDataProcessing( TExportDataInfo *info )
{
bool rval=false;
/* Check for interface version */
if (info->DllInterfaceVersion != DllInterfaceVersion)
{
info->exState = ExportStateDllInterfaceVersionError;
return false;
}
info->voidPtr = NULL;
info->expDatResultSize = 0;
info->exState = ExportStateDataEncryptionError; // General failure.
switch (info->index)
{
case kDatProcNoAction:
rval = true;
break;
case kDatProcXoring:
info->voidPtr = ExpDat_AllocWorkspace(sizeof(tXorParam));
rval = InitXorOperation(info, (tXorParam *)info->voidPtr);
break;
}
return rval;
}
/**********************************************************************************************************************
* DoDataProcessing()
**********************************************************************************************************************/
/*! \brief Does the dataprocessing operation.
* \details This function runs the dataprocessing calculation. It can be called several times.
* At least one time per block (see actionState).
* \param[in] info: The workspace for the operation.
* \return True if operation was successful
* False otherwise.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* If the return value is false, then the exState contains a more detailed error indication.
**********************************************************************************************************************/
DLL_FUNC(bool) DoDataProcessing( TExportDataInfo *info )
{
bool rval=false;
info->exState = ExportStateDataEncryptionError; // General failure.
/* Check for interface version */
if (info->DllInterfaceVersion != DllInterfaceVersion)
{
info->exState = ExportStateDllInterfaceVersionError;
return false;
}
switch (info->index)
{
// 2-Complement without carry -> unsigned short
case kDatProcNoAction:
rval = true;
break;
case kDatProcXoring:
{
char *pcBuf=info->segInData;
DWORD i;
// By default, in- and out-data are identically.
// If nothing's changed here, in could be used for out.
// Otherwise, adapt segOutXxx values in info-struct.
for (i=0l ; i < info->segInLength ; i++)
{
*pcBuf = *pcBuf ^ ((tXorParam *)(info->voidPtr))->xorData[((tXorParam *)(info->voidPtr))->xorCurrent++];
pcBuf++;
if (((tXorParam *)(info->voidPtr))->xorCurrent >= ((tXorParam *)(info->voidPtr))->xorLen) ((tXorParam *)(info->voidPtr))->xorCurrent=0;
}
}
rval = true;
break;
}
return rval;
}
/**********************************************************************************************************************
* DeinitDataProcessing()
**********************************************************************************************************************/
/*! \brief Concludes a checksum operation.
* \param[in] info: The workspace for the operation.
* \return True if operation was successful
* False otherwise.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
* If the return value is false, then the exState contains a more detailed error indication.
**********************************************************************************************************************/
DLL_FUNC(bool) DeinitDataProcessing(TExportDataInfo *info )
{
bool rval=false;
info->exState = ExportStateDataEncryptionError; // General failure.
/* Check for interface version */
if (info->DllInterfaceVersion != DllInterfaceVersion)
{
info->exState = ExportStateDllInterfaceVersionError;
return false;
}
info->expDatResultSize = 0; /* Data Processing has only exceptionally results in result buffer (i.e. signature). */
switch (info->index)
{
// No action
case kDatProcNoAction:
rval = true;
break;
// Increment by 1
case kDatProcXoring:
if (NULL!=info->voidPtr) {
ExpDat_FreeWorkspace((void **)&(((tXorParam *)(info->voidPtr))->xorData));
ExpDat_FreeWorkspace((void **)&(info->voidPtr));
}
rval = true;
break;
}
return rval;
}
#ifdef __cplusplus
}
#endif
/**********************************************************************************************************************
* END OF FILE: expdat_datproc.cpp
*********************************************************************************************************************/

View File

@ -0,0 +1,97 @@
/**********************************************************************************************************************
* COPYRIGHT
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
* Copyright (c) 2014-2018 by Vector Informatik GmbH. All rights reserved.
*
* This software is copyright protected and proprietary to Vector Informatik GmbH.
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
* All other rights remain with Vector Informatik GmbH.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -----------------------------------------------------------------------------------------------------------------*/
/** \file expdat_datproc.h
* \brief Implementation of the dataprocessing functions.
*
* \details This file contains the interface functions for the dataprocessing routines.
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* AUTHOR IDENTITY
* -------------------------------------------------------------------------------------------------------------------
* Name Initials Company
* -------------------------------------------------------------------------------------------------------------------
* Armin Happel vishp Vector Informatik GmbH
* -------------------------------------------------------------------------------------------------------------------
* REVISION HISTORY
* -------------------------------------------------------------------------------------------------------------------
* Version Date Author Change Id Description
* -------------------------------------------------------------------------------------------------------------------
* 01.00.00 2014-12-18 vishp Creation
* 01.01.00 2016-10-13 vishp Support for ED25519 signature
* Add support for CMAC.
* 01.02.00 2018-01-05 vishp Adding streaming support for Hash and AES data processing operations.
*********************************************************************************************************************/
#if !defined (__EXPDAT_DATPROC_H__)
#define __EXPDAT_DATPROC_H__
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL CONSTANT MACROS
*********************************************************************************************************************/
typedef enum
{
kDatProcNoAction //0
,kDatProcXoring //1
,kDatProcItems //52 /* Total number of items in Csum */
} EDatProcMethodNames;
/**********************************************************************************************************************
* GLOBAL FUNCTION MACROS
*********************************************************************************************************************/
#define ChkStartOperation(inf) (DODATA_START & (inf)->doDataOperation)
#define ClrStartOperation(inf) ((inf)->doDataOperation ^= DODATA_START)
/**********************************************************************************************************************
* GLOBAL DATA TYPES AND STRUCTURES
*********************************************************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/**********************************************************************************************************************
* GLOBAL DATA PROTOTYPES
*********************************************************************************************************************/
/**********************************************************************************************************************
* GLOBAL FUNCTION PROTOTYPES
*********************************************************************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* __EXPDAT_DATPROC_H__ */
/**********************************************************************************************************************
* END OF FILE: expdat_datproc.h
*********************************************************************************************************************/

View File

@ -0,0 +1,132 @@
/**********************************************************************************************************************
* COPYRIGHT
* -------------------------------------------------------------------------------------------------------------------
* \verbatim
* Copyright (c) 2014 by Vector Informatik GmbH. All rights reserved.
*
* This software is copyright protected and proprietary to Vector Informatik GmbH.
* Vector Informatik GmbH grants to you only those rights as set out in the license conditions.
* All other rights remain with Vector Informatik GmbH.
* \endverbatim
* -------------------------------------------------------------------------------------------------------------------
* FILE DESCRIPTION
* -----------------------------------------------------------------------------------------------------------------*/
/** \file expdatproc.cpp
* \brief Implementation of the dataprocessing functions.
*
* \details This file contains general purpose interface functions for the DLL.
*
*********************************************************************************************************************/
/**********************************************************************************************************************
* AUTHOR IDENTITY
* -------------------------------------------------------------------------------------------------------------------
* Name Initials Company
* -------------------------------------------------------------------------------------------------------------------
* Armin Happel vishp Vector Informatik GmbH
* -------------------------------------------------------------------------------------------------------------------
* REVISION HISTORY
* -------------------------------------------------------------------------------------------------------------------
* Version Date Author Change Id Description
* -------------------------------------------------------------------------------------------------------------------
* 01.07.05 2010-05-20 vishp HMAC Korrektur bei Berechnung mit MD5.
* 01.08.00 2012-08-25 vishp SHA256 hinzugefügt.
*
* 01.08.07 2014-11-21 vishp ESCAN00079758:Support ARLE compression/decompression
* 02.00.00 2014-12-18 vishp Complete rework of file structure.
*********************************************************************************************************************/
/**********************************************************************************************************************
* INCLUDES
*********************************************************************************************************************/
#include <windows.h>
#include "expdat.h"
/**********************************************************************************************************************
* LOCAL DATA
**********************************************************************************************************************/
/*! \brief Error text corresponding to EExportStatus (see expdat.h) reported through the error function GetExportStateInfo() */
static const char *sInfoText[] = {
"Interface state is idle or not initialized"
,"Incompatible version of EXPDATPROC.DLL"
,"General checksum calculation error"
,"No constant data found in INI-file"
,"Data compression calculation error"
,"Data encryption error"
,"Base address mis-alignment"
,"Data length mis-alignment"
,"Internal error: Unknown action item or action state"
,"Parameter missing or wrong for data processing"
,"General failure on reading key"
,"Key parameter duplicate defined"
,"Key parameter is missing"
,"Key parameter contains HMAC information"
,"Key parameter contains RSA information"
,"Block size must be between 128 bytes and 70000000 bytes for compression"
,"AES algorithm requires 16-byte block length. Align data or use PKCS7, RFC1321 or ANSI X.923 padding method"
,"Unknown or invalid AES padding method"
,"General RSA calculation error. Keys or data length incorrect"
,"Invalid data length for RSA operation"
,"Signature verification failed"
,"Public key invalid."
,"Signature has invalid size"
,"Dynamic length data processing operation not possible with this method. You may increase the 'buffer to file size threshold' or 'temporary buffer size'."
};
static const char *generalFailure = "General unknown error";
BOOL WINAPI _CRT_INIT(_In_ HANDLE _HDllHandle, _In_ DWORD _Reason, _In_opt_ LPVOID _Reserved);
/**********************************************************************************************************************
**********************************************************************************************************************
* GLOBAL FUNCTIONS
**********************************************************************************************************************
**********************************************************************************************************************/
/**********************************************************************************************************************
* DllEntryPoint()
**********************************************************************************************************************/
BOOL WINAPI DllEntryPoint(HINSTANCE hInstance, DWORD dwReason, LPVOID plvReserved)
{
switch(dwReason) {
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
if (!_CRT_INIT(hInstance, dwReason, plvReserved))
return(FALSE);
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_DETACH:
if (!_CRT_INIT(hInstance, dwReason, plvReserved))
return(FALSE);
break;
}
return true;
}
/**********************************************************************************************************************
* GetExportStateInfo()
**********************************************************************************************************************/
/*! \brief Reporting a text information on an error.
* \params[out] infoText location to place the error text pointer for the application.
* \param[in] The error status where the error shall be reported for.
* \note This is an exported interface function of the DLL intended to be called from the EXE.
**********************************************************************************************************************/
void __declspec(dllexport) __cdecl GetExportStateInfo(char **infoText, enum EExportStatus actionState )
{
if (actionState < (sizeof(sInfoText)/sizeof(char *)))
{
*infoText = (char *)sInfoText[actionState];
}
else
{
*infoText = (char *)generalFailure;
}
}

View File

@ -0,0 +1,32 @@
===================================
===================================
= I M P O R T A N T N O T E =
===================================
===================================
!!!!!!!!!! W A R N I N G !!!!!!!!!!
!! The application of this product !!
!! can be dangerous. Please use it !!
!! with care. !!
HexView.exe
===========
Vector Informatik GmbH is furnishing this item "as is" and free of charge.
Vector Informatik GmbH does not provide any warranty of the item whatsoever,
whether express, implied, or statutory, including, but not limited to, any
warranty of merchantability or fitness for a particular purpose or any warranty
that the contents of the item will be error-free.
In no respect shall Vector Informatik Gmbh incur any liability for any damages,
including, but limited to, direct, indirect, special, or consequential damages
arising out of, resulting from, or any way connected to the use of the item,
whether or not based upon warranty, contract, tort, or otherwise;
whether or not injury was sustained by persons or property or otherwise;
and whether or not loss was sustained from, or arose out of, the results of,
the item, or any services that may be provided by Vector Informatik GmbH.
2005-2007, Vector Informatik GmbH

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +1,62 @@
QualityReport
2024年4月17日 22:31:42
2024年11月30日 8:47:38
------ Start build(ECU_APP, DefaultBuild) ------
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe r_main.c diagnose\extern.c diagnose\DTC\DCM_DTC.c diagnose\CanTp\CanTp.c -cpu=S3 -obj_path=DefaultBuild "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF" -g -g_line -I diagnose\DTC -I diagnose\CanTrcv -I sys -I . -I rscan_driver -I diagnose -I DataFlash -I CanNw -I diagnose\CanTp -I diagnose\CanIf -I user -D DEBUG1 -c -msg_lang=english
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe rscan_driver\r_rl78_can_irq.c r_main.c r_cg_timer_user.c CanNw\CanNw.c CanNw\CanNwConfig.c diagnose\Dcm_App.c diagnose\Dcm_App_Cfg.c diagnose\Dcm_Cfg.c diagnose\Dcm_DID_Cfg.c diagnose\extern.c diagnose\DTC\DCM_DTC.c diagnose\Dcm.c user\appTask.c user\can_user.c user\hwCtrl.c -cpu=S3 -obj_path=DefaultBuild "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF" -g -g_line -I diagnose\DTC -I diagnose\CanTrcv -I sys -I . -I rscan_driver -I diagnose -I DataFlash -I CanNw -I diagnose\CanTp -I diagnose\CanIf -I user -D DEBUG1 -c -msg_lang=english
r_main.c(116):W0523077:Called function should have prototype
r_main.c(162):W0523076:Function declarations should have prototype
r_cg_timer_user.c(142):W0520167:Argument of type "uint16_t __near *" is incompatible with parameter of type "unsigned int *__near"
diagnose\Dcm_App.c(296):W0520549:Variable "DcmResetDelay" is used before its value is set
diagnose\Dcm_App.c(320):W0520177:Variable "ResetDelayCnt" was declared but never referenced
diagnose\Dcm_App.c(470):W0520177:Variable "ResetDelayCnt" was declared but never referenced
diagnose\Dcm_App.c(912):W0520549:Variable "LeDcm_u_Result" is used before its value is set
diagnose\Dcm_App.c(979):W0520549:Variable "LeDcm_u_Result" is used before its value is set
diagnose\Dcm_App.c(930):W0520177:Variable "LaDcm_u_TempBuffer" was declared but never referenced
diagnose\Dcm_App.c(1294):W0520940:Missing return statement at end of non-void function "MngDcm_RoutineF001Start"
diagnose\Dcm_App.c(1298):W0520940:Missing return statement at end of non-void function "MngDcm_RoutineF001Stop"
diagnose\Dcm_App.c(1302):W0520940:Missing return statement at end of non-void function "MngDcm_RoutineF001Result"
diagnose\Dcm_App.c(1572):W0520177:Variable "temp" was declared but never referenced
diagnose\Dcm_App.c(1919):W0520549:Variable "LeDcm_u_FinallyResult" is used before its value is set
diagnose\Dcm_App.c(1853):W0520177:Variable "LeDcm_u_dataFomatldentifier" was declared but never referenced
diagnose\Dcm_App.c(1854):W0520177:Variable "LeDcm_u_addressAndLengthFomatldentifier" was declared but never referenced
diagnose\Dcm_App.c(1855):W0520177:Variable "LeDcm_w_Address" was declared but never referenced
diagnose\Dcm_App.c(1856):W0520177:Variable "LeDcm_w_DataLength" was declared but never referenced
diagnose\Dcm_App.c(1857):W0520177:Variable "LeDcm_u_SidIndex" was declared but never referenced
diagnose\Dcm_App.c(1858):W0520177:Variable "LeDcm_u_SecurityAccessCheckResult" was declared but never referenced
diagnose\Dcm_App.c(1859):W0520177:Variable "LaDcm_u_TempBuffer" was declared but never referenced
diagnose\Dcm_App.c(2023):W0520549:Variable "LeDcm_u_FinallyResult" is used before its value is set
diagnose\Dcm_App.c(1939):W0520177:Variable "LeDcm_w_SingleTransmitDataCount" was declared but never referenced
diagnose\Dcm_App.c(1940):W0520177:Variable "LeDcm_u_BlockSequenceCount" was declared but never referenced
diagnose\Dcm_App.c(1941):W0520177:Variable "LeDcm_u_BlockExpect" was declared but never referenced
diagnose\Dcm_App.c(1942):W0520177:Variable "LaDcm_u_TempBuffer" was declared but never referenced
diagnose\Dcm_App.c(60):W0520177:Variable "CeDcm_w_SecurityAccessFBLMask" was declared but never referenced
diagnose\Dcm_App.c(63):W0520177:Variable "SeDcm_w_DownLoadDataLength" was declared but never referenced
diagnose\Dcm_App.c(64):W0520177:Variable "SeDcm_w_TransmitDataCount" was declared but never referenced
diagnose\Dcm_App.c(65):W0520177:Variable "SeDcm_u_BlockSequenceCountSts" was declared but never referenced
diagnose\Dcm_App.c(66):W0520177:Variable "CaDcm_w_SingleAllowDateLength" was declared but never referenced
diagnose\Dcm_App.c(71):W0520177:Variable "SeDcm_u_RidF001Sts" was declared but never referenced
diagnose\Dcm_Cfg.c(83):W0520144:A value of type "uint8 (__far *)(void)" cannot be used to initialize an entity of type "SubDealfunc"
diagnose\Dcm_Cfg.c(84):W0520144:A value of type "uint8 (__far *)(void)" cannot be used to initialize an entity of type "SubDealfunc"
diagnose\Dcm_Cfg.c(87):W0520144:A value of type "uint8 (__far *)(void)" cannot be used to initialize an entity of type "SubDealfunc"
diagnose\Dcm_Cfg.c(1166):W0520940:Missing return statement at end of non-void function "MngDcm_ReadMemoryDataService"
diagnose\Dcm_Cfg.c(1188):W0520167:Argument of type "const TsDcm_h_WithParaSubCheckType __near *" is incompatible with parameter of type "const TsDcm_h_SubCheckType __far *__near"
diagnose\Dcm_Cfg.c(1208):W0520167:Argument of type "const TsDcm_h_WithParaSubCheckType __near *" is incompatible with parameter of type "const TsDcm_h_SubCheckType __far *__near"
diagnose\Dcm_Cfg.c(1249):W0520167:Argument of type "const TsDcm_h_WithParaSubCheckType __near *" is incompatible with parameter of type "const TsDcm_h_SubCheckType __far *__near"
diagnose\Dcm_Cfg.c(1268):W0520167:Argument of type "const TsDcm_h_WithParaSubCheckType __near *" is incompatible with parameter of type "const TsDcm_h_SubCheckType __far *__near"
diagnose\Dcm_Cfg.c(1303):W0520177:Variable "i" was declared but never referenced
diagnose\Dcm_Cfg.c(1313):W0520177:Variable "LeDcm_u_CollectDataPost" was declared but never referenced
diagnose\Dcm_Cfg.c(1606):W0520177:Variable "LeDcm_u_DLCheckResult" was declared but never referenced
diagnose\Dcm_Cfg.c(1612):W0520177:Variable "LeDcm_u_CollectDataPost" was declared but never referenced
diagnose\Dcm_Cfg.c(518):W0520177:Function "MngDcm_2AReadDidCheckDL" was declared but never referenced
diagnose\Dcm_Cfg.c(560):W0520177:Function "MngDcm_IoDidCheckDL" was declared but never referenced
diagnose\Dcm_DID_Cfg.c(173):W0520144:A value of type "long" cannot be used to initialize an entity of type "uint8 __far *__near"
diagnose\Dcm_DID_Cfg.c(173):W0520152:Conversion of nonzero integer to pointer
diagnose\Dcm_DID_Cfg.c(338):W0520174:Expression has no effect
diagnose\Dcm_DID_Cfg.c(348):W0520144:A value of type "long" cannot be used to initialize an entity of type "uint8 __far *__near"
diagnose\Dcm_DID_Cfg.c(348):W0520152:Conversion of nonzero integer to pointer
diagnose\Dcm_DID_Cfg.c(370):W0520144:A value of type "long" cannot be used to initialize an entity of type "uint8 __far *__near"
diagnose\Dcm_DID_Cfg.c(370):W0520152:Conversion of nonzero integer to pointer
diagnose\Dcm_DID_Cfg.c(402):W0520174:Expression has no effect
diagnose\extern.c(99):W0520111:Statement is unreachable
diagnose\extern.c(128):W0520940:Missing return statement at end of non-void function "GetMotorLockStatus"
diagnose\extern.c(174):W0520111:Statement is unreachable
@ -14,28 +66,39 @@ diagnose\extern.c(340):W0520111:Statement is unreachable
diagnose\extern.c(344):W0520111:Statement is unreachable
diagnose\extern.c(541):W0520940:Missing return statement at end of non-void function "GetBcmCommFault"
diagnose\extern.c(558):W0520940:Missing return statement at end of non-void function "GetAcpCommFault"
diagnose\DTC\DCM_DTC.c(128):W0520167:Argument of type "uint32 __near *" is incompatible with parameter of type "unsigned char *__near"
diagnose\DTC\DCM_DTC.c(192):W0520167:Argument of type "uint8 __near (*)[2]" is incompatible with parameter of type "unsigned char *__near"
diagnose\DTC\DCM_DTC.c(183):W0520177:Variable "DtcSnapshotRecord" was declared but never referenced
diagnose\DTC\DCM_DTC.c(857):W0520167:Argument of type "uint8 __near (*)[28]" is incompatible with parameter of type "unsigned char *__near"
diagnose\DTC\DCM_DTC.c(114):W0520177:Function "ChkDiagVolt" was declared but never referenced
diagnose\DTC\DCM_DTC.c(124):W0520177:Function "GetLastSnapshotRecordNum" was declared but never referenced
diagnose\DTC\DCM_DTC.c(349):W0520177:Function "TempMotorFeedbackChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(399):W0520177:Function "ModeMotorFeedbackChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(449):W0520177:Function "RecMotorFeedbackChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(499):W0520177:Function "EvaSensorChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(549):W0520177:Function "MotorLockChk" was declared but never referenced
diagnose\CanTp\CanTp.c(192):W0520069:Integer conversion resulted in truncation
diagnose\CanTp\CanTp.c(796):W0520188:Enumerated type mixed with another type
diagnose\DTC\DCM_DTC.c(129):W0520167:Argument of type "uint32 __near *" is incompatible with parameter of type "unsigned char *__near"
diagnose\DTC\DCM_DTC.c(193):W0520167:Argument of type "uint8 __near (*)[2]" is incompatible with parameter of type "unsigned char *__near"
diagnose\DTC\DCM_DTC.c(184):W0520177:Variable "DtcSnapshotRecord" was declared but never referenced
diagnose\DTC\DCM_DTC.c(858):W0520167:Argument of type "uint8 __near (*)[28]" is incompatible with parameter of type "unsigned char *__near"
diagnose\DTC\DCM_DTC.c(115):W0520177:Function "ChkDiagVolt" was declared but never referenced
diagnose\DTC\DCM_DTC.c(125):W0520177:Function "GetLastSnapshotRecordNum" was declared but never referenced
diagnose\DTC\DCM_DTC.c(217):W0520177:Function "CanDTC_LostCommDetected" was declared but never referenced
diagnose\DTC\DCM_DTC.c(350):W0520177:Function "TempMotorFeedbackChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(400):W0520177:Function "ModeMotorFeedbackChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(450):W0520177:Function "RecMotorFeedbackChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(500):W0520177:Function "EvaSensorChk" was declared but never referenced
diagnose\DTC\DCM_DTC.c(550):W0520177:Function "MotorLockChk" was declared but never referenced
diagnose\Dcm.c(69):W0520550:Variable "LeDcm_u_FinallyResult" was set but never used
user\appTask.c(41):W0520172:External/internal linkage conflict with previous declaration
user\appTask.c(259):W0520177:Variable "num" was declared but never referenced
user\appTask.c(260):W0520177:Variable "keyPressCounter" was declared but never referenced
user\appTask.c(261):W0520177:Variable "LastKey" was declared but never referenced
user\appTask.c(401):W0523082:Pointer to the object of even alignment holds the odd address
user\appTask.c(405):W0520513:A value of type "MotorStateEE_Type __near *" cannot be assigned to an entity of type "uint8_t *"
user\appTask.c(443):W0520513:A value of type "MotorStateEE_Type __near *" cannot be assigned to an entity of type "uint8_t *"
user\appTask.c(541):W0520550:Variable "count" was set but never used
user\appTask.c(675):W0523077:Called function should have prototype
user\appTask.c(729):W0523077:Called function should have prototype
user\can_user.c(104):W0520550:Variable "re_flag" was set but never used
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\ECU_APP.clnk
W0561016:The evaluation version of CC-RL V1 is valid for the remaining 60 days. After that, link size limit (64 Kbyte) will be applied. Please consider purchasing the product.
RAMDATA SECTION: 00000c67 Byte(s)
ROMDATA SECTION: 00000664 Byte(s)
PROGRAM SECTION: 000051cb Byte(s)
W0561016:The evaluation version of CC-RL V1 is valid for the remaining 60 days. After that, link size limit (64 Kbyte) will be applied. Please consider purchasing the product.
W0561016:The evaluation version of CC-RL V1 is valid for the remaining 60 days. After that, link size limit (64 Kbyte) will be applied. Please consider purchasing the product.
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
RAMDATA SECTION: 00000c5b Byte(s)
ROMDATA SECTION: 0000064c Byte(s)
PROGRAM SECTION: 0000515a Byte(s)
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
Renesas Optimizing Linker Completed
------ Build ended(Error:0, Warning:27)(ECU_APP, DefaultBuild) ------
------ Build ended(Error:0, Warning:90)(ECU_APP, DefaultBuild) ------
--- CommandFile 1 ---
DefaultBuild\ECU_APP.clnk :
@ -121,14 +184,14 @@ DefaultBuild\ECU_APP.clnk :
--- SHA1 hash value of output files ---
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\DefaultBuild\ECU_APP.abs: b91823c95da5bd5bc99f4c35c8474b4f0192635e
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\DefaultBuild\ECU_APP.mot: 08b1f28913cc43ae39c0e03d5e3af4e7a57c6fef
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\output\ECU_APP.S19: be7b0e8b501d0be26c6cc55699bd84b3d9f2a47f
F:\work\CFMOTOR\CODE\ECU_APP\DefaultBuild\ECU_APP.abs: c1e63f6d06425880bc7f264f69fe1ae705392757
F:\work\CFMOTOR\CODE\ECU_APP\DefaultBuild\ECU_APP.mot: f1e8320424271e92c110db1273894d64aa91ce96
F:\work\CFMOTOR\CODE\ECU_APP\output\ECU_APP.S19: ef3db7c8ba075175eae6226c9177b10d54a231c8
--- System Information ---
*OS Version
Microsoft Windows 10 企业版 LTSC (-, 10.0.17763, WOW64)
Microsoft Windows 10 IoT 企业版 LTSC (-, 10.0.19044, WOW64)
*Language
中文(中国)
*.NET Framework Version
@ -151,11 +214,11 @@ E:\workspace\CFMOTO\CFMOTOR\ECU_APP\output\ECU_APP.S19: be7b0e8b501d0be26c6cc556
C:\Program Files (x86)\Renesas Electronics\CS+\CC
*Memory Usage
*Private Working Set
162 MB
210 MB
*Number of GDI Objects
1880
1847
*Number of USER Objects
1164
855
*Opened Files
0 editors, 0 files, 0 KB
@ -286,7 +349,7 @@ Device Information Common Interface
DeviceInformation.dll
--- Main Project Information ---
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\ECU_APP.mtpj
F:\work\CFMOTOR\CODE\ECU_APP\ECU_APP.mtpj
Microcontroller Information
*R5F10BBG
*File Name: Version

View File

@ -20,13 +20,14 @@ const TsDcm_h_DtcGroupType CaDcm_u_DtcTable[DCM_SUPDTC_COUNT]={
{ 1,0x91,0x17,0x17},//系统供电电压过高
{ 2,0xC0,0x73,0x88},//BICAN总线BusOff
{ 3,0xA8,0x81,0x23},//旋钮下压按键卡滞
{ 4,0xA8,0x82,0x23},//旋钮上拨卡滞
{ 5,0xA8,0x83,0x23},//旋钮下拨卡滞
{ 6,0xA8,0x84,0x23},//旋钮左拨卡滞
{ 7,0xA8,0x85,0x23},//旋钮右拨卡滞
{ 8,0xA8,0x86,0x25},//旋钮光栅故障
{ 9,0xC1,0x00,0x87},//ECM节点通信丢失
{10,0xD1,0x10,0x87},//GBC节点通信丢失
{ 4,0xA8,0x86,0x25},//旋钮光栅故障
//{ 4,0xA8,0x82,0x23},//旋钮上拨卡滞
//{ 5,0xA8,0x83,0x23},//旋钮下拨卡滞
//{ 6,0xA8,0x84,0x23},//旋钮左拨卡滞
//{ 7,0xA8,0x85,0x23},//旋钮右拨卡滞
//{ 9,0xC1,0x00,0x87},//ECM节点通信丢失
//{10,0xD1,0x10,0x87},//GBC节点通信丢失
};
/*
@ -599,7 +600,7 @@ void CanDTC_Task(void)
//CanDTC_CanCommunicationLostDetected(COMP_Information_ID);
//CanDTC_CompErrChk();
//CanDTC_MotorRunTimeChk();
CanDTC_LostCommDetected();
//CanDTC_LostCommDetected();//20241128取消
//MotorLockChk();
if(DtcTestCycleTim < DTC_TEST_CYCLE_TIM)

View File

@ -8,7 +8,7 @@
#define DCM_19SUPDTCEXTDATARECORD_COUNT (4U)
/* 19 06????DTCExtDataRecord ???????? */
#define DCM_SUPDTC_COUNT ( 11U )
#define DCM_SUPDTC_COUNT ( 5U )
/* ???????DTC???? */
@ -95,11 +95,13 @@ extern DtcStutas_T DtcStutas[DCM_SUPDTC_COUNT];
#define AC_OVER_VOLTAGE 1
#define AC_BusOff 2
#define AC_KEY_OK_STICK 3
#define AC_KEY_GRID_STICK 4
//20242218以下取消
#define AC_KEY_UP_STICK 4
#define AC_KEY_DOWN_STICK 5
#define AC_KEY_LEFT_STICK 6
#define AC_KEY_RIGHT_STICK 7
#define AC_KEY_GRID_STICK 8
#define AC_ECM_LOST 9
#define AC_GBC_LOST 10

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,13 @@
/* @处根据实际情况填写相关信息,将@字符以及这条提示语句去掉 */
/* @处根据实际情况填写相关信息,将@字符以及这条提示语句去掉 */
/******************************************************************************
| File Name : @
| Description: @
| File Name : @
| Description: @
*****************************************************************************/
/******************************************************************************
* Description: : Include File Section
******************************************************************************/
/* @包含其他文件 */
/* @包含其他文件 */
#include "r_cg_macrodriver.h"
#include "Dcm_DID_Cfg.h"
//#include "R_TypeDefs.h"
@ -23,7 +23,7 @@ unsigned char DF_Read(unsigned char* read_buf,unsigned char data_num,unsigned ch
/******************************************************************************
* Description: : Global Variable Definition Section
******************************************************************************/
/*@ 定义全局变量 */
/*@ 定义全局变量 */
extern uint16 adResult[7];
uint8 TempTxBuffer[40];
@ -31,30 +31,30 @@ uint8 TempTxBuffer[40];
* Description: : Static Variable Definition Section
******************************************************************************/
uint8 CaDcm_u_NRCData[DCM_NRCCOUNT] = {0x11,0x12,0x13,0x14,0x22,0x24,0x31,0x33,0x35,0x36,0x37,0x7F,0x72,0x71,0x73,0x78,0x7E}; /*27 负响应码数组*/
uint8 CaDcm_u_NRCData[DCM_NRCCOUNT] = {0x11,0x12,0x13,0x14,0x22,0x24,0x31,0x33,0x35,0x36,0x37,0x7F,0x72,0x71,0x73,0x78,0x7E}; /*27 负响应码数组*/
uint8 wBuf[20] = {0,0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xaa,0xbb,0xcc,0xdd,0xee,0xff,0};
/******************************************************************************
* Description: : Static Function Prototype Declaration
*****************************************************************************/
/*@静态函数声明*/
/*@静态函数声明*/
/******************************************************************************
* Description: : Write User Function Code
*****************************************************************************/
/*@函数头注释格式,所有函数头按照此格式注释*/
/*@函数头注释格式,所有函数头按照此格式注释*/
/******************************************************************************
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
*****************************************************************************/
uint8 GetRTE_Dcm_DidServices_0x0200_ReadData(uint8* data)
{
@ -66,17 +66,17 @@ uint8 GetRTE_Dcm_DidServices_0x0200_ReadData(uint8* data)
}
/******************************************************************************
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
*****************************************************************************/
uint8 GetRTE_Dcm_DidServices_0x0201_ReadData(uint8* data)
{
@ -89,17 +89,17 @@ uint8 GetRTE_Dcm_DidServices_0x0201_ReadData(uint8* data)
/******************************************************************************
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
*****************************************************************************/
uint8 GetRTE_Dcm_DidServices_0xF110_ReadData(uint8* data)
{
@ -110,17 +110,17 @@ uint8 GetRTE_Dcm_DidServices_0xF110_ReadData(uint8* data)
}
/******************************************************************************
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
*****************************************************************************/
uint8 GetRTE_Dcm_DidServices_0xF112_ReadData(uint8* data)
{
@ -131,17 +131,17 @@ uint8 GetRTE_Dcm_DidServices_0xF112_ReadData(uint8* data)
}
/******************************************************************************
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
*****************************************************************************/
uint8 GetRTE_Dcm_DidServices_0xF197_ReadData(uint8* data)
{
@ -156,17 +156,17 @@ uint8 GetRTE_Dcm_DidServices_0xF197_ReadData(uint8* data)
}
/******************************************************************************
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
*****************************************************************************/
uint8 GetRTE_Dcm_DidServices_0xF180_ReadData(uint8* data)
{
@ -186,17 +186,17 @@ uint8 GetRTE_Dcm_DidServices_0xF180_ReadData(uint8* data)
}
/******************************************************************************
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
* : @
*****************************************************************************/
uint8 GetRTE_Dcm_DidServices_0xF181_ReadData(uint8* data)
{
@ -211,15 +211,15 @@ uint8 GetRTE_Dcm_DidServices_0xF183_ReadData(uint8* data)
return DCM_CHECK_OK;
}
#define DCM_DEFAULT_SESSION 0x01 /*默认模式*/
#define DCM_PROGRAMME_SESSION 0x02 /*编程模式*/
#define DCM_EXTEND_SESSION 0x04 /*扩展模式*/
#define DCM_DEFAULT_SESSION 0x01 /*默认模式*/
#define DCM_PROGRAMME_SESSION 0x02 /*编程模式*/
#define DCM_EXTEND_SESSION 0x04 /*扩展模式*/
extern uint8 MngDcm_GetDiagnosticSession(void);
uint8 GetRTE_Dcm_DidServices_0xF186_ReadData(uint8* data)
{
uint8 temp = 0xFF;
temp = MngDcm_GetDiagnosticSession(); /* 当前会话模式 */
temp = MngDcm_GetDiagnosticSession(); /* 当前会话模式 */
if(temp == DCM_DEFAULT_SESSION){
*data = 0x01;

View File

@ -33,7 +33,7 @@ __far const unsigned char SW_VERSION[]={
'1' , //AC_SW_VERSION_06
'.' , //AC_SW_VERSION_07
'0' , //AC_SW_VERSION_08
'6' , //AC_SW_VERSION_09
'1' , //AC_SW_VERSION_09
' ' , //AC_SW_VERSION_10
' ' , //AC_SW_VERSION_11
' ' , //AC_SW_VERSION_12

View File

@ -265,7 +265,7 @@ void KeyPro(void)//5ms
case 0:
keyLongPressState = 0;
keyPressState = 0;
for (i = 1; i < 6; i++)
for (i = KEYID_MIDDLE; i < 6; i++)
{
key = GetKeyState(i);
if (key == KEY_Long_PRESSED)

View File

@ -109,13 +109,13 @@ uint8_t GetIOState(uint8_t keyno)
{
//KEY
case KEYID_UP:
return KEY_UP==0?1:0;
return 0;//KEY_UP==0?1:0;
case KEYID_DOWN:
return KEY_DOWN==0?1:0;
return 0;//KEY_DOWN==0?1:0;
case KEYID_LEFT:
return KEY_LEFT==0?1:0;
return 0;//KEY_LEFT==0?1:0;
case KEYID_RIGHT:
return KEY_RIGHT==0?1:0;
return 0;//KEY_RIGHT==0?1:0;
case KEYID_MIDDLE:
return KEY_MIDDLE==0?1:0;
case KEYID_XNP:

File diff suppressed because one or more lines are too long