nRF5 SDK v17.1.0
Bicycle Speed and Cadence
This information applies to the following SoftDevice: S212

This module implements the Bicycle Speed and Cadence ANT+ device profile. The API for this module is available here: Bicycle Speed and Cadence profile

During initialization, the module configures the selected channel and resets the profile data.

Compile time configuration options

The module traces profile-specific information to UART using the logger.

The following configuration options are available at compile time to assist in the development phase of the BSC Receiver implementation:

The above macros must be defined on the project settings level.

BSC Receiver

The following code snippets show how to initialize the BSC Receiver:

void ant_bsc_evt_handler(ant_bsc_profile_t * p_profile, ant_bsc_evt_t event);
BSC_CHANNEL_NUM,
CHAN_ID_TRANS_TYPE,
DISPLAY_TYPE,
CHAN_ID_DEV_NUM,
ANTPLUS_NETWORK_NUM,
ant_bsc_evt_handler);
static ant_bsc_profile_t m_ant_bsc;
uint32_t err_code;
err_code = ant_bsc_disp_init(&m_ant_bsc,
BSC_DISP_CHANNEL_CONFIG(m_ant_bsc),
BSC_DISP_PROFILE_CONFIG(m_ant_bsc));
APP_ERROR_CHECK(err_code);
err_code = ant_bsc_disp_open(&m_ant_bsc);
APP_ERROR_CHECK(err_code);
APP_ERROR_CHECK(err_code);

After opening the profile instance channel, the module keeps the profile structure updated.

Three different message periods are supported:

The sample application that uses the Bicycle Speed and Cadence Profile is available here: Receiver

BSC Transmitter

The following code snippets show how to initialize the BSC Transmitter:

void ant_bsc_evt_handler(ant_bsc_profile_t * p_profile, ant_bsc_evt_t event);
BSC_CHANNEL_NUM,
CHAN_ID_TRANS_TYPE,
SENSOR_TYPE,
CHAN_ID_DEV_NUM,
ANTPLUS_NETWORK_NUM);
true,
true,
ant_bsc_evt_handler);
static ant_bsc_profile_t m_ant_bsc;
uint32_t err_code;
err_code = ant_bsc_sens_init(&m_ant_bsc,
BSC_SENS_CHANNEL_CONFIG(m_ant_bsc),
BSC_SENS_PROFILE_CONFIG(m_ant_bsc));
APP_ERROR_CHECK(err_code);
m_ant_bsc.BSC_PROFILE_manuf_id = BSC_MF_ID;
m_ant_bsc.BSC_PROFILE_serial_num = BSC_SERIAL_NUMBER;
m_ant_bsc.BSC_PROFILE_hw_version = BSC_HW_VERSION;
m_ant_bsc.BSC_PROFILE_sw_version = BSC_SW_VERSION;
m_ant_bsc.BSC_PROFILE_model_num = BSC_MODEL_NUMBER;
err_code = ant_bsc_sens_open(&m_ant_bsc);
APP_ERROR_CHECK(err_code);
APP_ERROR_CHECK(err_code);

After opening the profile instance channel, the module broadcasts the data from the profile structure. The user application should keep this structure updated. Users can configure which main data page is used (page 0 or 5) and whether page 1 and/or page 4 are present.

The sample application that uses the Bicycle Speed and Cadence Profile is available here: Transmitter

Note
The application must propagate ANT stack events to the ANT Bicycle Speed and Cadence module by calling ant_bsc_tx_evt_handle() or ant_bsc_rx_evt_handle() from the ant_event_handler callback.
Warning
The ant_event_handler is called from an interrupt. Therefore, the profile structure is changed asynchronously.

Documentation feedback | Developer Zone | Subscribe | Updated