Programmer's Guide
RaDeKL Radar API Programmer’s Guide 9
© Multispectral Solutions, Inc. 2006
Example 1:
List all available radar units and display the information obtained.
ULONG status, i;
DWORD numdevs;
static char **snum = NULL, **desc = NULL; // or make these global
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
if (status != RaDeKL_OK)
{
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return;
}
printf (“Number of devices detected: %d\n”, numdevs);
for (i = 0; i < numdevs; i++)
printf (“Device %d, Serial: %s, Description: %s\n”, i, snum[i], desc[i]);
Example 2:
Alternately, if we don’t care about the number of devices or their descriptions, the following code segment
will return only the (null-terminated) list of serial numbers:
ULONG status;
static char **snum = NULL; // or make this global
char **s;
status = RaDeKL_ListRadars (NULL, &snum, NULL);
if (status != RaDeKL_OK)
{
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return;
}
for (s = snum; *s; s++)
printf (“Serial Number: %s\n”, *s);