miraacq_ScanDevices
Scan available acquisition devices
int mira_ScanDevices(makernel *pma)
Input:
- Runtime environment pointer pmr
Output: Result: MIRA_OK or error code
Description:
miraacq_ScanDevices searches for available acquisition devices. After calling miraacq_ScanDevices, one can get device count using miraacq_GetDeviceCount and names with miraacq_GetDeviceName.
Example:
MIRAACQ_CHECK( miraacq_ScanDevices(pma) );
const int devCount=miraacq_GetDeviceCount(pma);
printf("\n%d devices:\n",devCount);
for(int i=0;i<devCount;i++) {
printf("%d : %s\n",i, miraacq_GetDeviceName(pma,i));
}
...
Error:
if( res!=MIRA_OK ) {
printf("Error %d: %s",miraacq_GetErrorCode(pma),miraacq_GetErrorMsg(pma));
}
miraacq_Release(pma);
The MIRAACQ_CHECK macro checks the output result. If error occurs, the program flow is terminated. See miracq.h definition. Note that the MIRAACQ_CHECK macro expects an Error label defined. The following code can display the error message and release the runtime.