tajfutas / sicounter

SportIdent Punch and Read Out Counter
Other
1 stars 0 forks source link

SIID parsed from read out data is wrong for SI5 cards #1

Open SzieberthAdam opened 7 years ago

SzieberthAdam commented 7 years ago

https://github.com/tajfutas/data-hungaria2017/blob/c033e7083c518b98203ed3c691bc3d15465da0ba/day1-808/pc2-rdo1/sicounter.log#L7-L8

SzieberthAdam commented 7 years ago

Config+ SIID block:

https://github.com/tajfutas/si-configplus-decompiled/blob/17a2414a1fdeecad9d42fa813cc513bfd1085b01/SPORTident.Communication/Communication.cs#L4527-L4533

00 [6] [4] [5]

SICOUNTER SIID block:

https://github.com/tajfutas/sicounter/blob/1eac1efb10286d76d2f4b1d0a8ac38d839033899/sicounter.py#L182-L184

00 [6] [11] [12]

Although bytes at [11:13] are identical as bytes at [4:6], the ones used for SIID calculation shold be the latter. This has to get fixed.

Config+ SIID calculation:

https://github.com/tajfutas/si-configplus-decompiled/blob/17a2414a1fdeecad9d42fa813cc513bfd1085b01/SPORTident.Common/Helper.cs#L980-L1027

SICOUNTER SIID calculation:

https://github.com/tajfutas/sicounter/blob/1eac1efb10286d76d2f4b1d0a8ac38d839033899/sicounter.py#L45-L51

Looks like CNS == 1 should be treated as zero. Series 1 (CNS==1) Card5s are numbered from 1 to 65000 , while series 2 (CNS==2) are numbered from 200001 to 265000 and there are no SportIdent cards numbered within 100000 and 200000.

SIID calculation algorithm should match SportIdent's.