This example introduces the preparation, use, and cleanup of the system object, interface and camera lists, interfaces, and cameras. It also touches on retrieving information from pre-fetched nodes using QuickSpin. Retrieving node information is the only portion of the example that differs from Enumeration_C.
A much wider range of topics is covered in the full Spinnaker examples than in the QuickSpin ones. There are only enough QuickSpin examples to demonstrate node access and to get started with the API; please see full Spinnaker examples for further or specific knowledge on a topic.
#include "stdio.h"
#include "string.h"
#define MAX_BUFF_LEN 256
{
unsigned int i = 0;
quickSpinTLInterface qsI;
{
printf("Unable to pre-fetch TL interface nodes. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to check node readability (interface display name). Aborting with error %d...\n\n", err);
return err;
}
if (interfaceDisplayNameIsReadable)
{
err =
spinStringGetValue(qsI.InterfaceDisplayName, interfaceDisplayName, &lenInterfaceDisplayName);
{
printf("Unable to retrieve value (interface display name). Aborting with error %d...\n\n", err);
return err;
}
}
else
{
strcpy(interfaceDisplayName, "Interface display name not readable");
}
printf("%s\n", interfaceDisplayName);
size_t numCameras = 0;
{
printf("Unable to create camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to retrieve camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to retrieve number of cameras. Aborting with error %d...\n\n", err);
return err;
}
if (numCameras == 0)
{
printf("\tNo devices detected.\n\n");
{
printf("Unable to clear camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to destroy camera list. Aborting with error %d...\n\n", err);
return err;
}
return err;
}
for (i = 0; i < numCameras; i++)
{
{
printf("Unable to retrieve camera. Aborting with error %d...\n\n", err);
return err;
}
quickSpinTLDevice qsD;
{
printf("Unable to pre-fetch TL device nodes. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to check readability (vendor name). Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to check readability (model name). Aborting with error %d...\n\n", err);
return err;
}
if (deviceVendorNameIsReadable)
{
{
printf("Unable to retrieve device information (vendor name value). Aborting with error %d...\n\n", err);
return err;
}
}
else
{
strcpy(deviceVendorName, "Not readable");
}
if (deviceModelNameIsReadable)
{
{
printf("Unable to retrieve device information (model name value). Aborting with error %d...\n\n", err);
return err;
}
}
else
{
strcpy(deviceModelName, "Not readable");
}
printf("\tDevice %d %s %s\n\n", i, deviceVendorName, deviceModelName);
{
printf("Unable to release camera. Aborting with error %d...\n\n", err);
return err;
}
}
{
printf("Unable to clear camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to destroy camera list. Aborting with error %d...\n\n", err);
return err;
}
return err;
}
{
unsigned int i = 0;
printf("Application build date: %s %s \n\n", __DATE__, __TIME__);
{
printf("Unable to retrieve system instance. Aborting with error %d...\n\n", err);
return err;
}
spinLibraryVersion hLibraryVersion;
printf(
"Spinnaker library version: %d.%d.%d.%d\n\n",
hLibraryVersion.major,
hLibraryVersion.minor,
hLibraryVersion.type,
hLibraryVersion.build);
size_t numInterfaces = 0;
{
printf("Unable to create empty interface list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to retrieve interface list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to retrieve number of interfaces. Aborting with err %d...\n\n", err);
return err;
}
printf("Number of interfaces detected: %u\n\n", (unsigned int)numInterfaces);
size_t numCameras = 0;
{
printf("Unable to create camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to retrieve camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to retrieve number of cameras. Aborting with error %d...\n\n", err);
return err;
}
printf("Number of cameras detected: %u\n\n", (unsigned int)numCameras);
if (numCameras == 0 || numInterfaces == 0)
{
{
printf("Unable to clear camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to destroy camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to clear interface list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to destroy interface list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to release system instance. Aborting with error %d...\n\n", err);
return err;
}
printf("\nNot enough cameras/interfaces!\n");
printf("Done! Press Enter to exit...\n");
getchar();
return -1;
}
printf("\n*** QUERYING INTERFACES ***\n\n");
for (i = 0; i < numInterfaces; i++)
{
{
printf("Unable to retrieve interface from list (error %d)...\n", err);
errReturn = err;
continue;
}
{
errReturn = err;
}
{
errReturn = err;
}
}
{
printf("Unable to clear camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to destroy camera list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to clear interface list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to destroy interface list. Aborting with error %d...\n\n", err);
return err;
}
{
printf("Unable to release system instance. Aborting with error %d...\n\n", err);
return err;
}
printf("\nDone! Press Enter to exit...\n");
getchar();
return errReturn;
}