Time Stamp using fingerprint with WIZwiki-W7500.

Dependencies:   GT511C3 NTPClient SDFileSystem WIZnetInterface mbed-src

Fork of GT511C3_HelloWorld_WIZwiki-W7500 by WIZnet

Revision:
4:3dd0f98e6f09
Parent:
3:459a4f985a45
Child:
5:d3ebe6d1ed92
--- a/GT511C3.h	Fri Jan 03 12:56:03 2014 +0000
+++ b/GT511C3.h	Fri Jan 03 14:12:18 2014 +0000
@@ -1,4 +1,35 @@
-
+/**
+ * @section LICENSE
+ *
+ * Copyright (c) 2013 @tosihisa, MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+ * and associated documentation files (the "Software"), to deal in the Software without restriction, 
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, 
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or 
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * @section DESCRIPTION
+ *
+ * Fingerprint reader module "GT-511C3" class.
+ *
+ * http://www.adh-tech.com.tw/?22,gt-511c3-gt-511c31
+ * http://www.adh-tech.com.tw/files/GT-511C3_datasheet_V1%201_20131127[1].pdf
+ * https://www.sparkfun.com/products/11792
+ * https://github.com/sparkfun/Fingerprint_Scanner-TTL/ 
+ * http://blog.digit-parts.com/archives/51894096.html
+ */
+#ifndef __GT511C3_H
+#define __GT511C3_H
 #include "mbed.h"
 
 class GT511C3 : public Serial {
@@ -55,13 +86,21 @@
         NACK_CAPTURE_CANCELED = 0x1010, // NACK_CAPTURE_CANCELED 0x1010 Obsolete, The capturing is canceled 
         NACK_INVALID_PARAM = 0x1011, // NACK_INVALID_PARAM 0x1011 Invalid parameter 
         NACK_FINGER_IS_NOT_PRESSED = 0x1012, // NACK_FINGER_IS_NOT_PRESSED 0x1012 Finger is not pressed 
+        NACK_IO_ERR = 0xF000,   // ORIGINAL ERROR CODE. Serial line error.
     };
-    GT511C3(PinName _tx, PinName _rx) : Serial(_tx,_rx){}
+    unsigned long LastError;
+    unsigned long FirmwareVersion; 
+    unsigned long IsoAreaMaxSize; 
+    unsigned char DeviceSerialNumber[16]; 
+
+    GT511C3(PinName _tx, PinName _rx) : Serial(_tx,_rx) , LastError(0) {}
     int Init(void);
     int SendCommand(unsigned long Parameter,unsigned short Command);
     int RecvResponse(unsigned long *Parameter,unsigned short *Response);
+    int RecvData(unsigned char *data,unsigned long size);
     int SendRecv(unsigned short Command,unsigned long *Parameter,unsigned short *Response);
     int ClearLine(void);
+    int Open(void);
     int WaitPress(int press);
     int CmosLed(int onoff);
     int IsPress(void);
@@ -69,3 +108,5 @@
     int Enroll_N(int N);
     int Identify(void);
 };
+
+#endif  //__GT511C3_H