Returns the number of available devices.


int miraacq_GetDeviceCount(makernelpma);


Parameters:

  • pma: A pointer to the acquisition kernel returned by miraacq_Init.


Return value:

The number of available devices found.


Description:

miraacq_GetDeviceCount will return the number of available devices found by miraacq_ScanDevices. The name of each available device can be retrieved using miraacq_GetDeviceName.


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.


  1. MIRAACQ_CHECK(miraacq_ScanDevices(pma));

  2. const int deviceCount = miraacq_GetDeviceCount(pma);
  3. printf("%d devices:\n", deviceCount);
  4. for (int i = 0; i < deviceCount; i++) {
  5.     printf(" %d : %s\n", imiraacq_GetDeviceName(pma, i));
  6. }

  7. Error:
  8. if (res != MIRA_OK) {
  9.     printf("Error %d: %s", miraacq_GetErrorCode(pma), miraacq_GetErrorMsg(pma));
  10. }


Output:

1 devices:

 0 : MC023MG-SY-UB