SmartSnippets DA1459x SDK
cscs_client.h
Go to the documentation of this file.
1 
43 #ifndef CSCS_CLIENT_H_
44 #define CSCS_CLIENT_H_
45 
46 #include <string.h>
47 #include "ble_gattc.h"
48 #include "ble_client.h"
49 
53 typedef enum {
61 
65 typedef enum {
81 
85 typedef enum {
117 
123 typedef struct {
137 
141 typedef enum {
145 
149 typedef enum {
153 
163  att_error_t status, uint16_t features);
164 
175  cscs_client_event_t event, att_error_t status, bool enabled);
176 
186  cscs_client_event_t event, att_error_t status);
187 
197  att_error_t status, bool enabled);
198 
207  att_error_t status);
208 
218  cscs_client_status_t status);
219 
230  att_error_t status,
232 
242  cscs_client_status_t status);
243 
256  uint8_t locations_count, const uint8_t *locations);
257 
267  const cscs_client_measurement_t *measurement);
268 
272 typedef struct {
295 
307  const ble_evt_gattc_browse_svc_t *evt);
308 
320 
331 
345 
359 bool cscs_client_set_event_state(ble_client_t *client, cscs_client_event_t event, bool enable);
360 
373 
387 
398 
412 
425 
437 bool cscs_client_set_cumulative_value(ble_client_t *client, uint32_t value);
438 
450 
466  const void *data, size_t length);
467 #endif /* CSCS_CLIENT_H_ */
468 
ble_evt_gattc_browse_svc_t
Definition: ble_gattc.h:118
CSCS_CLIENT_SENSOR_LOCATION_CHAINSTAY
Definition: cscs_client.h:109
cscs_client_callbacks_t::set_event_state_completed
cscs_client_set_event_state_completed_cb_t set_event_state_completed
Definition: cscs_client.h:278
cscs_client_status_t
cscs_client_status_t
Definition: cscs_client.h:65
cscs_client_callbacks_t::set_sc_control_point_state_completed
cscs_client_set_sc_control_point_state_completed_cb_t set_sc_control_point_state_completed
Definition: cscs_client.h:282
cscs_client_measurement_t::last_crank_event_time
uint16_t last_crank_event_time
Definition: cscs_client.h:135
cscs_client_callbacks_t
Definition: cscs_client.h:272
CSCS_CLIENT_FEATURE_MULTIPLE_SENSOR_LOCATIONS
Definition: cscs_client.h:59
cscs_client_get_capabilities
cscs_client_cap_t cscs_client_get_capabilities(ble_client_t *client)
Get capabilities.
CSCS_CLIENT_SENSOR_LOCATION_CHEST
Definition: cscs_client.h:115
cscs_client_callbacks_t::update_sensor_location_completed
cscs_client_update_sensor_location_completed_cb_t update_sensor_location_completed
Definition: cscs_client.h:286
CSCS_CLIENT_STATUS_INVALID_PARAM
Definition: cscs_client.h:71
cscs_client_set_event_state_completed_cb_t
void(* cscs_client_set_event_state_completed_cb_t)(ble_client_t *client, cscs_client_event_t event, att_error_t status)
Set event state completed callback.
Definition: cscs_client.h:185
cscs_client_update_sensor_location_completed_cb_t
void(* cscs_client_update_sensor_location_completed_cb_t)(ble_client_t *client, cscs_client_status_t status)
Update sensor location callback.
Definition: cscs_client.h:217
att_error_t
att_error_t
Definition: ble_att.h:64
CSCS_CLIENT_STATUS_TIMEOUT
Definition: cscs_client.h:79
CSCS_CLIENT_STATUS_OPCODE_NOT_SUPPORTED
Definition: cscs_client.h:69
CSCS_CLIENT_SENSOR_LOCATION_LEFT_CRANK
Definition: cscs_client.h:97
CSCS_CLIENT_SENSOR_LOCATION_REAR_DROPOUT
Definition: cscs_client.h:107
CSCS_CLIENT_STATUS_IMPROPERLY_CONFIGURED
Definition: cscs_client.h:77
cscs_client_measurement_t::cumulative_crank_revolutions
uint16_t cumulative_crank_revolutions
Definition: cscs_client.h:133
CSCS_CLIENT_SENSOR_LOCATION_OTHER
Definition: cscs_client.h:87
cscs_client_feature_t
cscs_client_feature_t
Definition: cscs_client.h:53
cscs_client_callbacks_t::get_event_state_completed
cscs_client_get_event_state_completed_cb_t get_event_state_completed
Definition: cscs_client.h:276
cscs_client_callbacks_t::set_cumulative_value_completed
cscs_client_set_cumulative_value_completed_cb_t set_cumulative_value_completed
Definition: cscs_client.h:288
cscs_client_event_t
cscs_client_event_t
Definition: cscs_client.h:141
cscs_client_set_cumulative_value
bool cscs_client_set_cumulative_value(ble_client_t *client, uint32_t value)
Set cumulative value.
cscs_client_read_sensor_location
bool cscs_client_read_sensor_location(ble_client_t *client)
Read sensor location.
cscs_client_callbacks_t::get_sc_control_point_state_completed
cscs_client_get_sc_control_point_state_completed_cb_t get_sc_control_point_state_completed
Definition: cscs_client.h:280
cscs_client_init
ble_client_t * cscs_client_init(const cscs_client_callbacks_t *cb, const ble_evt_gattc_browse_svc_t *evt)
Register CSC Client instance.
cscs_client_callbacks_t::csc_measurement
cscs_client_csc_measurement_cb_t csc_measurement
Definition: cscs_client.h:293
CSCS_CLIENT_STATUS_OPERATION_FAILED
Definition: cscs_client.h:73
cscs_client_get_sc_control_point_ind_state
bool cscs_client_get_sc_control_point_ind_state(ble_client_t *client)
Get control point state.
cscs_client_get_sc_control_point_state_completed_cb_t
void(* cscs_client_get_sc_control_point_state_completed_cb_t)(ble_client_t *client, att_error_t status, bool enabled)
Get control point state completed callback.
Definition: cscs_client.h:196
cscs_client_get_event_state
bool cscs_client_get_event_state(ble_client_t *client, cscs_client_event_t event)
Get event state.
cscs_client_set_sc_control_point_state_completed_cb_t
void(* cscs_client_set_sc_control_point_state_completed_cb_t)(ble_client_t *client, att_error_t status)
Set control point state completed callback.
Definition: cscs_client.h:206
cscs_client_measurement_t::cumulative_wheel_revolutions
uint32_t cumulative_wheel_revolutions
Definition: cscs_client.h:129
ble_client
Definition: ble_client.h:154
CSCS_CLIENT_SENSOR_LOCATION_REAR_WHEEL
Definition: cscs_client.h:111
cscs_client_read_sensor_location_completed_cb_t
void(* cscs_client_read_sensor_location_completed_cb_t)(ble_client_t *client, att_error_t status, cscs_client_sensor_location_t location)
Read sensor location callback.
Definition: cscs_client.h:229
CSCS_CLIENT_STATUS_OPERATION_IN_PROGRESS
Definition: cscs_client.h:75
CSCS_CLIENT_STATUS_SUCCESS
Definition: cscs_client.h:67
cscs_client_get_event_state_completed_cb_t
void(* cscs_client_get_event_state_completed_cb_t)(ble_client_t *client, cscs_client_event_t event, att_error_t status, bool enabled)
Get event state completed callback.
Definition: cscs_client.h:174
cscs_client_measurement_t::last_wheel_event_time
uint16_t last_wheel_event_time
Definition: cscs_client.h:131
CSCS_CLIENT_EVENT_CSC_MEASUREMENT_NOTIF
Definition: cscs_client.h:143
CSCS_CLIENT_SENSOR_LOCATION_IN_SHOE
Definition: cscs_client.h:91
cscs_client_request_supported_sensor_locations
bool cscs_client_request_supported_sensor_locations(ble_client_t *client)
Request supported sensor locations.
cscs_client_set_event_state
bool cscs_client_set_event_state(ble_client_t *client, cscs_client_event_t event, bool enable)
Set event state.
cscs_client_measurement_t::wheel_revolution_data_present
bool wheel_revolution_data_present
Definition: cscs_client.h:125
cscs_client_cap_t
cscs_client_cap_t
Definition: cscs_client.h:149
CSCS_CLIENT_CAP_SENSOR_LOCATION
Definition: cscs_client.h:151
CSCS_CLIENT_SENSOR_LOCATION_RIGHT_CRANK
Definition: cscs_client.h:99
CSCS_CLIENT_FEATURE_WHEEL_REVOLUTION_DATA
Definition: cscs_client.h:55
cscs_client_callbacks_t::request_supported_sensor_locations_completed
cscs_client_request_supported_sensor_locations_completed_cb_t request_supported_sensor_locations_completed
Definition: cscs_client.h:291
cscs_client_request_supported_sensor_locations_completed_cb_t
void(* cscs_client_request_supported_sensor_locations_completed_cb_t)(ble_client_t *client, cscs_client_status_t status, uint8_t locations_count, const uint8_t *locations)
Request supported sensor locations callback.
Definition: cscs_client.h:255
cscs_client_measurement_t
Definition: cscs_client.h:123
CSCS_CLIENT_SENSOR_LOCATION_HIP
Definition: cscs_client.h:93
cscs_client_read_csc_features_completed_cb_t
void(* cscs_client_read_csc_features_completed_cb_t)(ble_client_t *client, att_error_t status, uint16_t features)
Read feature completed callback.
Definition: cscs_client.h:162
CSCS_CLIENT_SENSOR_LOCATION_FRONT_WHEEL
Definition: cscs_client.h:95
cscs_client_read_csc_features
bool cscs_client_read_csc_features(ble_client_t *client)
Read CSC features.
cscs_client_set_sc_control_point_ind_state
bool cscs_client_set_sc_control_point_ind_state(ble_client_t *client, bool enable)
Set control point state.
cscs_client_csc_measurement_cb_t
void(* cscs_client_csc_measurement_cb_t)(ble_client_t *client, const cscs_client_measurement_t *measurement)
CSC measurement callback.
Definition: cscs_client.h:266
CSCS_CLIENT_SENSOR_LOCATION_RIGHT_PEDAL
Definition: cscs_client.h:103
ble_gattc.h
BLE GATT Client API.
CSCS_CLIENT_SENSOR_LOCATION_REAR_HUB
Definition: cscs_client.h:113
cscs_client_init_from_data
ble_client_t * cscs_client_init_from_data(uint16_t conn_idx, const cscs_client_callbacks_t *cb, const void *data, size_t length)
Initialize CSCP Client instance from buffered (cached) data and register application callbacks.
cscs_client_callbacks_t::read_sensor_location_completed
cscs_client_read_sensor_location_completed_cb_t read_sensor_location_completed
Definition: cscs_client.h:284
cscs_client_callbacks_t::read_csc_features_completed
cscs_client_read_csc_features_completed_cb_t read_csc_features_completed
Definition: cscs_client.h:274
CSCS_CLIENT_FEATURE_CRANK_REVOLUTION_DATA
Definition: cscs_client.h:57
CSCS_CLIENT_SENSOR_LOCATION_FRONT_HUB
Definition: cscs_client.h:105
CSCS_CLIENT_SENSOR_LOCATION_TOP_OF_SHOE
Definition: cscs_client.h:89
cscs_client_set_cumulative_value_completed_cb_t
void(* cscs_client_set_cumulative_value_completed_cb_t)(ble_client_t *client, cscs_client_status_t status)
Set cumulative value callback.
Definition: cscs_client.h:241
ble_client.h
GATT Client handling routines API.
CSCS_CLIENT_SENSOR_LOCATION_LEFT_PEDAL
Definition: cscs_client.h:101
cscs_client_measurement_t::crank_revolution_data_present
bool crank_revolution_data_present
Definition: cscs_client.h:127
cscs_client_sensor_location_t
cscs_client_sensor_location_t
Definition: cscs_client.h:85
cscs_client_sc_control_point_timeout
void cscs_client_sc_control_point_timeout(ble_client_t *client)
Control point operation timeout.
cscs_client_update_sensor_location
bool cscs_client_update_sensor_location(ble_client_t *client, cscs_client_sensor_location_t location)
Update sensor location.