miraacq_ScanDevices
Scans for available devices.
int miraacq_ScanDevices(makernel* pma);
Parameters:
- pma: A pointer to the acquisition kernel returned by miraacq_Init.
Return value:
MIRA_OK (0) or an error code.
Description:
miraacq_ScanDevices will scan for available devices to use for acquisition, this can be network and/or USB devices depending on the plugin. After this function it will be possible to get the number of available devices using miraacq_GetDeviceCount, get their names using miraacq_GetDeviceName, and open them using miraacq_OpenDevice.
Example:
Note the MIRAACQ_CHECK macro, which will check if the return value was MIRA_OK (0) or an error code. In case of an error code, it will jump to a label called Error.
- MIRAACQ_CHECK(miraacq_ScanDevices(pma));
- const int deviceCount = miraacq_GetDeviceCount(pma);
- printf("%d devices:\n", deviceCount);
- for (int i = 0; i < deviceCount; 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));
- }
Output:
1 devices:
0 : MC023MG-SY-UB