
Machine Vision Camera SDK (C) Developer Guide
device*********************/
// Get supported baud rate of connecting device and host
unsigned int nBaudrateAblity = 0;
nRet = MV_CAML_GetSupportBauderates(handle, &nBaudrateAblity);
if (MV_OK != nRet)
{
printf("Get supported bauderate fail! nRet [0x%x]\n", nRet);
break;
}
printf("Current device supported bauderate [0x%x]\n", nBaudrateAblity);
// Open specified device
nRet = MV_CC_OpenDevice(handle);
if (MV_OK != nRet)
{
printf("Open Device fail! nRet [0x%x]\n", nRet);
break;
}
bDevConnected = true;
// Shut device
nRet = MV_CC_CloseDevice(handle);
if (MV_OK != nRet)
{
printf("ClosDevice fail! nRet [0x%x]\n", nRet);
break;
}
bDevConnected = false;
//Destroy handle and release resource
nRet = MV_CC_DestroyHandle(handle);
if (MV_OK != nRet)
{
printf("Destroy Handle fail! nRet [0x%x]\n", nRet);
break;
}
printf("Device successfully closed.\n");
} while (0);
// Make sure the device is shutted down
if (nRet != MV_OK)
{
if ( bDevConnected )
{
MV_CC_CloseDevice(handle);
bDevConnected = false;
}
if (handle != NULL)
{
MV_CC_DestroyHandle(handle);
handle = NULL;
}
}
83



































































































































































































































































































































































































