protocol.h
来自「指纹识别源码 希望朋友们多多指教 阅后敬请提出宝贵意见」· C头文件 代码 · 共 114 行
H
114 行
#ifndef _PROTOCOL_
#define _PROTOCOL_
/*******************************************************/
/*---------------------- response----------------------*/
#define mRight 0x81
#define mReIn 0x82
#define mEot 0x83
#define mBusy 0x84 //Module response
#define hRight 0x81
#define hReIn 0x82
#define hEot 0x83 //Host response
/*---------------------- command----------------------*/
#define Reset 0x00
#define Status 0x01
#define Enroll 0x03
#define GenTzz 0x04
#define DownMb 0x05
#define DownTz 0x06
#define UpMb 0x07
#define UpTz 0x08
#define Store 0x09
#define LdBuf 0x0a
#define Verify 0x0b
#define QuickSearch 0x0c
#define Search 0x0d
#define EraseOne 0x0e
#define EraseAll 0x0f
#define GenImg 0x10
#define UpImg 0x11
#define SetAddr 0x12
#define Signature 0x13
#define SecuLevel 0x14
#define DeviceKey 0x15
#define Free 0x16
#define StorePage 0x17
#define LoadPage 0x18
/*--------------------PkgID----------------------*/
#define Cmd 0x1<<0
#define Data 0x1<<1
#define EndData 0x1<<3
struct TZDP
{
int hres;
int zres;
int direct;
char flag;
};
struct CMD
{
unsigned char PkgId;
unsigned char Address[2];
unsigned char PkgLen;
unsigned char PkgCnt[128];
unsigned char Jyh[2];
};
struct SCMD
{
unsigned char sPkgId;
unsigned char sAddress[2];
unsigned char sPkgLen;
unsigned char sPkgCnt[128];
unsigned char sJyh[2];
};
HANDLE HCOM[8];
/*--------------------function---------------------*/
bool InitCom(int comport);
void ReleaseCom(int comport);
int GetPkgByte(int comport,unsigned char *TranChar);
int SendPkgByte(int comport,unsigned char TranChar);
int GetPackage(int comport,CMD *cmd);
int SendPackage(int comport,SCMD scmd);
int SensorReset(int comport);
int SensorStatus(int comport,unsigned char* St0,unsigned char* St1);
int SensorEnroll(int comport);
int SensorGenTzz(int comport);
int SensorDownMb(int comport,int nummb,TZDP mb[]);
int SensorDownTz(int comport,int numtzd,TZDP tzd[]);
int SensorUpMb(int comport,int* nummb,TZDP mb[]);
int SensorUpTz(int comport,int* numtzd,TZDP tzd[]);
int SensorStore(int comport,int address);
int SensorLdBuf(int comport,int address);
int SensorVerify(int comport);
int SensorQuickSearch(int comport);
int SensorSearch(int comport);
int SensorEraseOne(int comport,int address);
int SensorEraseAll(int comport);
int SensorGenImg(int comport);
int SensorUpImg(int comport,unsigned char image[128][128]); //300pix/inch,0-180 gray
int SensorSetAddr(int comport,unsigned char Addr0,unsigned char Addr1);
int SensorSignature(int comport,unsigned char Sign[128]);
int SensorSecuLevel(int comport,unsigned char Level);
int SensorDeviceKey(int comport,unsigned char OldPwd[8],unsigned char NewPwd[8]);
int SensorFree(int comport);
int SensorLoadPage(int comport,unsigned char cc[256]) ;
int SensorStorePage(int comport,unsigned char cc[256]);
int YanZ(int comport,bool *cont);
int DenL(int comport,int id,bool *cont);
/*********************************************************************/
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?