#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
{
int c;
while ( (c = getchar()) != '\n' && c != EOF );
fprintf( stderr, "\nPress enter to exit.\n");
while( getchar() != '\n');
}
{
void* hInterface = NULL;
void* hDevHandle = NULL;
do
{
{
printf("Initialize SDK fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Enum interfaces fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Enum interfaces success!\n\n");
}
else
{
printf("Find no interface!\n");
break;
}
printf(
"Please input interfaces index(0-%d):", stInterfaceInfoList.
nInterfaceNum-1);
unsigned int nIndex = 0;
scanf("%d", &nIndex);
{
printf("Input error!\n");
break;
}
{
printf("Create interface success!\n");
}
else
{
printf("Create interface Handle fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Open interface success!\n");
}
else
{
printf("Open interface fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("EventNotificationOn fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Register Event CallBack fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("MV_CC_EnumDevicesByInterface fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("no device! fail!\n");
break;
}
nIndex = 0;
{
printf("Create handle fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Open device fail! nRet [0x%x]\n", nRet);
break;
}
printf("Open device success!\n");
{
printf("Register Image CallBack fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Start Grabbing fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Stop Grabbing fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("ClosDevice fail! nRet [0x%x]\n", nRet);
break;
}
printf("Close device success!\n");
{
printf("Destroy handle fail! nRet [0x%x]\n", nRet);
break;
}
printf("Destroy device handle success!\n");
hDevHandle = NULL;
{
printf("Close interface success!\n");
}
else
{
printf("Close interface Handle fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Destroy interface success!\n");
}
else
{
printf("Destroy interface Handle fail! nRet [0x%x]\n", nRet);
break;
}
hInterface = NULL;
} while (0);
if (hDevHandle != NULL)
{
hDevHandle = NULL;
}
if (hInterface != NULL)
{
hInterface = NULL;
}
}
{
for (
unsigned int i = 0; i < stDeviceList.
nDeviceNum; i++)
{
printf("[device %d]:\n", i);
{
printf("CurrentIp: %d.%d.%d.%d\n" , nIp1, nIp2, nIp3, nIp4);
}
{
}
{
}
{
}
{
}
{
}
else
{
printf("Not support.\n");
}
}
return true;
}
{
for (
unsigned int i = 0; i < stInterfaceInfoList.
nInterfaceNum; i++)
{
printf("[Interface %d]:\n", i);
if (NULL == pstInterfaceInfo)
{
break;
}
printf(
"model name: %s\n",pstInterfaceInfo->
chModelName);
printf("\n");
}
return true;
}
{
if (pEventInfo)
{
printf("EventName[%s], EventID[%u], Timestamp[%lu]\n",
}
}
{
if (pstFrame)
{
if (false == bAutoFree &&
NULL != pUser)
{
}
}
}