Add function of delete all ID.

Fork of GT511C3 by Toshihisa T

Files at this revision

API Documentation at this revision

Comitter:
hjjeon
Date:
Thu Jul 30 00:43:04 2015 +0000
Parent:
0:90c64cb9db58
Commit message:
Add function of delete all ID.

Changed in this revision

GT511C3.cpp Show annotated file Show diff for this revision Revisions of this file
GT511C3.hpp Show annotated file Show diff for this revision Revisions of this file
diff -r 90c64cb9db58 -r e53c3965131e GT511C3.cpp
--- a/GT511C3.cpp	Fri Jan 03 16:00:00 2014 +0000
+++ b/GT511C3.cpp	Thu Jul 30 00:43:04 2015 +0000
@@ -260,7 +260,7 @@
     CmosLed(1);
 
     while(1){
-        if((sts = (*progress)(1,"EnrollStart\n")) != 0)
+        if((sts = (*progress)(1,"EnrollStart\r\n")) != 0)
             return -9999;
         Parameter = ID;
         sts = SendRecv(CMD_EnrollStart,&Parameter,&Response);
@@ -269,53 +269,53 @@
         if(Response != CMD_Ack)
             return -100;
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\r\n")) != 0)
             return -9999;
         WaitPress(0);
 
         while(1){
-            if((sts = (*progress)(10,"Press finger to Enroll (1st)\n")) != 0)
+            if((sts = (*progress)(10,"Press finger to Enroll (1st)\r\n")) != 0)
                 return -9999;
             WaitPress(1);
             if(Capture(1) == 0)
                 break;
         }
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\r\n")) != 0)
             return -9999;
         if(Enroll_N(1) != 0)
             continue;
         WaitPress(0);
 
         while(1){
-            if((sts = (*progress)(20,"Press finger to Enroll (2nd)\n")) != 0)
+            if((sts = (*progress)(20,"Press finger to Enroll (2nd)\r\n")) != 0)
                 return -9999;
             WaitPress(1);
             if(Capture(1) == 0)
                 break;
         }
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\r\n")) != 0)
             return -9999;
         if(Enroll_N(2) != 0)
             continue;
         WaitPress(0);
 
         while(1){
-            if((sts = (*progress)(30,"Press finger to Enroll (3rd)\n")) != 0)
+            if((sts = (*progress)(30,"Press finger to Enroll (3rd)\r\n")) != 0)
                 return -9999;
             WaitPress(1);
             if(Capture(1) == 0)
                 break;
         }
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\r\n")) != 0)
             return -9999;
         if(Enroll_N(3) != 0)
             continue;
         WaitPress(0);
 
-        if((sts = (*progress)(100,"Enroll OK\n")) != 0)
+        if((sts = (*progress)(100,"Enroll OK\r\n")) != 0)
             return -9999;
 
         break;
@@ -346,3 +346,16 @@
         return 0;
     return -1;
 }
+
+int GT511C3::DeleteID_All(void)
+{
+    unsigned long Parameter = 0;
+    unsigned short Response = 0;
+    int sts = 0;
+
+    sts = SendRecv(CMD_DeleteAll,&Parameter,&Response);
+    if((sts == 0) && (Response == CMD_Ack))
+        return 0;
+    return -1;
+}
+
diff -r 90c64cb9db58 -r e53c3965131e GT511C3.hpp
--- a/GT511C3.hpp	Fri Jan 03 16:00:00 2014 +0000
+++ b/GT511C3.hpp	Thu Jul 30 00:43:04 2015 +0000
@@ -110,6 +110,7 @@
     int Enroll(int ID,int (*progress)(int status,char *msg));
     int CheckEnrolled(int ID);
     int DeleteID(int ID);
+    int DeleteID_All(void);
 };
 
 #endif  //__GT511C3_HPP