This module contains the APIs and types exposed by the Running Speed and Cadence Service Client module. These APIs and types can be used by the application to perform discovery of Running Speed and Cadence Service at the peer and interact with it.
- Note
- The application must register this module as BLE event observer using the NRF_SDH_BLE_OBSERVER macro. Example:
#define BLE_RSCS_C_DEF |
( |
|
_name | ) |
|
Macro for defining a ble_rscs_c instance.
- Parameters
-
_name | Name of the instance. |
#define BLE_RSCS_INSTANT_STRIDE_LEN_PRESENT 0x00 |
Instantaneous Stride Length Measurement Supported bit.
#define BLE_RSCS_TOTAL_DISTANCE_PRESENT 0x01 |
Total Distance Measurement Supported bit.
#define BLE_RSCS_WALKING_OR_RUNNING_STATUS_BIT 0x02 |
Walking or Running Status Supported bit.
Event handler type.
This is the type of the event handler that should be provided by the application of this module in order to receive events.
RSCS Client event type.
Enumerator |
---|
BLE_RSCS_C_EVT_DISCOVERY_COMPLETE |
Event indicating that the Running Speed and Cadence Service has been discovered at the peer.
|
BLE_RSCS_C_EVT_RSC_NOTIFICATION |
Event indicating that a notification of the Running Speed and Cadence measurement characteristic has been received from the peer.
|
Function for assigning handles to a this instance of rscs_c.
Call this function when a link has been established with a peer to associate this link to this instance of the module. This makes it possible to handle several link and associate each link to a particular instance of this module. The connection handle and attribute handles will be provided from the discovery event BLE_RSCS_C_EVT_DISCOVERY_COMPLETE.
- Parameters
-
[in] | p_ble_rscs_c | Pointer to the RSC client structure instance to associate. |
[in] | conn_handle | Connection handle to associated with the given RSCS Client Instance. |
[in] | p_peer_handles | Attribute handles on the RSCS server that you want this RSCS client to interact with. |
Function for initializing the Running Speed and Cadence Service Client module.
This function will initialize the module and set up Database Discovery to discover the Running Speed and Cadence Service. After calling this function, call ble_db_discovery_start to start discovery once a link with a peer has been established.
- Parameters
-
[out] | p_ble_rscs_c | Pointer to the RSC Service client structure. |
[in] | p_ble_rscs_c_init | Pointer to the RSC Service initialization structure containing the initialization information. |
- Return values
-
void ble_rscs_c_on_ble_evt |
( |
ble_evt_t const * |
p_ble_evt, |
|
|
void * |
p_context |
|
) |
| |
Function for handling the Application's BLE Stack events.
Handles all events from the BLE stack of interest to the Running Speed and Cadence Service client.
- Parameters
-
[in] | p_ble_evt | Event received from the BLE stack. |
[in] | p_context | Running Speed and Cadence Service client structure. |
Function for handling events from the database discovery module.
Call this function when getting a callback event from the DB discovery modue. This function will handle an event from the database discovery module, and determine if it relates to the discovery of Running Speed and Cadence service at the peer. If so, it will call the application's event handler indicating that the RSC service has been discovered at the peer. It also populates the event with the service related information before providing it to the application.
- Parameters
-
| p_ble_rscs_c | Pointer to the Runnind Speed and Cadence Service client structure. |
[in] | p_evt | Pointer to the event received from the database discovery module. |