Cordio Stack and Cordio Profiles  r2p3-02rel0
svc_rscs.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Example Running Speed and Cadence Service Server implementation.
6  *
7  * Copyright (c) 2016-2018 Arm Ltd. All Rights Reserved.
8  * Arm Ltd. confidential and proprietary.
9  *
10  * IMPORTANT. Your use of this file is governed by a Software License Agreement
11  * ("Agreement") that must be accepted in order to download or otherwise receive a
12  * copy of this file. You may not use or copy this file for any purpose other than
13  * as described in the Agreement. If you do not agree to all of the terms of the
14  * Agreement do not use this file and delete all copies in your possession or control;
15  * if you do not have a copy of the Agreement, you must contact Arm Ltd. prior
16  * to any use, copying or further distribution of this software.
17  */
18 /*************************************************************************************************/
19 
20 #ifndef SVC_RSCS_H
21 #define SVC_RSCS_H
22 
23 #include "att_api.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /*! \addtogroup RUNNING_SPEED_AND_CADENCE_SERVICE
30  * \{ */
31 
32 /**************************************************************************************************
33 Constants
34 **************************************************************************************************/
35 
36 /** \name RSC Feature Bits
37  * Running Speed and Cadence Feature Bits of the Feature Characteristic
38  */
39 /**@{*/
40 #define RSCS_ISLMS_FEATURE_BIT (1<<0) /*!< \brief Instantaneous Stride Length Measurement Supported Feature Mask Bit */
41 #define RSCS_TDMS_FEATURE_BIT (1<<1) /*!< \brief Total Distance Measurement Supported Feature Mask Bit */
42 #define RSCS_WRSS_FEATURE_BIT (1<<2) /*!< \brief Walking or Running Status Supported Feature Mask Bit */
43 #define RSCS_CPS_FEATURE_BIT (1<<3) /*!< \brief Calibration Procedure Supported Feature Mask Bit */
44 #define RSCS_MSLS_FEATURE_BIT (1<<4) /*!< \brief Multiple Sensor Locations Supporte Feature Mask Bit */
45 
46 /*! \brief TODO: Set to all supported features */
47 #define RSCS_ALL_FEATURES (0x7) /*!< \brief All Supported Feature Mask */
48 /**@}*/
49 
50 /**************************************************************************************************
51  Handle Ranges
52 **************************************************************************************************/
53 
54 /** \name Running Speed and Cadence Service Handles
55  *
56  */
57 /**@{*/
58 #define RSCS_START_HDL 0x04A0 /*!< \brief Start handle. */
59 #define RSCS_END_HDL (RSCS_MAX_HDL - 1) /*!< \brief End handle. */
60 
61 /**************************************************************************************************
62  Handles
63 **************************************************************************************************/
64 
65 /*! \brief Running Speed Service Handles */
66 enum
67 {
68  RSCS_SVC_HDL = RSCS_START_HDL, /*!< \brief Running Speed Server Service declaration */
69  RSCS_RSF_CH_HDL, /*!< \brief Running Speed Feature characteristic */
70  RSCS_RSF_HDL, /*!< \brief Running Speed Feature */
71  RSCS_RSM_CH_HDL, /*!< \brief Running Speed Measurement characteristic */
72  RSCS_RSM_HDL, /*!< \brief Running Speed Measurement */
73  RSCS_RSM_CH_CCC_HDL, /*!< \brief Running Speed Measurement Client Characteristic Configuration Descriptor */
74  RSCS_SL_CH_HDL, /*!< \brief Running Speed Sensor Location characteristic */
75  RSCS_SL_HDL, /*!< \brief Running Speed Sensor Location */
76  RSCS_MAX_HDL /*!< \brief Maximum handle. */
77 };
78 /**@}*/
79 
80 /**************************************************************************************************
81  Function Declarations
82 **************************************************************************************************/
83 
84 /*************************************************************************************************/
85 /*!
86  * \brief Add the services to the attribute server.
87  *
88  * \return None.
89  */
90 /*************************************************************************************************/
91 void SvcRscsAddGroup(void);
92 
93 /*************************************************************************************************/
94 /*!
95  * \brief Remove the services from the attribute server.
96  *
97  * \return None.
98  */
99 /*************************************************************************************************/
100 void SvcRscsRemoveGroup(void);
101 
102 /*************************************************************************************************/
103 /*!
104  * \brief Register callbacks for the service.
105  *
106  * \param readCback Read callback function.
107  * \param writeCback Write callback function.
108  *
109  * \return None.
110  */
111 /*************************************************************************************************/
112 void SvcRscsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback);
113 
114 /*! \} */ /* RUNNING_SPEED_AND_CADENCE_SERVICE */
115 
116 #ifdef __cplusplus
117 };
118 #endif
119 
120 #endif /* SVC_RSCS_H */
void SvcRscsCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback)
Register callbacks for the service.
#define RSCS_START_HDL
Start handle.
Definition: svc_rscs.h:58
Running Speed Feature characteristic.
Definition: svc_rscs.h:69
Running Speed Sensor Location.
Definition: svc_rscs.h:75
Running Speed Measurement characteristic.
Definition: svc_rscs.h:71
uint8_t(* attsWriteCback_t)(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, uint16_t len, uint8_t *pValue, attsAttr_t *pAttr)
Attribute group write callback.
Definition: att_api.h:237
Running Speed Measurement.
Definition: svc_rscs.h:72
void SvcRscsRemoveGroup(void)
Remove the services from the attribute server.
Running Speed Server Service declaration.
Definition: svc_rscs.h:68
Running Speed Sensor Location characteristic.
Definition: svc_rscs.h:74
Running Speed Measurement Client Characteristic Configuration Descriptor.
Definition: svc_rscs.h:73
void SvcRscsAddGroup(void)
Add the services to the attribute server.
Maximum handle.
Definition: svc_rscs.h:76
uint8_t(* attsReadCback_t)(dmConnId_t connId, uint16_t handle, uint8_t operation, uint16_t offset, attsAttr_t *pAttr)
Attribute group read callback.
Definition: att_api.h:218
Attribute protocol client and server API.
Running Speed Feature.
Definition: svc_rscs.h:70