Переглянути джерело

Z991239-1100 #comment other: 添加7.1适配器

翟俊伟80258120 5 роки тому
батько
коміт
ee5889bd03

+ 18 - 0
DevAdapter/cmbsz/FingerPrint.7.1/CMakeLists.txt

@@ -0,0 +1,18 @@
+# 声明模块名称的前缀和名称
+rvc_dev_define_module("FingerPrint")
+
+# rvc_dev_config_library 内需要使用这三个参数,用于拼接输出的适配器文件名称
+set(${MODULE_PREFIX}_VENDOR "cmbsz")
+set(${MODULE_PREFIX}_VERSION "7")
+set(${MODULE_PREFIX}_BATCH "1")
+
+# 包含要编译的实现文件,rvc_dev_config_library 内使用
+set(${MODULE_PREFIX}_SRCS SHARED
+	FingerPrint_Impl.cpp
+)
+
+# 适配器工程需要通过此宏替代 add_library
+rvc_dev_config_library(${MODULE_NAME} ${MODULE_PREFIX})
+
+#  =-=-=-=-=-=-=-=-=-= {适配器工程}/CMakeLists.txt 文件最后必须声明如下内容=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=
+rvc_dev_target_install(${MODULE_FULL_NAME})

+ 95 - 0
DevAdapter/cmbsz/FingerPrint.7.1/FingerPrint_Impl.cpp

@@ -0,0 +1,95 @@
+/*
+ * Create by LocalUser on 2020/9/22
+*/
+
+#include "FingerPrint_Impl.h"
+#include<cstring>
+#include <cstdio>
+
+FingerPrintImpl::FingerPrintImpl()
+{
+
+}
+
+FingerPrintImpl::~FingerPrintImpl()
+{
+
+}
+
+ErrorCodeEnum FingerPrintImpl::GetDevCategory(DevCategoryInfo& devCategory)
+{
+	ErrorCodeEnum err = Error_Succeed;
+	strcpy(devCategory.szModel, "szModel");
+	strcpy(devCategory.szType, "szType");
+	strcpy(devCategory.szVendor, "szVendor");
+	return err;
+}
+
+ErrorCodeEnum FingerPrintImpl::Reset()
+{
+	ErrorCodeEnum err = Error_Unexpect;
+	m_mode = 0;
+	return err;
+}
+
+ErrorCodeEnum FingerPrintImpl::DevOpen(DWORD dwPort, DWORD dwBaudRate)
+{
+	ErrorCodeEnum err = Error_Succeed;
+	
+	return err;
+}
+
+ErrorCodeEnum FingerPrintImpl::Image2Feature(const char* imageName, LPBYTE lpbFeature, int& iLength)
+{
+	return Error_NotImpl;
+}
+
+ErrorCodeEnum FingerPrintImpl::Image2Template(const char* imagePath1, const char* imagePath2, const char* imagePath3, LPBYTE lpbTemplate, int& iLength)
+{
+	return Error_NotImpl;
+}
+
+ErrorCodeEnum FingerPrintImpl::Match(LPBYTE lpbTemplate[], int iTemplateLen[], int templateNum, LPBYTE lbpFeature, int& iFeatureLen, int level /* = 3 */)
+{
+	return Error_NotImpl;
+}
+
+ErrorCodeEnum FingerPrintImpl::Cancel()
+{
+	return Error_Succeed;
+}
+
+ErrorCodeEnum FingerPrintImpl::DevClose()
+{
+	ErrorCodeEnum err = Error_Succeed;
+	return err;
+}
+
+ErrorCodeEnum FingerPrintImpl::GetLastErr(DevErrorInfo& devErrInfo)
+{
+	return Error_Succeed;
+}
+
+DEVICEBASE_API ErrorCodeEnum CreateDevComponent(DeviceBaseClass*& baseObj)
+{
+	baseObj = new FingerPrintImpl();
+	if (baseObj == NULL) {
+		return Error_Resource;
+	}
+	else {
+		return Error_Succeed;
+	}
+}
+DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pBaseObj)
+{
+	if (pBaseObj == NULL) {
+		return Error_Param;
+	}
+	if (FingerPrintImpl * pTmp = dynamic_cast<FingerPrintImpl*>(pBaseObj))
+	{
+		delete pTmp;
+		pTmp = NULL;
+		return Error_Succeed;
+	}
+	return Error_Param;
+}

+ 35 - 0
DevAdapter/cmbsz/FingerPrint.7.1/FingerPrint_Impl.h

@@ -0,0 +1,35 @@
+/*
+ * Created by LocalUser on 2020/9/22	
+*/
+
+#ifndef LIBFRAMEWORK_FINGERPRINT_IMPL_H
+#define LIBFRAMEWORK_FINGERPRINT_IMPL_H
+
+#include "FingerPrintClass.h"
+
+class FingerPrintImpl : public FingerPrintClass
+{
+public:
+	FingerPrintImpl();
+	~FingerPrintImpl();
+
+	ErrorCodeEnum DevOpen(DWORD dwPort, DWORD dwBaudRate);
+
+	//DeviceBaseClass
+	ErrorCodeEnum GetDevCategory(DevCategoryInfo& devCategory);
+	ErrorCodeEnum Reset();
+	ErrorCodeEnum DevClose();
+	ErrorCodeEnum GetLastErr(DevErrorInfo& devErrInfo);
+
+	//FingerPrintClass
+	virtual ErrorCodeEnum Image2Feature(const char* imageName, LPBYTE lpbFeature, int& iLength);
+	virtual ErrorCodeEnum Image2Template(const char* imagePath1, const char* imagePath2, const char* imagePath3, LPBYTE lpbTemplate, int& iLength);
+	virtual ErrorCodeEnum Match(LPBYTE lpbTemplate[], int iTemplateLen[], int templateNum, LPBYTE lbpFeature, int& iFeatureLen, int level /* = 3 */);
+	virtual ErrorCodeEnum Cancel();
+
+private:
+	int m_mode;
+};
+
+
+#endif // LIBFRAMEWORK_FINGERPRINT_IMPL_H