Programmer's Guide

RaDeKL Radar API Programmer’s Guide 11
© Multispectral Solutions, Inc. 2006
RaDeKL_OpenRadar
Open a RaDeKL Radar device as identified by its serial number. Serial numbers are unique for each
specific unit. A list of all available RaDeKL Radar devices and their serial numbers is obtained by calling
RaDeKL_ListRadars.
Format:
ULONG RaDeKL_OpenRadar (RaDeKL_HANDLE *handle_ptr, char *serial_number);
Parameters:
handle_ptr Pointer to a RaDeKL_HANDLE to receive the handle for the opened device. All
further operations on that device will use this handle.
serial_number Pointer to a (null-terminated) character string containing the serial number of the
device to open. A list of all available RaDeKL Radar devices and their serial
numbers is obtained by calling RaDeKL_ListRadars.
Return Value:
RaDeKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Open (and close) the first radar unit found.
ULONG status;
DWORD numdevs;
static char **snum = NULL, **desc = NULL; // or make these global
static RaDeKL_HANDLE handle = NULL; // or make this global
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
if (status != RaDeKL_OK)
{
printf (“Unable to list devices: %s\n”, RaDeKL_GetStatusText (status));
return;
}
if (numdevs == 0)
{
printf (“No devices available\n”);
return;
}
status = RaDeKL_OpenRadar (&handle, snum[0]);
if (status != RADEKL_OK)
{
printf (“Open failed: %s\n”, RaDeKL_GetStatusText (status));
return;
}
// Do some work and then close the radar and set the handle to NULL
RaDeKL_CloseRadar (handle);
handle = NULL;