This module simulates data for the SDM Transmitter . The API for this module is available here: ANT SDM simulator
The module uses the Sensor Data Simulator to simulate automatic changes of the cadence value.
Initialization
Use the following command to initialize the module:
SIMULATOR_STRIDE_LEN,
SIMULATOR_BURN_RATE,
SIMULATOR_MIN,
SIMULATOR_MAX,
SIMULATOR_INCR);
If you want the cadence to be changed automatically, add the following statement:
ant_sdm_simulator_init(&m_ant_sdm_simulator, &simulator_cfg, true);
If you want to be able to change the cadence manually, add the following statement:
ant_sdm_simulator_init(&m_ant_sdm_simulator, &simulator_cfg, false);
Including the module in an application
Periodically call the SDM simulator in the application to prepare data for each TX event occurrence. The following snippet shows how to do this:
{
switch (event)
{
case ANT_SDM_PAGE_1_UPDATED:
/* fall through */
case ANT_SDM_PAGE_2_UPDATED:
/* fall through */
case ANT_SDM_PAGE_3_UPDATED:
/* fall through */
case ANT_SDM_PAGE_16_UPDATED:
/* fall through */
case ANT_SDM_PAGE_22_UPDATED:
/* fall through */
case ANT_SDM_PAGE_80_UPDATED:
/* fall through */
case ANT_SDM_PAGE_81_UPDATED:
ant_sdm_simulator_one_iteration(&m_ant_sdm_simulator);
break;
default:
break;
}
}
The following snippet shows how to change the cadence manually:
void bsp_evt_handler(bsp_event_t evt)
{
switch (evt)
{
case BSP_EVENT_KEY_0:
ant_sdm_simulator_increment(&m_ant_sdm_simulator);
break;
case BSP_EVENT_KEY_1:
ant_sdm_simulator_decrement(&m_ant_sdm_simulator);
break;
default:
return; // no implementation needed
}
}