Classes | Macros | Typedefs | Enumerations | Functions
rscs.h File Reference

Running Speed and Cadence Service API. More...

`#include "gr_includes.h"`
`#include <stdint.h>`
`#include <stdbool.h>`
Include dependency graph for rscs.h:

Go to the source code of this file.

## Classes
struct | rscs_evt_t
| Running Speed and Cadence Service event. More...
struct | rscs_meas_val_t
| Running Speed and Cadence Measurement Character value structure. More...
struct | rscs_init_t
| Running Speed and Cadence Service init stucture. More...

## Macros
#define | RSCS_CONNECTION_MAX 10
| Maximum number of Running Speed and Cadence Service connections. More...
#define | RSCS_MEAS_VAL_LEN_MAX 20
| Maximum length of RSC measurement value. More...
#define | RSCS_FEAT_VAL_LEN_MAX 2
| Maximum length of RSC Feature value. More...
#define | RSCS_SENSOR_LOC_VAL_LEN_MAX 1
| Maximum length of RSC Sensor Location value. More...
#define | RSCS_CTRL_PT_RSP_LEN_MIN 3
| Mimimum length of SC Control Point responce value. More...
#define | RSCS_CTRL_PT_VAL_LEN_MAX (RSCS_CTRL_PT_RSP_LEN_MIN + RSCS_SENSOR_LOC_SUP_NB)
| Maximum length of SC Control Point value. More...
#define | RSCS_ERROR_PROC_IN_PROGRESS 0x80
| Error code: A previously triggered SC Control Point operation is still in progress. More...
#define | RSCS_ERROR_CCCD_INVALID 0x81
| Error code: The Client Characteristic Configuration descriptor is not configured. More...
#define | RSCS_CHAR_MANDATORY 0x003f
| Bit mask for mandatory characteristic in RSCS. More...
#define | RSCS_CHAR_SENSOR_LOC_SUP 0x00c0
| Bit mask for Sensor Location characteristic that is optional. More...
#define | RSCS_CHAR_SC_CTRL_POINT 0x0700
| Bit mask for SC Control Point characteristic that is optional. More...
#define | RSCS_CHAR_FULL 0x07ff
| Bit mask of the full characteristic. More...
#define | RSCS_MEAS_FLAG_INST_STRIDE_LEN_BIT (0x01 << 0)
| Flag bit for Instantaneous Stride Length Measurement. More...
#define | RSCS_MEAS_FLAG_TOTAL_DISTANCE_BIT (0x01 << 1)
| Flag bit for Total Distance Measurement. More...
#define | RSCS_MEAS_FLAG_RUNNING_OR_WALKING_BIT (0x01 << 2)
| Flag bit for Running or Walking. More...
#define | RSCS_FEAT_INSTANT_STRIDE_LEN_BIT (0x01 << 0)
| Bit for Instantaneous Stride Length Measurement Supported. More...
#define | RSCS_FEAT_TOTAL_DISTANCE_BIT (0x01 << 1)
| Bit for Total Distance Measurement Supported. More...
#define | RSCS_FEAT_RUNNING_OR_WALKING_STATUS_BIT (0x01 << 2)
| Bit for Running or Walking Status Supported. More...
#define | RSCS_FEAT_CALIBRATION_PROCEDURE_BIT (0x01 << 3)
| Bit for Calibration Procedure Supported. More...
#define | RSCS_FEAT_MULTIPLE_SENSORS_BIT (0x01 << 4)
| Bit for Multiple Sensor Locations Supported. More...
#define | RSCS_FEAR_FULL_BIT (0x1f)
| Bit for all RSC features Supported. More...

## Typedefs
typedef void(* | rscs_evt_handler_t) (rscs_evt_t *p_evt)
| Running Speed and Cadence Service event handler type. More...

## Enumerations
enum | rscs_sensor_loc_t { RSCS_SENSOR_LOC_OTHER, RSCS_SENSOR_LOC_SHOE_TOP, RSCS_SENSOR_LOC_SHOE_IN, RSCS_SENSOR_LOC_HIP, RSCS_SENSOR_LOC_FRONT_WHEEL, RSCS_SENSOR_LOC_LEFT_PEDAL, RSCS_SENSOR_LOC_RIGHT_PEDAL, RSCS_SENSOR_LOC_FRONT_HUB, RSCS_SENSOR_LOC_SUP_NB }
| Running Speed and Cadence Service Sensor Location. More...
enum | rscs_ctrl_pt_op_code_t { RSCS_CTRL_PT_OP_RESERVED, RSCS_CTRL_PT_OP_SET_CUMUL_VAL, RSCS_CTRL_PT_OP_START_CALIB, RSCS_CTRL_PT_OP_UPD_LOC, RSCS_CTRL_PT_OP_REQ_SUP_LOC, RSCS_CTRL_PT_OP_RSP_CODE = 0x10 }
| Running Speed and Cadence Service Control Point Operation Code. More...
enum | rscs_ctrl_pt_rsp_t { RSCS_CTRL_PT_RSP_RESERVED, RSCS_CTRL_PT_RSP_SUCCESS, RSCS_CTRL_PT_RSP_NOT_SUP, RSCS_CTRL_PT_RSP_INVALID_PARAM, RSCS_CTRL_PT_RSP_FAILED }
| Running Speed and Cadence Service Control Point Response value. More...
enum | rscs_evt_type_t { RSCS_EVT_INVALID, RSCS_EVT_RSC_MEAS_NOTIFICATION_ENABLE, RSCS_EVT_RSC_MEAS_NOTIFICATION_DISABLE, RSCS_EVT_CTRL_POINT_INDICATION_ENABLE, RSCS_EVT_CTRL_POINT_INDICATION_DISABLE, RSCS_EVT_RSC_MEAS_SEND_CPLT, RSCS_EVT_CUMUL_VAL_SET, RSCS_EVT_SEBSOR_CALIBRATION, RSCS_EVT_SEBSOR_LOC_UPD, RSCS_EVT_SUP_SEBSOR_LOC_REQ, RSCS_EVT_CTRL_POINT_RSP_CPLT }
| Running Speed and Cadence Service event type. More...

## Functions
sdk_err_t | rscs_service_init (rscs_init_t *p_rscs_init)
| Initialize a Running Speed and Cadence Service instance and add in the DB. More...
sdk_err_t | rscs_measurement_send (uint8_t conn_idx, rscs_meas_val_t *p_meas)
| Send RSC measurement if notification has been enabled. More...
sdk_err_t | rscs_ctrl_pt_rsp_send (uint8_t conn_idx, uint8_t *p_data, uint16_t length)
| Send SC Control Point responce if indication has been enabled. More...
sdk_err_t | rscs_sensor_loc_update (rscs_sensor_loc_t sensor_loc)
| Update Sensor Location if Multiple Sensor Locations Supported rscs_init_t::feature. More...

## Detailed Description

Running Speed and Cadence Service API.

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file rscs.h.