Machine Vision Camera SDK (C) Developer Guide
if (MV_OK != nRet)
{
printf("error: StopGrabbing fail [%x]\n", nRet);
return;
}
//Shut device and release resource
nRet = MV_CC_CloseDevice(m_handle);
if (MV_OK != nRet)
{
printf("error: CloseDevice fail [%x]\n", nRet);
return;
}
//Destroy handle and release resource
nRet = MV_CC_DestroyHandle(m_handle);
if (MV_OK != nRet)
{
printf("error: DestroyHandle fail [%x]\n", nRet);
return;
}
}
(For Linux system) The following sample code is for reference only.
#include "MvCameraControl.h"
#define MAX_IMAGE_DATA_SIZE (20*1024*1024)
#define NIL (0)
// Press "Enter" to end streaming or exit
void PressEnterToExit(void)
{
int c;
while ( (c = getchar()) != '\n' && c != EOF );
fprintf( stderr, "\nPress enter to exit.\n");
while( getchar() != '\n');
sleep(1);
}
bool PrintDeviceInfo(MV_CC_DEVICE_INFO* pstMVDevInfo)
{
if (NULL == pstMVDevInfo)
{
printf("%s\n" , "The Pointer of pstMVDevInfoList is NULL!");
return false;
}
if (pstMVDevInfo->nTLayerType == MV_GIGE_DEVICE)
{
// Print the IP address and user name of current camera
printf("%s %x\n" , "nCurrentIp:" , pstMVDevInfo-
>SpecialInfo.stGigEInfo.nCurrentIp);
printf("%s %s\n\n" , "chUserDefinedName:" , pstMVDevInfo-
136
    "