Fingerprint Scanner API using GT511C3 fingerprint scanner.

Dependencies:   4DGL-uLCD-SE GT511C3 SDFileSystem mbed

Fork of GT511C3test by Toshihisa T

The fingerprint scanner is designed to take attendance over a group of students. It requires a the group owner to store a preloaded list of student id numbers in a .txt file to the memory (SD card) in return of a 5 digits keypass to gain access to the database when taking attendance.

While there may exist multiple group owner and a group owner with multiple databases, each group will be uniquely identified by the 5 digits keypass. The program limits each scanner to open ONE session at a time where only one group will be able to take attendance during its session. Once a session is closed, a report of the attendance taken during the open session is generated and sent via ethernet to owner and there is no way to reopen the session again.

For the initial setup, each fingerprint database needs to be populated by the students. This set up can be done continuously during a session while taking attendance that session.

Committer:
tosihisa
Date:
Fri Jan 03 15:52:29 2014 +0000
Revision:
6:016ad8f480d3
Parent:
5:d3ebe6d1ed92
Child:
7:8b9ef3211cd0
Add CheckEnrolled() and DeleteID().;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tosihisa 0:b11b455d4997 1 #include "mbed.h"
tosihisa 6:016ad8f480d3 2 #include "GT511C3.hpp"
tosihisa 0:b11b455d4997 3
tosihisa 0:b11b455d4997 4 Serial debug(USBTX,USBRX);
tosihisa 0:b11b455d4997 5
tosihisa 0:b11b455d4997 6 DigitalOut myled(LED1);
tosihisa 0:b11b455d4997 7 GT511C3 finger(p28,p27);
tosihisa 0:b11b455d4997 8
tosihisa 5:d3ebe6d1ed92 9 int progress(int status,char *msg)
tosihisa 2:34a647292050 10 {
tosihisa 5:d3ebe6d1ed92 11 debug.printf("%s",msg);
tosihisa 3:459a4f985a45 12 return 0;
tosihisa 2:34a647292050 13 }
tosihisa 2:34a647292050 14
tosihisa 0:b11b455d4997 15 int main() {
tosihisa 0:b11b455d4997 16 int sts = 0;
tosihisa 4:3dd0f98e6f09 17 int ID = 0;
tosihisa 0:b11b455d4997 18
tosihisa 0:b11b455d4997 19 debug.format(8,Serial::None,1);
tosihisa 0:b11b455d4997 20 debug.baud(115200);
tosihisa 0:b11b455d4997 21
tosihisa 0:b11b455d4997 22 debug.printf("Open\n");
tosihisa 4:3dd0f98e6f09 23 sts = finger.Open();
tosihisa 4:3dd0f98e6f09 24 debug.printf("sts = %d\n",sts);
tosihisa 4:3dd0f98e6f09 25 if(sts == 0){
tosihisa 4:3dd0f98e6f09 26 int i;
tosihisa 4:3dd0f98e6f09 27 debug.printf("FirmwareVersion = %lx\n",finger.FirmwareVersion);
tosihisa 4:3dd0f98e6f09 28 debug.printf("IsoAreaMaxSize = %ld\n",finger.IsoAreaMaxSize);
tosihisa 4:3dd0f98e6f09 29 debug.printf("DeviceSerialNumber = ");
tosihisa 4:3dd0f98e6f09 30 for(i = 0; i < sizeof(finger.DeviceSerialNumber);i++){
tosihisa 4:3dd0f98e6f09 31 debug.printf("%02X",finger.DeviceSerialNumber[i]);
tosihisa 4:3dd0f98e6f09 32 }
tosihisa 4:3dd0f98e6f09 33 debug.printf("\n");
tosihisa 4:3dd0f98e6f09 34 }
tosihisa 0:b11b455d4997 35
tosihisa 3:459a4f985a45 36 if(1){
tosihisa 6:016ad8f480d3 37 int EnrollID = 11;
tosihisa 6:016ad8f480d3 38 if(finger.CheckEnrolled(EnrollID) == 0){
tosihisa 6:016ad8f480d3 39 debug.printf("EnrollID(%d) is already enrolled.Delete!\n",EnrollID);
tosihisa 6:016ad8f480d3 40 if(finger.DeleteID(EnrollID) == 0){
tosihisa 6:016ad8f480d3 41 debug.printf("Delete OK!\n");
tosihisa 6:016ad8f480d3 42 }
tosihisa 6:016ad8f480d3 43 }
tosihisa 6:016ad8f480d3 44 finger.Enroll(EnrollID,progress);
tosihisa 3:459a4f985a45 45 }
tosihisa 3:459a4f985a45 46
tosihisa 3:459a4f985a45 47 finger.CmosLed(1);
tosihisa 0:b11b455d4997 48 while(1) {
tosihisa 6:016ad8f480d3 49 debug.printf("Press finger for Identify\n");
tosihisa 5:d3ebe6d1ed92 50 finger.WaitPress(1);
tosihisa 5:d3ebe6d1ed92 51 if(finger.Capture(1) != 0)
tosihisa 5:d3ebe6d1ed92 52 continue;
tosihisa 5:d3ebe6d1ed92 53 ID = finger.Identify();
tosihisa 5:d3ebe6d1ed92 54 debug.printf("ID = %d\n",ID);
tosihisa 5:d3ebe6d1ed92 55 debug.printf("Remove finger\n");
tosihisa 5:d3ebe6d1ed92 56 finger.WaitPress(0);
tosihisa 0:b11b455d4997 57 }
tosihisa 0:b11b455d4997 58 }