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 16:03:44 2014 +0000
Revision:
7:8b9ef3211cd0
Parent:
6:016ad8f480d3
Child:
8:a1ba925cf903
class library make.;

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 7:8b9ef3211cd0 22 debug.printf("Fingerprint reader module \"GT-511C3 / GT-511C31\" test program.\n");
tosihisa 7:8b9ef3211cd0 23 debug.printf("Build: %s %s\n",__DATE__,__TIME__);
tosihisa 7:8b9ef3211cd0 24
tosihisa 0:b11b455d4997 25 debug.printf("Open\n");
tosihisa 4:3dd0f98e6f09 26 sts = finger.Open();
tosihisa 4:3dd0f98e6f09 27 debug.printf("sts = %d\n",sts);
tosihisa 4:3dd0f98e6f09 28 if(sts == 0){
tosihisa 4:3dd0f98e6f09 29 int i;
tosihisa 4:3dd0f98e6f09 30 debug.printf("FirmwareVersion = %lx\n",finger.FirmwareVersion);
tosihisa 4:3dd0f98e6f09 31 debug.printf("IsoAreaMaxSize = %ld\n",finger.IsoAreaMaxSize);
tosihisa 4:3dd0f98e6f09 32 debug.printf("DeviceSerialNumber = ");
tosihisa 4:3dd0f98e6f09 33 for(i = 0; i < sizeof(finger.DeviceSerialNumber);i++){
tosihisa 4:3dd0f98e6f09 34 debug.printf("%02X",finger.DeviceSerialNumber[i]);
tosihisa 4:3dd0f98e6f09 35 }
tosihisa 4:3dd0f98e6f09 36 debug.printf("\n");
tosihisa 4:3dd0f98e6f09 37 }
tosihisa 0:b11b455d4997 38
tosihisa 3:459a4f985a45 39 if(1){
tosihisa 6:016ad8f480d3 40 int EnrollID = 11;
tosihisa 6:016ad8f480d3 41 if(finger.CheckEnrolled(EnrollID) == 0){
tosihisa 6:016ad8f480d3 42 debug.printf("EnrollID(%d) is already enrolled.Delete!\n",EnrollID);
tosihisa 6:016ad8f480d3 43 if(finger.DeleteID(EnrollID) == 0){
tosihisa 6:016ad8f480d3 44 debug.printf("Delete OK!\n");
tosihisa 6:016ad8f480d3 45 }
tosihisa 6:016ad8f480d3 46 }
tosihisa 6:016ad8f480d3 47 finger.Enroll(EnrollID,progress);
tosihisa 3:459a4f985a45 48 }
tosihisa 3:459a4f985a45 49
tosihisa 3:459a4f985a45 50 finger.CmosLed(1);
tosihisa 0:b11b455d4997 51 while(1) {
tosihisa 6:016ad8f480d3 52 debug.printf("Press finger for Identify\n");
tosihisa 5:d3ebe6d1ed92 53 finger.WaitPress(1);
tosihisa 5:d3ebe6d1ed92 54 if(finger.Capture(1) != 0)
tosihisa 5:d3ebe6d1ed92 55 continue;
tosihisa 5:d3ebe6d1ed92 56 ID = finger.Identify();
tosihisa 5:d3ebe6d1ed92 57 debug.printf("ID = %d\n",ID);
tosihisa 5:d3ebe6d1ed92 58 debug.printf("Remove finger\n");
tosihisa 5:d3ebe6d1ed92 59 finger.WaitPress(0);
tosihisa 0:b11b455d4997 60 }
tosihisa 0:b11b455d4997 61 }