Browse Source

Z991239-5722 #comment 桥接层改造

80374374 11 months ago
parent
commit
3e8d00f188
25 changed files with 141 additions and 80 deletions
  1. 1 1
      DevAdapter/CMakeLists.txt
  2. 1 1
      DevAdapter/Note.md
  3. 13 1
      DevAdapter/self/cardissuer/VirtualDeviceClass.cpp
  4. 13 1
      DevAdapter/self/contactlesscard/VirtualDeviceClass.cpp
  5. 6 2
      DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.cpp
  6. 1 1
      DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.vcxproj
  7. 6 2
      DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.cpp
  8. 1 1
      DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.vcxproj
  9. 7 4
      DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.cpp
  10. 1 1
      DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.vcxproj
  11. 6 2
      DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.cpp
  12. 1 1
      DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.vcxproj
  13. 5 1
      DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.cpp
  14. 1 1
      DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.vcxproj
  15. 7 4
      DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.cpp
  16. 1 1
      DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.vcxproj
  17. 6 2
      DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.cpp
  18. 1 1
      DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.vcxproj
  19. 3 3
      DevAdapter/self/dep/liblog4vendor/liblog4vendor/liblog4vendor.vcxproj
  20. 3 2
      DevAdapter/self/dep/liblog4vendor/liblog4vendor/log4cplus_helper.cpp
  21. 5 43
      DevAdapter/self/dep/liblog4vendor/liblog4vendor/log4upload.h
  22. 13 1
      DevAdapter/self/fingerprint/VirtualDeviceClass.cpp
  23. 13 1
      DevAdapter/self/gpio/VirtualDeviceClass.cpp
  24. 13 1
      DevAdapter/self/idcertificate/VirtualDeviceClass.cpp
  25. 13 1
      DevAdapter/self/pinpad/VirtualPinPadClass.cpp

+ 1 - 1
DevAdapter/CMakeLists.txt

@@ -294,7 +294,7 @@ if(DEVADAPTER_USING_CONAN)
         #合入目前全量包中的DEP文件内容
         conan_cmake_run(REQUIRES VendorDLL/7.6.0@LR04.02_VendorLib/testing
             BASIC_SETUP CMAKE_TARGETS)
-        set(SELF_CONAN_LIB_NAME self/2024.0808.02@LR04.02_VendorLib/testing)
+        set(SELF_CONAN_LIB_NAME self/2024.1025.01@LR04.02_VendorLib/testing)
         add_subdirectory(self)
     endif(MSVC)
 

+ 1 - 1
DevAdapter/Note.md

@@ -1,7 +1,7 @@
 # 打包指令
 `conan new cw/2021.0208.01 --bare`
 `conan export-pkg . LR04.02_VendorLib/testing -s arch=armv8 -s os=Linux -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=8 -s build_type=Debug`
-`conan upload cw/2021.0208.01@LR04.02_VendorLib/testing --all -r=conan-cmb`
+`conan upload self/2024.1025.01@LR04.02_VendorLib/testing --all -r=conan-cmb`
 
 `conan export-pkg . LR04.02_MediaRes/testing -s arch=armv8 -s os=Linux -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=8 -s build_type=Debug`
 `conan upload Audio/2023.0509.01@LR04.02_MediaRes/testing --all -r=conan-cmb`

+ 13 - 1
DevAdapter/self/cardissuer/VirtualDeviceClass.cpp

@@ -665,7 +665,7 @@ DEVICEBASE_API ErrorCodeEnum  CreateDevComponent(DeviceBaseClass*& pOutDevAptObj
 	return result;
 }
 
-DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
+DEVICEBASE_API ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
 {
 	ErrorCodeEnum result = Bridge_ReleaseDevObject();
 	if (result == Error_Succeed && pInDevAptObj != NULL) {
@@ -675,3 +675,15 @@ DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj
 	return result;
 }
 
+extern "C" DEVICEBASE_API void GetMoreErrorDetail(char* szErrMsg, DWORD * pMsgLen)
+{
+	if (szErrMsg != NULL && pMsgLen != NULL && *pMsgLen > 0) {
+		DevErrorInfo inner;
+		ErrorCodeEnum result = Bridge_GetLastErr(&inner);
+		if (result == Error_Succeed) {
+			strcpy_s(szErrMsg, *pMsgLen, inner.szErrMsg);
+			*pMsgLen = inner.dwErrMsgLen;
+		}
+	}
+}
+

+ 13 - 1
DevAdapter/self/contactlesscard/VirtualDeviceClass.cpp

@@ -169,7 +169,7 @@ DEVICEBASE_API ErrorCodeEnum  CreateDevComponent(DeviceBaseClass*& pOutDevAptObj
 	return result;
 }
 
-DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
+DEVICEBASE_API ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
 {
 	ErrorCodeEnum result = Bridge_ReleaseDevObject();
 	if (result == Error_Succeed && pInDevAptObj != NULL) {
@@ -179,3 +179,15 @@ DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj
 	return result;
 }
 
+extern "C" DEVICEBASE_API void GetMoreErrorDetail(char* szErrMsg, DWORD * pMsgLen)
+{
+	if (szErrMsg != NULL && pMsgLen != NULL && *pMsgLen > 0) {
+		DevErrorInfo inner;
+		ErrorCodeEnum result = Bridge_GetLastErr(&inner);
+		if (result == Error_Succeed) {
+			strcpy_s(szErrMsg, *pMsgLen, inner.szErrMsg);
+			*pMsgLen = inner.dwErrMsgLen;
+		}
+	}
+}
+

+ 6 - 2
DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.cpp

@@ -22,7 +22,7 @@ void SetLastErrInfo(const char* formatStr, ...)
 {
 	va_list arg;
 	va_start(arg, formatStr);
-	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	vsprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
 	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
 	va_end(arg);
 }
@@ -34,6 +34,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 	if (hinstLib != NULL) {
 		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for CreateDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -41,6 +42,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for ReleaseDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -48,6 +50,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
 		if (erroCode != Error_Succeed) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"RetCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt for AdapterObject\"}", GetLastError(), erroCode, __FUNCTION__, __LINE__);
 			pDevAdapterInstance = NULL;
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
@@ -55,6 +58,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 			return Error_NoTarget;
 		}
 		if (pDevAdapterInstance == NULL) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt return Null AdapterObject\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -62,7 +66,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 
 	} else {
-		SetLastErrInfo("load library failed %d", GetLastError());
+		SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:LoadLibraryA current adapter file failed\"}", GetLastError(), __FUNCTION__, __LINE__);
 		return Error_DevLoadFileFailed;
 	}
 	return Error_Succeed;

+ 1 - 1
DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.vcxproj

@@ -39,7 +39,7 @@
     <Import Project="..\..\LocalRun.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\devmake.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>

+ 6 - 2
DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.cpp

@@ -23,7 +23,7 @@ void SetLastErrInfo(const char* formatStr, ...)
 {
 	va_list arg;
 	va_start(arg, formatStr);
-	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	vsprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
 	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
 	va_end(arg);
 }
@@ -35,6 +35,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 	if (hinstLib != NULL) {
 		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for CreateDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -42,6 +43,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for ReleaseDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -49,6 +51,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
 		if (erroCode != Error_Succeed) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"RetCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt for AdapterObject\"}", GetLastError(), erroCode, __FUNCTION__, __LINE__);
 			pDevAdapterInstance = NULL;
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
@@ -56,6 +59,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 			return Error_NoTarget;
 		}
 		if (pDevAdapterInstance == NULL) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt return Null AdapterObject\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -63,7 +67,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 
 	} else {
-		SetLastErrInfo("load library failed %d", GetLastError());
+		SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:LoadLibraryA current adapter file failed\"}", GetLastError(), __FUNCTION__, __LINE__);
 		return Error_DevLoadFileFailed;
 	}
 	return Error_Succeed;

+ 1 - 1
DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.vcxproj

@@ -39,7 +39,7 @@
     <Import Project="..\..\LocalRun.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\devmake.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>

+ 7 - 4
DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.cpp

@@ -21,7 +21,7 @@ void SetLastErrInfo(const char* formatStr, ...)
 {
 	va_list arg;
 	va_start(arg, formatStr);
-	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	vsprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
 	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
 	va_end(arg);
 }
@@ -33,6 +33,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 	if (hinstLib != NULL) {
 		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for CreateDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -40,6 +41,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for ReleaseDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -47,6 +49,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
 		if (erroCode != Error_Succeed) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"RetCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt for AdapterObject\"}", GetLastError(), erroCode, __FUNCTION__, __LINE__);
 			pDevAdapterInstance = NULL;
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
@@ -54,15 +57,15 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 			return Error_NoTarget;
 		}
 		if (pDevAdapterInstance == NULL) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt return Null AdapterObject\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
 			return Error_Null;
 		}
 
-	}
-	else {
-		SetLastErrInfo("load library failed %d", GetLastError());
+	} else {
+		SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:LoadLibraryA current adapter file failed\"}", GetLastError(), __FUNCTION__, __LINE__);
 		return Error_DevLoadFileFailed;
 	}
 	return Error_Succeed;

+ 1 - 1
DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.vcxproj

@@ -39,7 +39,7 @@
     <Import Project="..\..\LocalRun.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\devmake.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>

+ 6 - 2
DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.cpp

@@ -20,7 +20,7 @@ void SetLastErrInfo(const char* formatStr, ...)
 {
 	va_list arg;
 	va_start(arg, formatStr);
-	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	vsprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
 	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
 	va_end(arg);
 }
@@ -32,6 +32,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 	if (hinstLib != NULL) {
 		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for CreateDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -39,6 +40,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for ReleaseDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -46,6 +48,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
 		if (erroCode != Error_Succeed) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"RetCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt for AdapterObject\"}", GetLastError(), erroCode, __FUNCTION__, __LINE__);
 			pDevAdapterInstance = NULL;
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
@@ -53,6 +56,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 			return Error_NoTarget;
 		}
 		if (pDevAdapterInstance == NULL) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt return Null AdapterObject\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -60,7 +64,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 
 	} else {
-		SetLastErrInfo("load library failed %d", GetLastError());
+		SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:LoadLibraryA current adapter file failed\"}", GetLastError(), __FUNCTION__, __LINE__);
 		return Error_DevLoadFileFailed;
 	}
 	return Error_Succeed;

+ 1 - 1
DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.vcxproj

@@ -39,7 +39,7 @@
     <Import Project="..\..\LocalRun.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\devmake.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>

+ 5 - 1
DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.cpp

@@ -35,6 +35,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 	if (hinstLib != NULL) {
 		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for CreateDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -42,6 +43,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for ReleaseDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -49,6 +51,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
 		if (erroCode != Error_Succeed) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"RetCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt for AdapterObject\"}", GetLastError(), erroCode, __FUNCTION__, __LINE__);
 			pDevAdapterInstance = NULL;
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
@@ -56,6 +59,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 			return Error_NoTarget;
 		}
 		if (pDevAdapterInstance == NULL) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt return Null AdapterObject\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -63,7 +67,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 
 	} else {
-		SetLastErrInfo("load library failed %d", GetLastError());
+		SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:LoadLibraryA current adapter file failed\"}", GetLastError(), __FUNCTION__, __LINE__);
 		return Error_DevLoadFileFailed;
 	}
 	return Error_Succeed;

+ 1 - 1
DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.vcxproj

@@ -39,7 +39,7 @@
     <Import Project="..\..\LocalRun.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\devmake.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>

+ 7 - 4
DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.cpp

@@ -19,7 +19,7 @@ void SetLastErrInfo(const char* formatStr, ...)
 {
 	va_list arg;
 	va_start(arg, formatStr);
-	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	vsprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
 	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
 	va_end(arg);
 }
@@ -31,6 +31,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 	if (hinstLib != NULL) {
 		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for CreateDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -38,6 +39,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for ReleaseDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -45,6 +47,7 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 		}
 		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
 		if (erroCode != Error_Succeed) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"RetCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt for AdapterObject\"}", GetLastError(), erroCode, __FUNCTION__, __LINE__);
 			pDevAdapterInstance = NULL;
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
@@ -52,15 +55,15 @@ LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPat
 			return Error_NoTarget;
 		}
 		if (pDevAdapterInstance == NULL) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt return Null AdapterObject\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
 			return Error_Null;
 		}
 
-	}
-	else {
-		SetLastErrInfo("load library failed %d", GetLastError());
+	} else {
+		SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:LoadLibraryA current adapter file failed\"}", GetLastError(), __FUNCTION__, __LINE__);
 		return Error_DevLoadFileFailed;
 	}
 	return Error_Succeed;

+ 1 - 1
DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.vcxproj

@@ -39,7 +39,7 @@
     <Import Project="..\..\LocalRun.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\devmake.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>

+ 6 - 2
DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.cpp

@@ -21,7 +21,7 @@ void SetLastErrInfo(const char* formatStr, ...)
 {
 	va_list arg;
 	va_start(arg, formatStr);
-	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	vsprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
 	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
 	va_end(arg);
 }
@@ -33,6 +33,7 @@ LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
 	if (hinstLib != NULL) {
 		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for CreateDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -40,6 +41,7 @@ LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
 		}
 		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
 		if (NULL == pFuncCreateAdapt) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:GetProcAddress for ReleaseDevComponent\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -47,6 +49,7 @@ LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
 		}
 		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
 		if (erroCode != Error_Succeed) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"RetCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt for AdapterObject\"}", GetLastError(), erroCode, __FUNCTION__, __LINE__);
 			pDevAdapterInstance = NULL;
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
@@ -54,6 +57,7 @@ LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
 			return Error_NoTarget;
 		}
 		if (pDevAdapterInstance == NULL) {
+			SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:pFuncCreateAdapt return Null AdapterObject\"}", GetLastError(), __FUNCTION__, __LINE__);
 			FreeLibrary(hinstLib);
 			pFuncCreateAdapt = NULL;
 			pFuncReleaseAdapt = NULL;
@@ -61,7 +65,7 @@ LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
 		}
 
 	} else {
-		SetLastErrInfo("load library failed %d", GetLastError());
+		SetLastErrInfo("{\"ErrCode\":%u, \"Description\":\"Func:%s,Line:%d,Msg:LoadLibraryA current adapter file failed\"}", GetLastError(), __FUNCTION__, __LINE__);
 		return Error_DevLoadFileFailed;
 	}
 	return Error_Succeed;

+ 1 - 1
DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.vcxproj

@@ -39,7 +39,7 @@
     <Import Project="..\..\LocalRun.props" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\devmake.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
   </PropertyGroup>

+ 3 - 3
DevAdapter/self/dep/liblog4vendor/liblog4vendor/liblog4vendor.vcxproj

@@ -37,11 +37,11 @@
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
   <PropertyGroup Label="UserMacros" />
-  <Import Project="..\..\libmakedep.setting" />
+  <Import Project="..\..\devmake.setting" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
     <TargetName>$(ProjectName)D</TargetName>
-    <OutDir>$(OUTROOT)\Run\version\$(ReleaseVersion)\bin\</OutDir>
+    <OutDir>$(BUILDOUTDIR)\</OutDir>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
@@ -52,7 +52,7 @@
       <WarningLevel>Level3</WarningLevel>
       <Optimization>Disabled</Optimization>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBLOG4VENDOR_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>./log4cplus/;$(FrameworkHeadRoot)\Common\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(DepInclude)/log4cplus;$(FrameworkHeadRoot)\Common\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
     </ClCompile>
     <Link>
       <SubSystem>Windows</SubSystem>

+ 3 - 2
DevAdapter/self/dep/liblog4vendor/liblog4vendor/log4cplus_helper.cpp

@@ -523,9 +523,10 @@ namespace cmb {
 			const int converted_ll = ((int)(level)+1) * 10000;
 			if (_log_level <= converted_ll) {
                 log_link link_item((VENDORLOG_LEVEL_E)(int)(level), VENDORLOG_TYPE_SYSTEM);
-                log_item logitem;
+				log_item logitem;
+				long cur_time = time(NULL);
                 link_item.result_msg(text).with_extend_log_or_not(false).fetch_log_item(logitem);
-                _upload_helper.pinst_log_producer_client_add_log(_upload_helper._client, &logitem, 1);
+                _upload_helper.pinst_log_producer_client_add_log(_upload_helper._client, &logitem, 1, cur_time);
 			}
         }
     }

+ 5 - 43
DevAdapter/self/dep/liblog4vendor/liblog4vendor/log4upload.h

@@ -25,9 +25,9 @@ typedef struct
 
 struct log_producer_config
 {
-    //守护上传:代替其他实体上传日志
+    //瀹堟姢涓婁紶锛氫唬鏇垮叾浠栧疄浣撲笂浼犳棩蹇�
     int enableGuarder;
-    //天眼要求字段
+    //澶╃溂瑕佹眰瀛楁�
     char* skyeyeServName;
     char* skyeyeCmptId;
     char* skyeyeCmptName;
@@ -36,7 +36,7 @@ struct log_producer_config
     char* skyeyeSn;
     char* skyeyeItem;
     char* skyeyeEntityName;
-    //统一日志要求字段
+    //缁熶竴鏃ュ織瑕佹眰瀛楁�
     char* unitedAppName;
     char* unitedVersion;
     int unitedNeedArchived;
@@ -82,13 +82,9 @@ struct log_producer_client
     void* private_data;
 } ;
 
-
-
 typedef int log_producer_result;
 typedef void(*pfn_on_log_producer_send_done)(log_producer_result, int, int, const char*, const char*, const unsigned char*, void*);
 
-#ifdef _WIN32
-
 typedef log_producer_config* (*pfn_create_log_producer_config)();
 typedef void(*pfn_log_producer_config_set_packet_log_bytes)(log_producer_config*, int32_t);
 typedef void(*pfn_log_producer_config_set_packet_log_count)(log_producer_config*, int32_t);
@@ -112,45 +108,11 @@ typedef void(*pfn_log_producer_config_set_united_needArchived)(log_producer_conf
 typedef void(*pfn_log_producer_config_set_united_deployUnitId)(log_producer_config*, char*);
 typedef void(*pfn_log_producer_config_set_united_serviceUnitId)(log_producer_config*, char*);
 
-typedef log_producer_client*(*pfn_create_log_producer_client)(log_producer_config*, pfn_on_log_producer_send_done, void*);
-typedef log_producer_result(*pfn_log_producer_client_add_log)(log_producer_client*, log_item*, int);
+typedef log_producer_client* (*pfn_create_log_producer_client)(log_producer_config*, pfn_on_log_producer_send_done, void*);
+typedef log_producer_result(*pfn_log_producer_client_add_log)(log_producer_client*, log_item*, int, long);
 
 typedef void(*pfn_log_producer_config_switch_debug_mode)(log_producer_config*, int32_t);
 
-#else
-
-using pfn_create_log_producer_config = log_producer_config*(*)();
-using pfn_log_producer_config_set_packet_log_bytes = void(*)(log_producer_config*, int32_t);
-using pfn_log_producer_config_set_packet_log_count = void(*)(log_producer_config*, int32_t);
-
-using pfn_log_producer_config_set_max_buffer_limit = void(*)(log_producer_config*, int64_t);
-using pfn_log_producer_config_set_send_thread_count = void(*)(log_producer_config*, int32_t);
-using pfn_log_producer_config_set_persistent_max_log_count = void(*)(log_producer_config*, int32_t);
-using pfn_log_producer_config_set_skyeye_servname = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_skyeye_cmptId = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_skyeye_cmptname = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_skyeye_version = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_persistent = void(*)(log_producer_config*, int32_t);
-using pfn_log_producer_config_set_skyeye_entityname = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_skyeye_item = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_persistent_file_path = void(*)(log_producer_config*, const char*);
-
-using pfn_log_producer_config_set_united_appname = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_united_version = void(*)(log_producer_config*, char*);
-
-using pfn_log_producer_config_set_united_needArchived = void(*)(log_producer_config*, int);
-using pfn_log_producer_config_set_united_deployUnitId = void(*)(log_producer_config*, char*);
-using pfn_log_producer_config_set_united_serviceUnitId = void(*)(log_producer_config*, char*);
-
-using pfn_create_log_producer_client = log_producer_client*(*)(log_producer_config*, pfn_on_log_producer_send_done, void*);
-using pfn_log_producer_client_add_log = log_producer_result(*)(log_producer_client*, log_item*, int);
-
-using pfn_log_producer_config_switch_debug_mode = void(*)(log_producer_config*, int32_t);
-
-#endif //_WIN32
-
-
-
 class upload_helper
 {
 public:

+ 13 - 1
DevAdapter/self/fingerprint/VirtualDeviceClass.cpp

@@ -130,7 +130,7 @@ DEVICEBASE_API ErrorCodeEnum  CreateDevComponent(DeviceBaseClass*& pOutDevAptObj
 	return result;
 }
 
-DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
+DEVICEBASE_API ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
 {
 	ErrorCodeEnum result = Bridge_ReleaseDevObject();
 	if (result == Error_Succeed && pInDevAptObj != NULL) {
@@ -140,3 +140,15 @@ DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj
 	return result;
 }
 
+extern "C" DEVICEBASE_API void GetMoreErrorDetail(char* szErrMsg, DWORD * pMsgLen)
+{
+	if (szErrMsg != NULL && pMsgLen != NULL && *pMsgLen > 0) {
+		DevErrorInfo inner;
+		ErrorCodeEnum result = Bridge_GetLastErr(&inner);
+		if (result == Error_Succeed) {
+			strcpy_s(szErrMsg, *pMsgLen, inner.szErrMsg);
+			*pMsgLen = inner.dwErrMsgLen;
+		}
+	}
+}
+

+ 13 - 1
DevAdapter/self/gpio/VirtualDeviceClass.cpp

@@ -31,7 +31,7 @@ DEVICEBASE_API ErrorCodeEnum  CreateDevComponent(DeviceBaseClass*& pOutDevAptObj
 	return result;
 }
 
-DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
+DEVICEBASE_API ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
 {
 	ErrorCodeEnum result = Bridge_ReleaseDevObject();
 	if (result == Error_Succeed && pInDevAptObj != NULL) {
@@ -41,6 +41,18 @@ DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj
 	return result;
 }
 
+extern "C" DEVICEBASE_API void GetMoreErrorDetail(char* szErrMsg, DWORD * pMsgLen)
+{
+	if (szErrMsg != NULL && pMsgLen != NULL && *pMsgLen > 0) {
+		DevErrorInfo inner;
+		ErrorCodeEnum result = Bridge_GetLastErr(&inner);
+		if (result == Error_Succeed) {
+			strcpy_s(szErrMsg, *pMsgLen, inner.szErrMsg);
+			*pMsgLen = inner.dwErrMsgLen;
+		}
+	}
+}
+
 VirtualDeviceClassImpl::VirtualDeviceClassImpl()
 {
 

+ 13 - 1
DevAdapter/self/idcertificate/VirtualDeviceClass.cpp

@@ -31,7 +31,7 @@ DEVICEBASE_API ErrorCodeEnum  CreateDevComponent(DeviceBaseClass*& pOutDevAptObj
 	return result;
 }
 
-DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
+DEVICEBASE_API ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
 {
 	ErrorCodeEnum result = Bridge_ReleaseDevObject();
 	if (result == Error_Succeed && pInDevAptObj != NULL) {
@@ -41,6 +41,18 @@ DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj
 	return result;
 }
 
+extern "C" DEVICEBASE_API void GetMoreErrorDetail(char* szErrMsg, DWORD * pMsgLen)
+{
+	if (szErrMsg != NULL && pMsgLen != NULL && *pMsgLen > 0) {
+		DevErrorInfo inner;
+		ErrorCodeEnum result = Bridge_GetLastErr(&inner);
+		if (result == Error_Succeed) {
+			strcpy_s(szErrMsg, *pMsgLen, inner.szErrMsg);
+			*pMsgLen = inner.dwErrMsgLen;
+		}
+	}
+}
+
 VirtualDeviceClassImpl::VirtualDeviceClassImpl()
 {
 

+ 13 - 1
DevAdapter/self/pinpad/VirtualPinPadClass.cpp

@@ -222,7 +222,7 @@ DEVICEBASE_API ErrorCodeEnum  CreateDevComponent(DeviceBaseClass*& pOutDevAptObj
 	return result;
 }
 
-DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
+DEVICEBASE_API ErrorCodeEnum ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj)
 {
 	ErrorCodeEnum result = Bridge_ReleaseDevObject();
 	if (result == Error_Succeed && pInDevAptObj != NULL) {
@@ -231,3 +231,15 @@ DEVICEBASE_API ErrorCodeEnum  ReleaseDevComponent(DeviceBaseClass*& pInDevAptObj
 	}
 	return result;
 }
+
+extern "C" DEVICEBASE_API void GetMoreErrorDetail(char* szErrMsg, DWORD * pMsgLen)
+{
+	if (szErrMsg != NULL && pMsgLen != NULL && *pMsgLen > 0) {
+		DevErrorInfo inner;
+		ErrorCodeEnum result = Bridge_GetLastErr(&inner);
+		if (result == Error_Succeed) {
+			strcpy_s(szErrMsg, *pMsgLen, inner.szErrMsg);
+			*pMsgLen = inner.dwErrMsgLen;
+		}
+	}
+}