#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("MV_CC_EnumDevicesByInterface fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("no device! fail!\n");
break;
}
printf(
"Please input camera index(0-%d):", stDeviceList.
nDeviceNum-1);
nIndex = 0;
scanf("%d", &nIndex);
{
printf("Input error!\n");
break;
}
{
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");
{
if (nPacketSize > 0)
{
{
printf("Warning: Set Packet Size fail nRet [0x%x]!", nRet);
}
}
else
{
printf("Warning: Get Packet Size fail nRet [0x%x]!", nPacketSize);
}
}
{
printf("Register Image CallBack fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Set Trigger Mode fail! nRet [0x%x]\n", nRet);
break;
}
{
printf("Start Grabbing fail! nRet [0x%x]\n", nRet);
break;
}
printf("Start grabbing success!\n");
printf("Press a key to stop grabbing.\n");
printf("Stop grabbing success!\n");
printf("Close device success!\n");
printf("Destroy device handle success!\n");
hDevHandle = NULL;
printf("Close interface success!\n");
printf("Destroy interface success!\n");
hInterface = NULL;
} while (0);
if (hDevHandle != NULL)
{
hDevHandle = NULL;
}
if (hInterface != NULL)
{
hInterface = NULL;
}
printf("exit.\n");
}
{
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 (pstFrame)
{
if (false == bAutoFree &&
NULL != pUser)
{
}
}
}