This module simulates data for the BSC Transmitter . The API for this module is available here: ANT BSC simulator
The module uses the Sensor Data Simulator to simulate automatic changes of the speed and cadence values.
Initialization
Use the following command to initialize the module:
const ant_bsc_simulator_cfg_t simulator_cfg =
{
.p_profile = &m_ant_bsc,
.device_type = SENSOR_TYPE,
};
If you want the speed and cadence values to be changed automatically, add the following statement:
ant_bsc_simulator_init(&m_ant_bsc_simulator, &simulator_cfg, true);
If you want to be able to change the speed and cadence values manually, add the following statement:
ant_bsc_simulator_init(&m_ant_bsc_simulator, &simulator_cfg, false);
Including the module in an application
Periodically call the BSC simulator in the application to prepare data for each TX event occurrence. The following snippet shows how to do this:
{
switch (event)
{
case ANT_BSC_PAGE_0_UPDATED:
/* fall through */
case ANT_BSC_PAGE_1_UPDATED:
/* fall through */
case ANT_BSC_PAGE_2_UPDATED:
/* fall through */
case ANT_BSC_PAGE_3_UPDATED:
/* fall through */
case ANT_BSC_PAGE_4_UPDATED:
/* fall through */
case ANT_BSC_PAGE_5_UPDATED:
/* fall through */
ant_bsc_simulator_one_iteration(&m_ant_bsc_simulator);
break;
default:
break;
}
}
The following snippet shows how to change the speed and cadence values manually:
void bsp_evt_handler(bsp_event_t evt)
{
switch (evt)
{
case BSP_EVENT_KEY_0:
ant_bsc_simulator_increment(&m_ant_bsc_simulator);
break;
case BSP_EVENT_KEY_1:
ant_bsc_simulator_decrement(&m_ant_bsc_simulator);
break;
default:
return; // no implementation needed
}
}