14 #include "simpletools.h" 21 #define ACK_SUCCESS 0x00 // Operation successfully 22 #define ACK_FAIL 0x01 // Operation failed 23 #define ACK_FULL 0x04 // Fingerprint database is full 24 #define ACK_NOUSER 0x05 // No such user 25 #define ACK_USER_EXISTS 0x07 // already exists 26 #define ACK_TIMEOUT 0x08 // Acquisition timeout 28 #define CMD_SLEEP 0x2C // Sleeps the device 29 #define CMD_SET_MODE 0x2D 30 #define CMD_ADD_FINGERPRINT_1 0x01 31 #define CMD_ADD_FINGERPRINT_2 0x02 32 #define CMD_ADD_FINGERPRINT_3 0x03 33 #define CMD_DELETE_USER 0x04 34 #define CMD_DELETE_ALL_USERS 0x05 35 #define CMD_GET_USERS_COUNT 0x09 36 #define CMD_SCAN_COMPARE_1_TO_1 0x0B 37 #define CMD_SCAN_COMPARE_1_TO_N 0x0C 38 #define CMD_READ_USER_PRIVLAGE 0x0A 39 #define CMD_SENSITIVITY 0x28 40 #define CMD_SCAN_GET_IMAGE 0x24 41 #define CMD_SCAN_GET_EIGENVALS 0x23 42 #define CMD_SCAN_PUT_EIGENVALS 0x44 43 #define CMD_PUT_EIGENVALS_COMPARE_1_TO_1 0x42 44 #define CMD_PUT_EIGENVALS_COMPARE_1_TO_N 0x43 45 #define CMD_GET_USER_EIGENVALS 0x31 46 #define CMD_PUT_USER_EIGENVALS 0x41 47 #define CMD_GET_USERS_INFO 0x2B 48 #define CMD_SET_SCAN_TIMEOUT 0x2E // How long to try scanning - multiples of ~0.25s 51 #if defined(__cplusplus) 61 typedef struct fpScanner_st
81 typedef text_t fpScanner;
127 void fingerprint_sendCommand(fpScanner *device,
char __fpCmd,
char __fpParam1,
char __fpParam2,
char __fpParam3);
175 int fingerprint_add(fpScanner *device,
int userId,
char userLevel,
int scanNumber);
256 #if defined(__cplusplus) void fingerprint_close(fpScanner *device)
Close a connection and recover all memory set aside for the fingerprint scanner instance.
Definition: fingerprint.c:64
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...
Definition: fingerprint.c:201
int fingerprint_lookupUserPrivlage(fpScanner *device, int userId)
Looks up the stored user privalage for the provided User ID.
Definition: fingerprint.c:228
int fingerprint_deleteUser(fpScanner *device, int userId)
Deletes a user (or all users if no user is specified) from the fingerprint module's memory...
Definition: fingerprint.c:168
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.
Definition: fingerprint.c:82
void fingerprint_readResponse(fpScanner *device, char *__fpResponse)
Low-level function used to read a response from the Fingerprint Scanner.
Definition: fingerprint.c:103
int fingerprint_setTimeout(fpScanner *device, int timeout)
Sets the timeout for a single scan.
Definition: fingerprint.c:244
int fingerprint_add(fpScanner *device, int userId, char userLevel, int scanNumber)
Add a user's fingerprint and info to the fingerprint scanner's memory.
Definition: fingerprint.c:131
int fingerprint_countUsers(fpScanner *device)
Returns the number or users stored in the fingerprint scanner's memory.
Definition: fingerprint.c:188
fpScanner * fingerprint_open(int pin_rx, int pin_tx)
Open a connection to a WaveShare fingerprint scanner module.
Definition: fingerprint.c:18
int fingerprint_allowOverwrite(fpScanner *device, char b)
Allow overwriting of fingerprints already stored in the memory of the Fingerprint Scanner...
Definition: fingerprint.c:119
int fingerprint_setStrictness(fpScanner *device, char s_level)
Sets the comparison strictness.
Definition: fingerprint.c:257