You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
2.6 KiB
C++

#include <stdio.h>
#include "HVDLL.h"
#include <string.h>
#include <unistd.h>
int CARINFO_BEGIN_FUN(void * pFirstParameter, DWORD32 dwCardID)
{
//pDlg->OnHvResultBegin(dwCardID);
printf("begin is %d\n",dwCardID);
return 0;
}
int CARINFO_END_FUN(void * pFirstParameter, DWORD32 dwCardID)
{
printf("end is %d\n",dwCardID);
return 0;
}
int PLATE_NO_FUN(
void * pFirstParameter,
DWORD32 dwCardID,
PSTR pcPlateNo,
DWORD64 dwTimeMs
)
{
printf("planteNo is %s\n",pcPlateNo);
return 0;
}
int BIG_IMAGE_FUN(
void *pFirstParameter,
DWORD32 dwCarID,
WORD wImageWidth,
WORD wImageHigh,
BYTE bType,
WORD wSize,
PBYTE pbImage,
WORD wImageID,
WORD wHighImgFlag,
WORD wPlateWidth,
WORD wPlateHigh,
DWORD64 dwTimeMs
)
{
printf("call big fun, len is %d,flag is %d\n",wSize,wHighImgFlag);
return 0;
}
int SMALL_IMAGE_FUN(
void *pFirstParameter,
DWORD32 dwCarID,
WORD wImageWidth,
WORD wImageHigh,
BYTE bType,
WORD wSize,
BYTE *pbImage,
DWORD64 dwTimeMs
)
{
printf("call small fun, len is %d\n",wSize);
return 0;
}
int BINARY_IMAGE_FUN(
void *pFirstParameter,
DWORD32 dwCarID,
WORD wImageWidth,
WORD wImageHigh,
BYTE bType,
WORD wSize,
BYTE *pbImage,
DWORD64 dwTimeMs
)
{
printf("call bin fun, len is %d\n",wSize);
return 0;
}
int main()
{
int i =0;
void * ptr;
char buf[32];
HRESULT hRet;
HV_HANDLE m_HvHdl;
strcpy(buf,"192.168.10.206");
m_HvHdl= OpenHv(buf);
if(! m_HvHdl)
{
printf("this is openHv faile %lu\n",(long long)ptr);
}
else
{
printf("openHv sucess %lu\n", (long long)ptr);
}
hRet = SetHvCallBack(m_HvHdl, (void *)CARINFO_BEGIN_FUN, NULL, 0, _TYPE_CARINFO_BEGIN);
if (0 != hRet)
{
printf("beginfun fail\n");
return false;
}
hRet = SetHvCallBack(m_HvHdl, (void *)CARINFO_END_FUN, NULL, 0, _TYPE_CARINFO_END);
if (0 != hRet)
{
printf("endfun fail\n");
return false;
}
hRet = SetHvCallBack(m_HvHdl, (void *)BIG_IMAGE_FUN, NULL, 0, _TYPE_BIG_IMAGE);
if (0 != hRet)
{
printf("bigfun fail\n");
return false;
}
hRet = SetHvCallBack(m_HvHdl, (void *)SMALL_IMAGE_FUN, NULL, 0, _TYPE_SMALL_IMAGE);
if (0 != hRet)
{
printf("smallfun fail\n");
return false;
}
hRet = SetHvCallBack(m_HvHdl, (void *)BINARY_IMAGE_FUN, NULL, 0, _TYPE_BINARY_IMAGE);
if (0 != hRet)
{
printf("binfun fail\n");
return false;
}
hRet = SetHvCallBack(m_HvHdl, (void *)PLATE_NO_FUN, NULL, 0, _TYPE_PLATE_STR);
if (0 != hRet)
{
printf("platefun fail\n");
return false;
}
while(true)
{
sleep(10);
}
return 0;
}