-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
38 lines (33 loc) · 906 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "R503_fingerprint.h"
//TODO: store fingerprint template in a better format than just plain text?!
int main(int argc, char ** argv)
{
__argc = argc;
__argv = argv;
int Err = 0, terminate = FALSE/*, isr_uselater = 0,*/;
const int16_t *fp_template = NULL;
#ifdef PIGPIO_PERMITTED
if(GpioConfig(NULL, &terminate))
return EGpioBadInit;
#endif
if ((Err = GenFingerTemplate(NULL, &terminate)))
{
fprintf(stderr, "\n%s: ERROR! Could not generate finger template (code %d).\n", argv[0], Err);
return Err;
}
fp_template = ExportFingerTemplate(1, "finger_template.fpt");
if (fp_template[0] < 0)
{
fprintf(stderr, "\n%s: ERROR! Could not export finger template. (code %d)\n", argv[0], fp_template[0]);
return fp_template[0];
}
SetFpLed(R503_LED_FLASHING, R503_LED_RED, 0x20, 0x10);
/*
while (!terminate)
{}
*/
#ifdef PIGPIO_PERMITTED
GpioCleanup();
#endif
return EOk;
}