Programmer's Guide
RaDeKL Radar API Programmer’s Guide 26
© Multispectral Solutions, Inc. 2006
RaDeKL_SimulatorMode
The RaDeKL Radar API provides a transparent radar simulation mode. This allows programs using this API
to be tested without the need to have an actual RaDeKL Radar unit present. By default, Simulator Mode is
disabled, causing communications to occur with an actual radar device. In situations where an actual radar
unit is unavailable for testing of the software, simulation mode may be enabled, resulting in the proper and
expected behavior of all API functions with these considerations:
1. RaDeKL_ListRadars will detect four simulated radar units with serial numbers “SIM001”,
“SIM002”, “SIM003” and “SIM004” and a description of “RaDeKL Simulator”.
2. Any RaDeKL API function may be called for these simulated radar units, including detection
functions.
3. Detection will result in range bin data representing a dampened sine wave, rotating over time
(or successive detections) for SIM001 and other diagnostic waveforms for SIM002 - SIM004.
4. Since there is no physical communication to an actual radar unit, some error paths in the
program may not be sufficiently tested using Simulator Mode.
Format:
bool RaDeKL_SimulatorMode (bool enable);
Parameters:
enable Flag to enable (true) or disable (false) the RaDeKL Simulator Mode.
Return Value:
The previous value of the RaDeKL Simulator Mode.
Remarks:
Normally, this function would be called at the start of your program, before any potential radar units
have been opened. However, if a program switches dynamically between Simulator and actual
radar modes, ensure that any open radar devices (real or simulated) are closed first using
RaDeKL_CloseRadar. Toggling Simulator Mode will cause RaDeKL_ListRadars to return a different
list of available radar devices. Therefore a call to RaDeKL_SimulatorMode should always be
followed by a call to RaDeKL_ListRadars to refresh the list of available devices.
Example:
Enable the RaDeKL Simulator mode.
ULONG status;
DWORD numdevs;
static char **snum = NULL, **desc = NULL; // or make these global
RaDeKL_SimulatorMode (true);
printf (“The RaDeKL Simulation Mode is now enabled\n”);
status = RaDeKL_ListRadars (&numdevs, &snum, &desc);
// Check status . . .