This information applies to the following SoftDevice: S212
This module implements the Bicycle Power ANT+ device profile. The API for this module is available here: Bicycle Power 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 Bicycle Power Receiver implementation:
- TRACE_BPWR_GENERAL_ENABLE: Output page number of the current page.
- TRACE_BPWR_PAGE_1_ENABLE: Output page 1 data.
- TRACE_BPWR_PAGE_16_ENABLE: Output page 16 data.
- TRACE_BPWR_PAGE_17_ENABLE: Output page 17 data.
- TRACE_BPWR_PAGE_18_ENABLE: Output page 18 data.
- TRACE_COMMON_PAGE_80_ENABLE: Output common page 80 data.
- TRACE_COMMON_PAGE_81_ENABLE: Output common page 81 data.
The above macros must be defined on the project settings level.
Bicycle Power Receiver (display)
This module covers the full receiver implementation (PWR):
- Receive all power pages: 0x10, 0x11, 0x12.
- Provide the user a means to initiate and confirm a calibration procedure (throw page 0x01).
- Receive manufacturer and product information (ANT+ common data page 0x50, 0x51).
The following code snippets show how to initialize the profile:
BPWR_CHANNEL_NUM,
CHAN_ID_TRANS_TYPE,
CHAN_ID_DEV_NUM,
ANTPLUS_NETWORK_NUM);
ant_bpwr_evt_handler);
BPWR_DISP_CHANNEL_CONFIG(m_ant_bpwr),
BPWR_DISP_PROFILE_CONFIG(m_ant_bpwr));
After opening the profile instance channel, the module keeps the profile structure updated.
The sample application that uses the Bicycle Power Profile to implement a display is available here: Receiver
Bicycle Power Transmitter (sensor)
This module implements the power and torque sensor features:
- Transmit power-only main data page (0x10).
- Transmit torque at wheel main data page (0x11).
- Transmit torque at crank main data page (0x12).
- Transmit manufacturer and product information (ANT+ common data page 0x50, 0x51).
- Confirm a calibration procedure (0x01).
You can configure which type of sensor is implemented: power-only sensor, torque sensor at wheel, or torque sensor at crank.
The following code snippets show how to initialize the profile:
BPWR_CHANNEL_NUM,
CHAN_ID_TRANS_TYPE,
CHAN_ID_DEV_NUM,
ANTPLUS_NETWORK_NUM);
ant_bpwr_calib_handler,
ant_bpwr_evt_handler);
BPWR_SENS_CHANNEL_CONFIG(m_ant_bpwr),
BPWR_SENS_PROFILE_CONFIG(m_ant_bpwr));
BPWR_MANUFACTURER_ID,
BPWR_MODEL_NUMBER);
BPWR_SW_REVISION_MINOR,
BPWR_SERIAL_NUMBER);
The following snippet shows how to handle calibration request:
{
{
m_ant_bpwr.BPWR_PROFILE_general_calib_data = CALIBRATION_DATA;
break;
m_ant_bpwr.BPWR_PROFILE_general_calib_data = CALIBRATION_DATA;
break;
memcpy(m_ant_bpwr.BPWR_PROFILE_custom_calib_data, p_page1->data.custom_calib,
sizeof (m_ant_bpwr.BPWR_PROFILE_custom_calib_data));
break;
memcpy(m_ant_bpwr.BPWR_PROFILE_custom_calib_data, p_page1->data.custom_calib,
sizeof (m_ant_bpwr.BPWR_PROFILE_custom_calib_data));
break;
default:
break;
}
}
After opening the profile instance channel, the module broadcasts the data from the profile structure. The user application should keep this structure updated.
The sample application that uses the Bicycle Power Profile to implement a sensor is available here: Sensor