Programmer's Guide

RaDeKL Radar API Programmer’s Guide 27
© Multispectral Solutions, Inc. 2006
Part V: Radar Detection Functions
RaDeKL_DetectSingle
Perform a single radar detection and return the range bin data.
NOTE: The number of range bins is currently 256 with possible data values between 0 and 32, but
the actual number of range bins and the range of their possible values should be obtained by
calling RaDeKL_GetDeviceInfo and using range_bins, range_bin_min and range_bin_max, as they
might change with future versions of the radar unit.
Format:
ULONG RaDeKL_DetectSingle (RaDeKL_HANDLE handle, BYTE *data);
Parameters:
handle RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
data Pointer to a BYTE array to receive the radar return data.
Note: This array is not null-terminated, since zeroes may appear in the data.
Note: the size of this array and the maximum value for each range bin are currently
fixed at 256 and 32, respectively, but might change with future versions. See notes
above.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example:
Initiate a single detection and print the range bin data.
ULONG status, i;
RaDeKL_HANDLE handle;
RaDeKL_DEVICEINFO info;
BYTE data[2048]; // Make this sufficiently large
// Assume we have an open radar with a valid handle
status = RaDeKL_GetDeviceInfo (handle, &info);
// Check status . . .
status = RaDeKL_DetectSingle (handle, data);
// Check status . . .
for (i = 0; i < info.range_bins; i++)
printf (“Range bin [%3d] contains: %d\n”, i, data[i]);