Cycling Speed and Cadence Service module.
More...
|
struct | ble_cscs_evt_t |
| Cycling Speed and Cadence Service event. More...
|
|
struct | ble_cscs_init_t |
| Cycling Speed and Cadence Service init structure. This contains all options and data needed for initialization of the service. More...
|
|
struct | ble_cscs_s |
| Cycling Speed and Cadence Service structure. This contains various status information for the service. More...
|
|
struct | ble_cscs_meas_s |
| Cycling Speed and Cadence Service measurement structure. This contains a Cycling Speed and Cadence Service measurement. More...
|
|
This module implements the Cycling Speed and Cadence Service. If enabled, notification of the Cycling Speead and Candence Measurement is performed when the application calls ble_cscs_measurement_send().
To use this service, you need to provide the the supported features (Cycling Speed and Cadence Service feature bits). If you choose to support Wheel revolution data (feature bit BLE_CSCS_FEATURE_WHEEL_REV_BIT), you then need to support the 'setting of cumulative value' operation by the supporting the Speed and Cadence Control Point (Speed and Cadence Control Point) by setting the BLE_SRV_SC_CTRLPT_CUM_VAL_OP_SUPPORTED bit of the ctrplt_supported_functions in the ble_cscs_init_t structure. If you want to support the 'start autocalibration' control point feature, you need, after the BLE_SC_CTRLPT_EVT_START_CALIBRATION has been received and the auto calibration is finished, to call the ble_sc_ctrlpt_rsp_send to indicate that the operation is finished and thus be able to receive new control point operations. If you want to support the 'sensor location' related operation, you need to provide a list of supported location in the ble_cscs_init_t structure.
- Note
- The application or the service using this module must propagate BLE stack events to the Cycling Speead and Candence Service module by calling ble_cscs_on_ble_evt() from the from the BLE Stack Event Handler function. This service will forward the event to the Speed and Cadence Control Point module.
Enumerator |
---|
BLE_CSCS_EVT_NOTIFICATION_ENABLED |
Cycling Speed and Cadence value notification enabled event.
|
BLE_CSCS_EVT_NOTIFICATION_DISABLED |
Cycling Speed and Cadence value notification disabled event.
|
- Parameters
-
[out] | p_cscs | Cycling Speed and Cadence Service structure. This structure will have to be supplied by the application. It will be initialized by this function, and will later be used to identify this particular service instance. |
[in] | p_cscs_init | Information needed to initialize the service. |
- Returns
- NRF_SUCCESS on successful initialization of service, otherwise an error code.
Handles all events from the BLE stack of interest to the Cycling Speed and Cadence Service.
- Parameters
-
[in] | p_cscs | Cycling Speed and Cadence Service structure. |
[in] | p_ble_evt | Event received from the BLE stack. |
The application calls this function after having performed a Cycling Speed and Cadence Service measurement. If notification has been enabled, the measurement data is encoded and sent to the client.
- Parameters
-
[in] | p_cscs | Cycling Speed and Cadence Service structure. |
[in] | p_measurement | Pointer to new cycling speed and cadence measurement. |
- Returns
- NRF_SUCCESS on success, otherwise an error code.