upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Classes | Public Member Functions | List of all members

API for the ZFM-20 Fingerprint Sensor Module. More...

Detailed Description

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.

zfm20.jpg

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)
 

Constructor & Destructor Documentation

ZFM20 ( int  uart)

ZFM20 constructor

Parameters
uartDefault UART to use (0 or 1)

Member Function Documentation

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().

Returns
One of the ZFM20_ERRORS_T values
boolean dataAvailable ( long  millis)

Checks to see if there is data available for reading

Parameters
millisNumber of milliseconds to wait; 0 means no waiting
Returns
true if there is data available for reading
short deleteDB ( )

Deletes the model database (DB)

Returns
One of the ZFM20_ERRORS_T values
short deleteModel ( int  id)

Deletes a stored model

Parameters
idLocation containing the model to delete
Returns
One of the ZFM20_ERRORS_T values
short generateImage ( )

Generates a new fingerprint image (scans a fingerprint)

Returns
One of the ZFM20_ERRORS_T values
long getMillis ( )

Returns the number of milliseconds elapsed since initClock() was last called

Returns
Elapsed milliseconds
int getNumTemplates ( )

Queries the module for the number of stored templates (fingerprints).

Returns
Number of currently stored templates
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

Parameters
slotCharacteristics buffer to use; must be 1 or 2
Returns
One of the ZFM20_ERRORS_T values
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

Parameters
scoreScore
Returns
One of the ZFM20_ERRORS_T values
short search ( int  slot,
int[]  id,
int[]  score 
)

Searches the fingerprint DB and returns an ID and score, if found

Parameters
slotSlot containing a converted image to search for
idID if found, 0 otherwise
scoreScore if found, 0 otherwise
Returns
One of the ZFM20_ERRORS_T values
void setAddress ( long  addr)

Sets the address that should be used to access the module

Parameters
addrAddress 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.

Parameters
addrNew address to set on the module
Returns
True if successful
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.

Parameters
pwdNew password to set on the module
Returns
True if successful
void setPassword ( long  pw)

Sets the password that should be used to access the module

Parameters
pwPassword 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).

Parameters
baudDesired baud rate.
Returns
True if successful
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.

Parameters
slotCharacteristics buffer to store the model, 1 or 2
idLocation to store the model
Returns
One of the ZFM20_ERRORS_T values
boolean verifyPassword ( )

Verifies and authenticates to the module. The password used is the last one set by setPassword().

Returns
True if successful

The documentation for this class was generated from the following file: