Skip to content

Commit e838cba

Browse files
committed
Add back checksum check on download
1 parent 6285a53 commit e838cba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pyfingerprint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def clearDatabase(self):
917917

918918
def compareCharacteristics(self):
919919
"""
920-
Compare the finger characteristics of char buffer 1 with char buffer 2 and returns the accuracy score.
920+
Compare the finger characteristics of char buffer 1 with char buffer 2.
921921
922922
Returns:
923923
The accuracy score (int). 0 means fingers are not the same.
@@ -1172,8 +1172,8 @@ def downloadCharacteristics2(self, charBufferNumber=FINGERPRINT_CHARBUFFER1):
11721172
' '.join('0x{:02x}'.format(x) for x in checksum),
11731173
' '.join('0x{:02x}'.format(x) for x in memoryview(self.__payloadBuffer)[:packagePayloadLength]))
11741174

1175-
# if (receivedChecksum != packageChecksum):
1176-
# raise Exception('The received packet is corrupted (the checksum is wrong)!')
1175+
if (receivedChecksum != calculatedChecksum):
1176+
raise Exception('Package checksum error, received:%s, calculated:%s' % (receivedChecksum, calculatedChecksum))
11771177
self.__clearPayloadBuffer()
11781178

11791179
def softReset(self):

0 commit comments

Comments
 (0)