6
6
TLDR; Wil Wheaton's Law
7
7
*/
8
8
9
- #include " FPS_GT511C3.h" ;
9
+ #include " FPS_GT511C3.h"
10
10
11
+ #ifndef __GNUC__
11
12
#pragma region -= Command_Packet Definitions =-
13
+ #endif // __GNUC__
12
14
13
15
// returns the 12 bytes of the generated command packet
14
16
// remember to call delete on the returned array
@@ -80,9 +82,13 @@ word Command_Packet::_CalculateChecksum()
80
82
Command_Packet::Command_Packet ()
81
83
{
82
84
};
85
+ #ifndef __GNUC__
83
86
#pragma endregion
87
+ #endif // __GNUC__
84
88
89
+ #ifndef __GNUC__
85
90
#pragma region -= Response_Packet Definitions =-
91
+ #endif // __GNUC__
86
92
// creates and parses a response packet from the finger print scanner
87
93
Response_Packet::Response_Packet (byte* buffer, bool UseSerialDebug)
88
94
{
@@ -186,7 +192,7 @@ byte Response_Packet::GetLowByte(word w)
186
192
}
187
193
188
194
// checks to see if the byte is the proper value, and logs it to the serial channel if not
189
- bool Response_Packet::CheckParsing (byte b, byte propervalue, byte alternatevalue, char * varname, bool UseSerialDebug)
195
+ bool Response_Packet::CheckParsing (byte b, byte propervalue, byte alternatevalue, const char * varname, bool UseSerialDebug)
190
196
{
191
197
bool retval = (b != propervalue) && (b != alternatevalue);
192
198
if ((UseSerialDebug) && (retval))
@@ -200,21 +206,31 @@ bool Response_Packet::CheckParsing(byte b, byte propervalue, byte alternatevalue
200
206
Serial.print (" != " );
201
207
Serial.println (b, HEX);
202
208
}
203
-
209
+ return retval;
204
210
}
211
+ #ifndef __GNUC__
205
212
#pragma endregion
213
+ #endif // __GNUC__
206
214
215
+ #ifndef __GNUC__
207
216
#pragma region -= Data_Packet =-
217
+ #endif // __GNUC__
208
218
// void Data_Packet::StartNewPacket()
209
219
// {
210
220
// Data_Packet::NextPacketID = 0;
211
221
// Data_Packet::CheckSum = 0;
212
222
// }
223
+ #ifndef __GNUC__
213
224
#pragma endregion
225
+ #endif // __GNUC__
214
226
227
+ #ifndef __GNUC__
215
228
#pragma region -= FPS_GT511C3 Definitions =-
229
+ #endif // __GNUC__
216
230
231
+ #ifndef __GNUC__
217
232
#pragma region -= Constructor/Destructor =-
233
+ #endif // __GNUC__
218
234
// Creates a new object to interface with the fingerprint scanner
219
235
FPS_GT511C3::FPS_GT511C3 (uint8_t rx, uint8_t tx)
220
236
: _serial(rx,tx)
@@ -230,9 +246,13 @@ FPS_GT511C3::~FPS_GT511C3()
230
246
{
231
247
_serial.~SoftwareSerial ();
232
248
}
249
+ #ifndef __GNUC__
233
250
#pragma endregion
251
+ #endif // __GNUC__
234
252
253
+ #ifndef __GNUC__
235
254
#pragma region -= Device Commands =-
255
+ #endif // __GNUC__
236
256
// Initialises the device and gets ready for commands
237
257
void FPS_GT511C3::Open ()
238
258
{
@@ -305,7 +325,7 @@ bool FPS_GT511C3::SetLED(bool on)
305
325
// Parameter: 9600, 19200, 38400, 57600, 115200
306
326
// Returns: True if success, false if invalid baud
307
327
// NOTE: Untested (don't have a logic level changer and a voltage divider is too slow)
308
- bool FPS_GT511C3::ChangeBaudRate (int baud)
328
+ bool FPS_GT511C3::ChangeBaudRate (unsigned long baud)
309
329
{
310
330
if ((baud == 9600 ) || (baud == 19200 ) || (baud == 38400 ) || (baud == 57600 ) || (baud == 115200 ))
311
331
{
@@ -619,9 +639,13 @@ bool FPS_GT511C3::CaptureFinger(bool highquality)
619
639
return retval;
620
640
621
641
}
642
+ #ifndef __GNUC__
622
643
#pragma endregion
644
+ #endif // __GNUC__
623
645
646
+ #ifndef __GNUC__
624
647
#pragma region -= Not imlemented commands =-
648
+ #endif // __GNUC__
625
649
// Gets an image that is 258x202 (52116 bytes) and returns it in 407 Data_Packets
626
650
// Use StartDataDownload, and then GetNextDataPacket until done
627
651
// Returns: True (device confirming download starting)
@@ -709,10 +733,14 @@ bool FPS_GT511C3::CaptureFinger(bool highquality)
709
733
// UpgradeISOCDImage - Data sheet says not supported
710
734
// SetIAPMode - for upgrading firmware (which data sheet says is not supported)
711
735
// Ack and Nack are listed as commands for some unknown reason... not implemented
736
+ #ifndef __GNUC__
712
737
#pragma endregion
738
+ #endif // __GNUC__
713
739
714
740
741
+ #ifndef __GNUC__
715
742
#pragma region -= Private Methods =-
743
+ #endif // __GNUC__
716
744
// Sends the command to the software serial channel
717
745
void FPS_GT511C3::SendCommand (byte cmd[], int length)
718
746
{
@@ -778,7 +806,11 @@ void FPS_GT511C3::serialPrintHex(byte data)
778
806
sprintf (tmp, " %.2X" ,data);
779
807
Serial.print (tmp);
780
808
}
809
+ #ifndef __GNUC__
781
810
#pragma endregion
811
+ #endif // __GNUC__
782
812
813
+ #ifndef __GNUC__
783
814
#pragma endregion
815
+ #endif // __GNUC__
784
816
0 commit comments