-
Notifications
You must be signed in to change notification settings - Fork 3
/
ZFMComm.h
executable file
·48 lines (42 loc) · 1.04 KB
/
ZFMComm.h
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
39
40
41
42
43
44
45
46
47
48
/*
* ZFMComm.h
*
* Created on: Jan 29, 2014
* Author: Brent.Erickson
*/
#ifndef ZFMCOMM_H_
#define ZFMCOMM_H_
#define ZFMFIXEDPACKETSIZE 11
#define ZFMCHECKSUMSIZE 2
#include "includes.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include "ZFM_CONST.h"
class ZFMComm {
public:
ZFMComm();
virtual ~ZFMComm();
bool init(char * devName);
bool scanFinger();
bool storeImage(int buffer);
bool storeFingerprint(int id);
bool checkFingerprint(int id);
int findFingerprint(int buffer);
bool deleteFingerprint(int id);
bool deleteAllFingerprints();
int getLastError();
bool hasError();
private:
int fd;
int lastError;
void clearError();
bool verifyPassword();
int writePacket(const char* ptype, const char* data, uint len);
int readPacket(char* bufferHead, int bufferSize);
int getBytes(char* bufferHead, int bytesToRead, int bufferSize);
bool loadSavedFingerprint(int id, int buffer);
bool isSuccessPacket(char * buffer);
};
#endif /* ZFMCOMM_H_ */