#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
#include "MvCameraControl.h"
void PressEnterToExit(void)
{
int c;
while ( (c = getchar()) != '\n' && c != EOF );
fprintf( stderr, "\nPress enter to exit.\n");
while( getchar() != '\n');
}
{
if (NULL == pstMVDevInfo)
{
printf("The Pointer of pstMVDevInfo is NULL!\n");
return false;
}
{
printf("CurrentIp: %d.%d.%d.%d\n" , nIp1, nIp2, nIp3, nIp4);
}
{
}
else
{
printf("Not support.\n");
}
return true;
}
int main()
{
void* handle = NULL;
do
{
if (MV_OK != nRet)
{
printf("MV_CC_EnumDevices fail! nRet [%x]\n", nRet);
break;
}
{
{
printf("[device %d]:\n", i);
if (NULL == pDeviceInfo)
{
break;
}
PrintDeviceInfo(pDeviceInfo);
}
}
else
{
printf("Find No Devices!\n");
break;
}
printf("Please Intput camera index: ");
unsigned int nIndex = 0;
scanf("%d", &nIndex);
{
printf("Intput error!\n");
break;
}
if (MV_OK != nRet)
{
printf("MV_CC_CreateHandle fail! nRet [%x]\n", nRet);
break;
}
if (MV_OK != nRet)
{
printf("MV_CC_OpenDevice fail! nRet [%x]\n", nRet);
break;
}
if (MV_OK == nRet)
{
printf(
"stLineSelector current value:%d\n", stLineSelector.
nCurValue);
printf(
"supported stLineSelector number:%d\n", stLineSelector.
nSupportedNum);
{
printf(
"supported stLineSelector [%d]:%d\n", i, stLineSelector.
nSupportValue[i]);
}
printf("\n");
}
else
{
printf("get stLineSelector failed! nRet [%x]\n\n", nRet);
}
unsigned int nLineSelector = 0;
printf("please input the LineSelector to set: ");
scanf("%d", &nLineSelector);
if (MV_OK == nRet)
{
printf("set LineSelector OK!\n\n");
}
else
{
printf("set LineSelector failed! nRet [%x]\n\n", nRet);
}
if (MV_OK == nRet)
{
printf(
"stLineMode current value:%d\n", stLineMode.
nCurValue);
printf(
"supported stLineSelector number:%d\n", stLineMode.
nSupportedNum);
{
printf(
"supported stLineSelector [%d]:%d\n", i, stLineMode.
nSupportValue[i]);
}
printf("\n");
}
else
{
printf("get stLineMode failed! nRet [%x]\n\n", nRet);
}
unsigned int nLineMode = 0;
printf("please input the LineMode to set:");
scanf("%d", &nLineMode);
if (MV_OK == nRet)
{
printf("set LineMode OK!\n\n");
}
else
{
printf("set LineMode failed! nRet [%x]\n\n", nRet);
}
if (MV_OK != nRet)
{
printf("MV_CC_CloseDevice fail! nRet [%x]\n", nRet);
break;
}
if (MV_OK != nRet)
{
printf("MV_CC_DestroyHandle fail! nRet [%x]\n", nRet);
break;
}
} while (0);
if (nRet != MV_OK)
{
if (handle != NULL)
{
handle = NULL;
}
}
printf("exit\n");
return 0;
}