Core¶
Core module for serial communication of module data package format
This module implements methods to read and write packets in the data package format. When communicating, the transferring and receiving of command/data/result are all wrapped in data package format. The packets take the shape of package to be sent and received as specified by the adafruit fingerprint module.
Classes¶
- Package
- Contain methods for serial read and write of module package
-
class
adafruit_fingerprint.core.
Package
(port)[source]¶ Implemets data package format for adafruit fingerprint module
Contain methods to read and write module package data format to and from the serial buffer. Before every read and write, the package (packet to be read or written) has to be deconstructed and constructed respectively before the read/write operation, to be able to pick out the “package content” which is important to the AdafruitFingerprint class.
-
port
¶ Instance of the Serial class from the serial module. The serial port passed down to allow serial communication (Default is None)
Type: serial.Serial
-
header
¶ Pakcage data header value (Default is 0xEF01)
Type: int
-
address
¶ Package data address value (Default is 0xFFFFFFFF)
Type: int
-
identifier
¶ Package data identifier value. Values can be 01H, 02H or 07H
Type: int
-
package_head
¶ a list containing package header, address and identifier
Type: list
-
read
()[source] read package data (packet) from the serial buffer
Returns: A list of integers. Unpacked via a specified format from a string of hex bytes Return type: package
-
read_template
()[source] Read fiingerprint template from serial buffer
Returns: - template (string) – if fingerprint template is read successfully
- None – if no fingerprint template is read from serial buffer
-
write
(data)[source] write package data (data packet) from the serail buffer
-
write_template
(data)[source] Write fingerprint template to serial buffer
-