Machine Vision Camera SDK (C) Developer Guide
{
while(!_kbhit())
{
Sleep(10);
}
_getch();
}
int main()
{
int nRet = MV_OK;
void* handle = NULL;
bool bDevConnected = false;
do
{
//Whether device is connected
//Enumerate device
MV_CC_DEVICE_INFO_LIST stDeviceList;
memset(&stDeviceList, 0, sizeof(MV_CC_DEVICE_INFO_LIST));
nRet = MV_CC_EnumDevices(MV_CAMERALINK_DEVICE, &stDeviceList);
if (MV_OK != nRet)
{
printf("Enum Devices fail! nRet [0x%x]\n", nRet);
break;
}
if (m_stDevList.nDeviceNum == 0)
{
printf("no camera found!\n");
return 0;
}
// Select device and create handle
nRet = MV_CC_CreateHandle(&handle, stDeviceList.pDeviceInfo[0]);
if (MV_OK != nRet)
{
printf("Create Handle fail! nRet [0x%x]\n", nRet);
break;
}
// Get device baud rate
unsigned int nCurrentBaudrate = 0;
nRet = MV_CAML_GetDeviceBauderate(handle, &nCurrentBaudrate);
if (MV_OK != nRet)
{
printf("Get device bauderate fail! nRet [0x%x]\n", nRet);
break;
}
printf("Current device bauderate [0x%x]\n", nCurrentBaudrate);
//Open specified device
nRet = MV_CC_OpenDevice(handle);
if (MV_OK != nRet)
76
    "