nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
rscs.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef BT_RSCS_H_
8#define BT_RSCS_H_
9
10#include <stdlib.h>
11#include <zephyr/types.h>
12
19#ifdef __cplusplus
20extern "C" {
21#endif
22
42
44};
45
48 uint32_t other : 1;
49 uint32_t top_of_shoe : 1;
50 uint32_t in_shoe : 1;
51 uint32_t hip : 1;
52 uint32_t front_wheel : 1;
53 uint32_t left_crank : 1;
54 uint32_t right_crank : 1;
55 uint32_t left_pedal : 1;
56 uint32_t right_pedal : 1;
57 uint32_t front_hub : 1;
58 uint32_t rear_dropout : 1;
59 uint32_t chainstay : 1;
60 uint32_t rear_wheel : 1;
61 uint32_t rear_hub : 1;
62 uint32_t chest : 1;
63 uint32_t spider : 1;
64 uint32_t chain_ring : 1;
65};
66
70 uint8_t inst_stride_len : 1;
71
73 uint8_t total_distance : 1;
74
76 uint8_t walking_or_running : 1;
77
79 uint8_t sensor_calib_proc : 1;
80
82 uint8_t multi_sensor_loc : 1;
83};
84
89
92};
93
95typedef void (*bt_rscs_evt_handler) (enum bt_rscs_evt evt);
96
106 int (*set_cumulative)(uint32_t total_distance);
107
113 int (*calibration)(void);
114
119 void (*update_loc)(uint8_t location);
120};
121
126
129
132
135
137 const struct bt_rscs_cp_cb *cp_cb;
138};
139
144
147
150
152 uint16_t inst_speed;
153
156
159
162};
163
176int bt_rscs_measurement_send(struct bt_conn *conn, const struct bt_rscs_measurement *measurement);
177
185int bt_rscs_init(const struct bt_rscs_init_params *init);
186
187#ifdef __cplusplus
188}
189#endif
190
195#endif /* BT_RSCS_H_ */
int bt_rscs_init(const struct bt_rscs_init_params *init)
Function for initializing the Running Speed and Cadence Service.
bt_rscs_evt
Definition: rscs.h:86
@ RSCS_EVT_MEAS_NOTIFY_DISABLE
Definition: rscs.h:91
@ RSCS_EVT_MEAS_NOTIFY_ENABLE
Definition: rscs.h:88
int bt_rscs_measurement_send(struct bt_conn *conn, const struct bt_rscs_measurement *measurement)
Function for sending Running Speed and Cadence measurement.
void(* bt_rscs_evt_handler)(enum bt_rscs_evt evt)
Running Speed and Cadence Service event handler type.
Definition: rscs.h:95
bt_rscs_location
RSC Sensor Locations.
Definition: rscs.h:24
@ RSC_LOC_TOP_OF_SHOE
Definition: rscs.h:26
@ RSC_LOC_FRONT_WHEEL
Definition: rscs.h:29
@ RSC_LOC_REAR_HUB
Definition: rscs.h:38
@ RSC_LOC_CHEST
Definition: rscs.h:39
@ RSC_LOC_FRONT_HUB
Definition: rscs.h:34
@ RSC_LOC_REAR_WHEEL
Definition: rscs.h:37
@ RSC_LOC_CHAIN_RING
Definition: rscs.h:41
@ RSC_LOC_OTHER
Definition: rscs.h:25
@ RSC_LOC_LEFT_PEDAL
Definition: rscs.h:32
@ RSC_LOC_HIP
Definition: rscs.h:28
@ RSC_LOC_REAR_DROPOUT
Definition: rscs.h:35
@ RSC_LOC_IN_SHOE
Definition: rscs.h:27
@ RSC_LOC_LEFT_CRANK
Definition: rscs.h:30
@ RSC_LOC_CHAINSTAY
Definition: rscs.h:36
@ RSC_LOC_AMT
Definition: rscs.h:43
@ RSC_LOC_RIGHT_PEDAL
Definition: rscs.h:33
@ RSC_LOC_RIGHT_CRANK
Definition: rscs.h:31
@ RSC_LOC_SPIDER
Definition: rscs.h:40
uint32_t rear_wheel
Definition: rscs.h:60
uint32_t front_hub
Definition: rscs.h:57
uint32_t front_wheel
Definition: rscs.h:52
uint32_t top_of_shoe
Definition: rscs.h:49
uint32_t left_crank
Definition: rscs.h:53
uint32_t right_crank
Definition: rscs.h:54
uint32_t chain_ring
Definition: rscs.h:64
uint32_t right_pedal
Definition: rscs.h:56
uint32_t in_shoe
Definition: rscs.h:50
uint32_t rear_dropout
Definition: rscs.h:58
uint32_t hip
Definition: rscs.h:51
uint32_t chest
Definition: rscs.h:62
uint32_t chainstay
Definition: rscs.h:59
uint32_t left_pedal
Definition: rscs.h:55
uint32_t other
Definition: rscs.h:48
uint32_t rear_hub
Definition: rscs.h:61
uint32_t spider
Definition: rscs.h:63
Bitmask set of supported location.
Definition: rscs.h:47
void(* update_loc)(uint8_t location)
Update Sensor Location Procedure.
Definition: rscs.h:119
int(* set_cumulative)(uint32_t total_distance)
Set Cumulative Value Procedure.
Definition: rscs.h:106
int(* calibration)(void)
Start Sensor Calibration Procedure.
Definition: rscs.h:113
SC Control Point callback structure.
Definition: rscs.h:98
uint8_t inst_stride_len
Definition: rscs.h:70
uint8_t total_distance
Definition: rscs.h:73
uint8_t walking_or_running
Definition: rscs.h:76
uint8_t multi_sensor_loc
Definition: rscs.h:82
uint8_t sensor_calib_proc
Definition: rscs.h:79
Bitmask set of supported features.
Definition: rscs.h:68
struct bt_rsc_supported_loc supported_locations
Definition: rscs.h:128
const struct bt_rscs_cp_cb * cp_cb
Definition: rscs.h:137
bt_rscs_evt_handler evt_handler
Definition: rscs.h:134
enum bt_rscs_location location
Definition: rscs.h:131
struct bt_rscs_features features
Definition: rscs.h:125
Running Speed and Cadence Service initialization parameters.
Definition: rscs.h:123
bool is_total_distance
Definition: rscs.h:146
uint16_t inst_stride_length
Definition: rscs.h:158
bool is_inst_stride_len
Definition: rscs.h:143
uint8_t inst_cadence
Definition: rscs.h:155
uint32_t total_distance
Definition: rscs.h:161
bool is_running
Definition: rscs.h:149
uint16_t inst_speed
Definition: rscs.h:152
Running Speed and Cadence Service measurement structure.
Definition: rscs.h:141