Fingerprint Scanner Library
0.5
Library for the Fingerprint Scanner (261
|
Simplifies reading the WaveShare fingerprint scanner module. More...
#include "fingerprint.h"
Functions | |
fpScanner * | fingerprint_open (int pin_rx, int pin_tx) |
Open a connection to a WaveShare fingerprint scanner module. More... | |
void | fingerprint_close (fpScanner *device) |
Close a connection and recover all memory set aside for the fingerprint scanner instance. More... | |
void | fingerprint_sendCommand (fpScanner *device, char __fpCmd, char __fpParam1, char __fpParam2, char __fpParam3) |
Low-level function used to send a command to the Fingerprint Scanner. More... | |
void | fingerprint_readResponse (fpScanner *device, char *__fpResponse) |
Low-level function used to read a response from the Fingerprint Scanner. More... | |
int | fingerprint_allowOverwrite (fpScanner *device, char b) |
Allow overwriting of fingerprints already stored in the memory of the Fingerprint Scanner. More... | |
int | fingerprint_add (fpScanner *device, int userId, char userLevel, int scanNumber) |
Add a user's fingerprint and info to the fingerprint scanner's memory. More... | |
int | fingerprint_deleteUser (fpScanner *device, int userId) |
Deletes a user (or all users if no user is specified) from the fingerprint module's memory. More... | |
int | fingerprint_countUsers (fpScanner *device) |
Returns the number or users stored in the fingerprint scanner's memory. More... | |
int | fingerprint_scan (fpScanner *device, int userId, int *uid) |
Scans a user fingerprint and compares it to the provided User ID. If no User ID is provided, it finds and stores the User ID in the specified variable. More... | |
int | fingerprint_lookupUserPrivlage (fpScanner *device, int userId) |
Looks up the stored user privalage for the provided User ID. More... | |
int | fingerprint_setTimeout (fpScanner *device, int timeout) |
Sets the timeout for a single scan. More... | |
int | fingerprint_setStrictness (fpScanner *device, char s_level) |
Sets the comparison strictness. More... | |
Simplifies reading the WaveShare fingerprint scanner module.
int fingerprint_add | ( | fpScanner * | device, |
int | userId, | ||
char | userLevel, | ||
int | scanNumber | ||
) |
Add a user's fingerprint and info to the fingerprint scanner's memory.
*device | device identifier returned by fingerprint_open function. |
userId | a User Id number to assign to the user. May be any positive integer from 1 to 65535. |
userLevel | an abitrary level that can be attached to each user. Must be a (1), (2) or (3). |
scanNumber | To record a fingerprint, the scanner must read it three times. Passing a (1), (2), or (3) tells the scanner to record the first, second, or third scans needed to record the fingerprint. Passing any integer other than (1), (2), or (3) will cause the fingerprint scanner to take all three scans in succession. |
int fingerprint_allowOverwrite | ( | fpScanner * | device, |
char | b | ||
) |
Allow overwriting of fingerprints already stored in the memory of the Fingerprint Scanner.
*device | device identifier returned by fingerprint_open function. |
b | A (1) allows overwiting, a (0) prevents overwriting stored fingerprints. |
void fingerprint_close | ( | fpScanner * | device | ) |
Close a connection and recover all memory set aside for the fingerprint scanner instance.
*device | device identifier returned by fingerprint_open function. |
int fingerprint_countUsers | ( | fpScanner * | device | ) |
Returns the number or users stored in the fingerprint scanner's memory.
*device | device identifier returned by fingerprint_open function. |
int fingerprint_deleteUser | ( | fpScanner * | device, |
int | userId | ||
) |
Deletes a user (or all users if no user is specified) from the fingerprint module's memory.
*device | device identifier returned by fingerprint_open function. |
userId | a User Id of the user to delete. Passing an integer (0) or less than (0) will delete all users from the fingerprint module. |
int fingerprint_lookupUserPrivlage | ( | fpScanner * | device, |
int | userId | ||
) |
Looks up the stored user privalage for the provided User ID.
*device | device identifier returned by fingerprint_open function. |
userId | The User ID to look up. |
fpScanner* fingerprint_open | ( | int | pin_rx, |
int | pin_tx | ||
) |
Open a connection to a WaveShare fingerprint scanner module.
pin_rx | Propeller I/O pin connected to fingerprint scanner's RX pin. |
pin_tx | Propeller I/O pin connected to fingerprint scanner's TX pin. |
void fingerprint_readResponse | ( | fpScanner * | device, |
char * | __fpResponse | ||
) |
Low-level function used to read a response from the Fingerprint Scanner.
*device | device identifier returned by fingerprint_open function. |
__fpResponse | char array to store the response from the fingerprint scanner. |
int fingerprint_scan | ( | fpScanner * | device, |
int | userId, | ||
int * | uid | ||
) |
Scans a user fingerprint and compares it to the provided User ID. If no User ID is provided, it finds and stores the User ID in the specified variable.
*device | device identifier returned by fingerprint_open function. |
userId | the User ID to match the fingerprint being scanned to. If this is set to (0), it will check the scan against all of the stored user fingerprints. |
*uid | a variable to store the matched User Id of the scanned fingerprint into. Stores (0) into the variable if no matching user was found. |
void fingerprint_sendCommand | ( | fpScanner * | device, |
char | __fpCmd, | ||
char | __fpParam1, | ||
char | __fpParam2, | ||
char | __fpParam3 | ||
) |
Low-level function used to send a command to the Fingerprint Scanner.
*device | device identifier returned by fingerprint_open function. |
__fpCmd | the command to be sent. |
__fpParam1 | the first parameter of the command. |
__fpParam2 | the second parameter of the command. |
__fpParam3 | the third parameter of the command. |
int fingerprint_setStrictness | ( | fpScanner * | device, |
char | s_level | ||
) |
Sets the comparison strictness.
*device | device identifier returned by fingerprint_open function. |
s_level | A positive integer to set the comparison level to: (0) [not very strict] to (9) [very strict]. |
int fingerprint_setTimeout | ( | fpScanner * | device, |
int | timeout | ||
) |
Sets the timeout for a single scan.
*device | device identifier returned by fingerprint_open function. |
timeout | how long to keep trying before timing out. Units are approximately in milliseconds. |