Skip to content

Commit 8291727

Browse files
code clean up
1 parent d117944 commit 8291727

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

adafruit_fingerprint.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def finger_fast_search(self):
271271
capacity & 0xFF])
272272
r = self._get_packet(16)
273273
self.finger_id, self.confidence = struct.unpack('>HH', bytes(r[1:5]))
274+
# print(r)
274275
return r[0]
275276

276277
##################################################
@@ -313,7 +314,6 @@ def _get_data(self, expected):
313314
and _ENDDATAPACKET. Alternate method for getting data such
314315
as fingerprint image, etc. Returns the data payload."""
315316
res = self._uart.read(expected)
316-
# print("Got", res)
317317
if (not res) or (len(res) != expected):
318318
raise RuntimeError('Failed to read data from sensor')
319319

@@ -348,7 +348,7 @@ def _get_data(self, expected):
348348
# todo: we should really inspect the headers and checksum
349349
reply = [i for i in res[0:length]]
350350
self._uart.read(2) # disregard checksum but we really shouldn't
351-
print(len(reply))
351+
# print(len(reply))
352352
# print(reply)
353353
return reply
354354

@@ -401,14 +401,12 @@ def _send_data(self, data):
401401

402402
for j in range(len(data[start:end])):
403403
packet.append(data[j])
404-
# packet.append(struct.pack('@B', data[j]))
405404
checksum += data[j]
406405

407406
packet.append(checksum >> 8)
408407
packet.append(checksum & 0xFF)
409408

410409
# print("Sending: ", [hex(i) for i in packet])
411-
# self._uart.write(bytearray(packet))
412410
self._uart.write(packet)
413411
# print(i)
414412

@@ -430,13 +428,11 @@ def _send_data(self, data):
430428

431429
for j in range(len(data[start:end])):
432430
packet.append(data[j])
433-
# packet.append(struct.pack('@B', data[j]))
434431
checksum += data[j]
435432

436433
packet.append(checksum >> 8)
437434
packet.append(checksum & 0xFF)
438435

439436
# print("Sending: ", [hex(i) for i in packet])
440-
# self._uart.write(bytearray(packet))
441437
self._uart.write(packet)
442438
# print(i)

0 commit comments

Comments
 (0)