upm
0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
|
API for the ZFM-20 Fingerprint Sensor Module. More...
This class was tested on the Grove Fingerprint Sensor Module. It can store up to 163 fingerprints.
It is connected via a UART at 57,600 baud.
This example demonstrates how to register and store a new fingerprint
This example demonstrates reading a fingerprint and locating it in the DB
Classes | |
class | ZFM20_COMMAND_T |
class | ZFM20_ERRORS_T |
class | ZFM20_PKTCODES_T |
Public Member Functions | |
synchronized void | delete () |
ZFM20 (int uart) | |
boolean | dataAvailable (long millis) |
int | readData (byte[] buffer) |
int | writeData (byte[] buffer) |
boolean | setupTty (int baud) |
boolean | setupTty () |
int | writeCmdPacket (byte[] pkt) |
boolean | verifyPacket (byte[] pkt) |
long | getMillis () |
void | initClock () |
void | setAddress (long addr) |
void | setPassword (long pw) |
boolean | getResponse (byte[] pkt) |
boolean | verifyPassword () |
int | getNumTemplates () |
boolean | setNewPassword (long pwd) |
boolean | setNewAddress (long addr) |
short | generateImage () |
short | image2Tz (int slot) |
short | createModel () |
short | storeModel (int slot, int id) |
short | deleteModel (int id) |
short | deleteDB () |
short | search (int slot, int[] id, int[] score) |
short | match (int[] score) |
short createModel | ( | ) |
Based on the two characteristics buffers (1 & 2), creates a fingerprint model. Once a model is successfully created, it can be stored in the module with storeModel().
boolean dataAvailable | ( | long | millis | ) |
Checks to see if there is data available for reading
millis | Number of milliseconds to wait; 0 means no waiting |
short deleteDB | ( | ) |
Deletes the model database (DB)
short deleteModel | ( | int | id | ) |
Deletes a stored model
id | Location containing the model to delete |
short generateImage | ( | ) |
Generates a new fingerprint image (scans a fingerprint)
long getMillis | ( | ) |
Returns the number of milliseconds elapsed since initClock() was last called
int getNumTemplates | ( | ) |
Queries the module for the number of stored templates (fingerprints).
short image2Tz | ( | int | slot | ) |
Converts the image in the image buffer (generated by generateImage()) and stores it in one of the two characteristics buffers, 1 or 2
slot | Characteristics buffer to use; must be 1 or 2 |
void initClock | ( | ) |
Resets the clock
short match | ( | int[] | score | ) |
Compares the features in characteristics buffers 1 and 2 and returns a score if they match
score | Score |
short search | ( | int | slot, |
int[] | id, | ||
int[] | score | ||
) |
Searches the fingerprint DB and returns an ID and score, if found
slot | Slot containing a converted image to search for |
id | ID if found, 0 otherwise |
score | Score if found, 0 otherwise |
void setAddress | ( | long | addr | ) |
Sets the address that should be used to access the module
addr | Address to use |
boolean setNewAddress | ( | long | addr | ) |
Sets a new address for the module. This address is stored in the module, and is required to access the module in the future.
addr | New address to set on the module |
boolean setNewPassword | ( | long | pwd | ) |
Sets a new password for the module. This passowrd is stored in the module, and is required to access the module in the future.
pwd | New password to set on the module |
void setPassword | ( | long | pw | ) |
Sets the password that should be used to access the module
pw | Password to use |
boolean setupTty | ( | int | baud | ) |
Sets up proper tty I/O modes and the baud rate. For this device, the default baud rate is 57,600 (B57600).
baud | Desired baud rate. |
short storeModel | ( | int | slot, |
int | id | ||
) |
Once a fingerprint model is created, this method can be used to store it (via one of the characteristics buffers) in a given location.
slot | Characteristics buffer to store the model, 1 or 2 |
id | Location to store the model |
boolean verifyPassword | ( | ) |
Verifies and authenticates to the module. The password used is the last one set by setPassword().