⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deviceaccessunit.h

📁 指纹门禁机管理系统
💻 H
字号:
//---------------------------------------------------------------------------
/*
* Copyright (c) 2008,杭州中正生物认证技术有限公司
* All rights reserved.
* 文件名称:DeviceAccessUnit.h
* 文件标识:见配置管理计划书
* 摘    要:
             本头文件定义了门禁客户端软件 与设备交互、接口调用基础类。

  作   者:王从骏
*/
//---------------------------------------------------------------------------

#include "EnguardCommon.h"
#ifndef DeviceAccessUnitH
#define DeviceAccessUnitH
//动态库接口定义

//---------------------------------------------------------------------------
//初始化设备
typedef int WINAPI(__stdcall *lpMXInitDevice)(int iDeviceID,int nType,int nCom,DWORD dwBaudRate,char* strRemote,unsigned int iPort,int *nHandle);
//关闭设备
typedef int WINAPI(__stdcall *lpMXCloseDevice)(int nHandle);
//设置终端时间
typedef int WINAPI(__stdcall *lpMXSetDeviceTime)(int nHandle,char *sTime);
//上传日志记录
typedef int WINAPI(__stdcall *lpMXUpLog)(int nHandle,int iLogID,int* nUserID1,int* nUserID2,char* Opt, char *sTime);
//上传用户信息
typedef int WINAPI(__stdcall *lpMXUpUserInfo)(int nHandle,int nNum,unsigned char* Info,int* InfoLen);
//下载用户信息
typedef int WINAPI(__stdcall *lpMXDownUserInfo)(int nHandle,unsigned char* Info,int InfoLen);
//上传用户指纹模板
typedef int WINAPI(__stdcall *lpMXUpTemplate)(int nHandle,int nNum,int* nUserID,unsigned char* MB,int* nMBLen);
//下载用户指纹模板
typedef int WINAPI(__stdcall *lpMXDownTemplate)(int nHandle,int nUserID,unsigned char* MB,int nMBLen);
//删除用户
typedef int WINAPI(__stdcall *lpMXDeleteUser)(int nHandle,int nUserID);
//清除用户
typedef int WINAPI(__stdcall *lpMXClearUser)(int nHandle);
//清除日志
typedef int WINAPI(__stdcall *lpMXClearLog)(int nHandle);
//设置标签
typedef int WINAPI(__stdcall *lpMXSetCaption)(int nHandle,unsigned char* Content,int iCaptionSize);
//恢复出厂标签
typedef int WINAPI(__stdcall *lpMXResumeCaption)(int nHandle);
// 设置自动锁时间(秒数)
typedef int WINAPI(__stdcall *lpMXSetAutoLock)(int nHandle,int nSecond);
// 读取自动锁时间(秒数)
typedef int WINAPI(__stdcall *lpMXGetAutoLock)(int nHandle,int *nSecond);
// 设置开门模式,0常开,1常闭,2正常
typedef int WINAPI(__stdcall *lpMXSetDoorMode)(int nHandle,int nMode);
// 读取开门模式
typedef int WINAPI(__stdcall *lpMXGetDoorMode)(int nHandle,int *nMode);

//得到用户总数
typedef int WINAPI(__stdcall *lpMXGetUserCount)(int nHandle,int *nCount);
//得到指纹总数
typedef int WINAPI(__stdcall *lpMXGetTemplateCount)(int nHandle,int *nCount);
//得到日志总数
typedef int WINAPI(__stdcall *lpMXGetLogCount)(int nHandle,int *nCount);
//应急开门(后跟4字节,6位密码)
typedef int WINAPI(__stdcall *lpMXEmergencyOpen)(int nHandle,int nPwd);
//应急开门密码(后跟4字节,6位密码)
typedef int WINAPI(__stdcall *lpMXSetEmergencyOpenPwd)(int nHandle,int nPwd);
//设置门禁规则数据
typedef int WINAPI(__stdcall *lpMXSetRoleData)(int nHandle,unsigned char* Role,int nRoleLen);
//得到门禁规则数据
typedef int WINAPI(__stdcall *lpMXGetRoleData)(int nHandle,unsigned char* Role,int *nRoleLen);

//---------------------------------------------------------------------------

//设备存储类
class TDeviceAccess
{
    private:
            HINSTANCE LibHandle;
    private:
           bool InitDLL();
           bool FreeDLL();

           ReturnValue_T aRV;
           int TempID;
    public:
           TDeviceAccess();
           TDeviceAccess(char* iDeviceLibFile);

           ~TDeviceAccess();

           int OpenDevice(int iDeviceID);
           int OpenDevice(int iDeviceID,int iCom,int iBaudRate);
           int OpenDevice(int iDeviceID,char* iIP,unsigned int iPort);
           int OpenDevice(int iDeviceID,DeviceType_T iType,DeviceParam_T Param);

           int CloseDevice(int iHandle);

           //设置设备时间
           int SetDeviceTime(int iHandle,SYSTEMTIME iTime);

           //设置设备标题
           int SetCaption(int iHandle,char* iCaption,int iCaptionSize);

           //恢复出厂标题
           int ResumeCaption(int iHandle);

           //应急开门
           int EmergencyOpen(int iHandle);

           //得到指定编号的 日志数据
           int GetLogInfo(int iHandle,int iLogID,LogInfoBase_T &oLogInfo);

           //清除用户日志信息
           int ClearLogInfo(int iHandle);

           //下载用户信息
           int SetUserInfo(int iHandle,UserInfo_T iUserInfo);

           //上载指定用户编号 用户信息
           int GetUserInfo(int iHandle,int iUserID,UserInfo_T &iUserInfo);

           //下载用户模板数据
           int DownTemplate(int iHandle,int iUserID,BYTE* iTemplate,int iTemplateSize);

           //上载用户模板数据
           int UpTemplate(int iHandle,int iTemplateID,int &oUserID,BYTE* oTemplate,int &oTemplateSize);

           //删除指定用户数据
           int DeleteUser(int iHandle,int iUserID);

           //清除所有用户数据
           int ClearUser(int iHandle);

           // 设置自动锁时间(秒数)
           int SetAutoLock(int iHandle,int iSecond);

           // 读取自动锁时间(秒数)
           int GetAutoLock(int iHandle,int &oSecond);

           // 设置开门模式,0常开,1常闭,2正常
           int SetDoorMode(int iHandle,int iMode);

           // 读取开门模式
           int GetDoorMode(int iHandle,int &nMode);

           //得到员工总数
           int GetUserCount(int iHandle,int &oCount);

           //得到指纹总数
           int GetTemplateCount(int iHandle,int &oCount);

           //得到日志总数
           int GetLogCount(int iHandle,int &oCount);

           //应急开门(后跟4字节,6位密码)
           int EmergencyOpen(int iHandle,int iPwd);

           //应急开门密码(后跟4字节,6位密码)
           int SetEmergencyOpenPwd(int iHandle,int iPwd);

           //设置门禁规则数据
           int SetEntanceRole(int iHandle,unsigned char* iRole,int iRoleLen);

           //得到门禁规则数据
           int GetEntanceRole(int iHandle,unsigned char* oRole,int &onRoleLen);
};
//---------------------------------------------------------------------------
//得到设备存储类实例
extern  TDeviceAccess* GetDeviceAccessInstance();

//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -