nRF5 SDK v17.1.0
Stride Based Speed and Distance Monitor
This information applies to the following SoftDevice: S212

This module implements the Stride Based Speed and Distance Monitor ANT+ device profile. The API for this module is available here: Stride Based Speed and Distance Monitor profile

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

This module uses the ANT page request controller to handle page data requests.

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 SDM Receiver implementation:

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

SDM Receiver

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

void ant_sdm_evt_handler(ant_sdm_profile_t * p_profile, ant_sdm_evt_t event);
SDM_CHANNEL_NUM,
CHAN_ID_TRANS_TYPE,
CHAN_ID_DEV_NUM,
ANTPLUS_NETWORK_NUM,
ant_sdm_evt_handler);
static ant_sdm_profile_t m_ant_sdm;
uint32_t err_code;
err_code = ant_sdm_disp_init(&m_ant_sdm,
SDM_DISP_CHANNEL_CONFIG(m_ant_sdm),
SDM_DISP_PROFILE_CONFIG(m_ant_sdm));
APP_ERROR_CHECK(err_code);
err_code = ant_sdm_disp_open(&m_ant_sdm);
APP_ERROR_CHECK(err_code);
APP_ERROR_CHECK(err_code);

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

Two different message periods are supported:

The sample application that uses the SDM Receiver is available here: Receiver

SDM Transmitter

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

void ant_sdm_evt_handler(ant_sdm_profile_t * p_profile, ant_sdm_evt_t event);
SDM_CHANNEL_NUM,
CHAN_ID_TRANS_TYPE,
CHAN_ID_DEV_NUM,
ANTPLUS_NETWORK_NUM);
ant_sdm_evt_handler);
static ant_sdm_profile_t m_ant_sdm;
uint32_t err_code;
err_code = ant_sdm_sens_init(&m_ant_sdm,
SDM_SENS_CHANNEL_CONFIG(m_ant_sdm),
SDM_SENS_PROFILE_CONFIG(m_ant_sdm));
APP_ERROR_CHECK(err_code);
// fill manufacturer's common data page.
m_ant_sdm.page_80 = ANT_COMMON_page80(SDM_HW_REVISION,
SDM_MANUFACTURER_ID,
SDM_MODEL_NUMBER);
// fill product's common data page.
m_ant_sdm.page_81 = ANT_COMMON_page81(SDM_SW_REVISION_MAJOR,
SDM_SW_REVISION_MINOR,
SDM_SERIAL_NUMBER);
// fill capabilities.
m_ant_sdm.SDM_PROFILE_capabilities.cadency_is_valid = true;
m_ant_sdm.SDM_PROFILE_capabilities.speed_is_valid = true;
m_ant_sdm.SDM_PROFILE_capabilities.calorie_is_valid = true;
m_ant_sdm.SDM_PROFILE_capabilities.time_is_valid = true;
m_ant_sdm.SDM_PROFILE_capabilities.latency_is_valid = true;
m_ant_sdm.SDM_PROFILE_capabilities.distance_is_valid = true;
// fill status.
m_ant_sdm.SDM_PROFILE_status.state = ANT_SDM_USE_STATE_ACTIVE;
m_ant_sdm.SDM_PROFILE_status.health = ANT_SDM_HEALTH_OK;
m_ant_sdm.SDM_PROFILE_status.battery = ANT_SDM_BATTERY_STATUS_GOOD;
m_ant_sdm.SDM_PROFILE_status.location = ANT_SDM_LOCATION_ANKLE;
err_code = ant_sdm_sens_open(&m_ant_sdm);
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 supplementary data page is used (page 2 or 3). Choosing data page 1 will disable this feature.

The sample application that uses the SDM Transmitter is available here: Transmitter

Note
The application must propagate ANT stack events to the ANT Stride Based Speed and Distance Monitor module by calling ant_sdm_tx_evt_handle() or ant_sdm_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