Programmer's Guide

RaDeKL Radar API Programmer’s Guide 28
© Multispectral Solutions, Inc. 2006
RaDeKL_StartContinuousDetection
Start continuous detection, with a new detection occurring each interval set with RaDeKL_SetInterval. This
function is intended to be used in conjunction with RaDeKL_ReadDetectionData and
RaDeKL_StopContinuousDetection.
Note: Unless there is an initially known fixed number of detections to be performed, continuous
detection may require a separate thread to execute RaDeKL_ReadDetectionData, or otherwise it
may be impossible to issue RaDeKL_StopContinuousDetection since RaDeKL_ReadDetectionData
will be in a tight loop waiting for the next detection data to arrive. See examples below for
clarification.
Note: While in continuous detection mode, do not issue any other register read/write functions
(except RaDeKL_StopContinuousDetection) as their processing will interfere with the continuous
data stream returned by the RaDeKL Radar device. See Usage Warnings towards the top of this
document for clarification.
Format:
ULONG RaDeKL_StartContinuousDetection (RaDeKL_HANDLE handle);
Parameters:
handle RaDeKL_HANDLE as returned by a call to RaDeKL_OpenRadar.
Return Value:
RADEKL_OK (0) if successful, a non-zero status otherwise. See RaDeKL_GetStatusText for codes.
Example 1:
Process 100 continuous radar detections.
ULONG status, count;
RaDeKL_HANDLE handle;
BYTE data[2048]; // Make this sufficiently large
// Assume we have an open radar with a valid handle
status = RaDeKL_StartContinuousDetection (handle);
// Check status . . .
count = 100;
while (count--)
{
status = RaDeKL_ReadDetectionData (handle, data);
// Check status . . .
// Do something with the data . . .
//
}
status = RaDeKL_StopContinuousDetection (handle);
// Check status . . .
// Flush the buffers
status = RaDeKL_FlushIO (handle);
// Check status . . .