Cordio Stack and Cordio Profiles  r2p3-02rel0
svc_wss.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Example Weight Scale service implementation.
6  *
7  * Copyright (c) 2012-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_WSS_H
21 #define SVC_WSS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /*! \addtogroup WEIGHT_SCALE_SERVICE
28  * \{ */
29 
30 /**************************************************************************************************
31  Handle Ranges
32 **************************************************************************************************/
33 
34 /** \name Weight Scale Service Handles
35  *
36  */
37 /**@{*/
38 #define WSS_START_HDL 0x0100 /*!< \brief Start handle. */
39 #define WSS_END_HDL (WSS_MAX_HDL - 1) /*!< \brief End handle. */
40 
41 /**************************************************************************************************
42  Handles
43 **************************************************************************************************/
44 
45 /*! \brief Weight Scale Service Handles */
46 enum
47 {
48  WSS_SVC_HDL = WSS_START_HDL, /*!< \brief Weight scale service declaration */
49  WSS_WM_CH_HDL, /*!< \brief Weight measurement characteristic */
50  WSS_WM_HDL, /*!< \brief Weight measurement */
51  WSS_WM_CH_CCC_HDL, /*!< \brief Weight measurement client characteristic configuration */
52  WSS_WSF_CH_HDL, /*!< \brief Weight scale feature characteristic */
53  WSS_WSF_HDL, /*!< \brief Weight scale feature */
54  WSS_MAX_HDL /*!< \brief Maximum handle. */
55 };
56 /**@}*/
57 
58 /**************************************************************************************************
59  Function Declarations
60 **************************************************************************************************/
61 
62 /*************************************************************************************************/
63 /*!
64  * \brief Add the services to the attribute server.
65  *
66  * \return None.
67  */
68 /*************************************************************************************************/
69 void SvcWssAddGroup(void);
70 
71 /*************************************************************************************************/
72 /*!
73  * \brief Remove the services from the attribute server.
74  *
75  * \return None.
76  */
77 /*************************************************************************************************/
78 void SvcWssRemoveGroup(void);
79 
80 /*************************************************************************************************/
81 /*!
82  * \brief Register callbacks for the service.
83  *
84  * \param readCback Read callback function.
85  * \param writeCback Write callback function.
86  *
87  * \return None.
88  */
89 /*************************************************************************************************/
90 void SvcWssCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback);
91 
92 /*! \} */ /* WEIGHT_SCALE_SERVICE */
93 
94 #ifdef __cplusplus
95 };
96 #endif
97 
98 #endif /* SVC_WSS_H */
Weight measurement client characteristic configuration.
Definition: svc_wss.h:51
Weight measurement characteristic.
Definition: svc_wss.h:49
void SvcWssAddGroup(void)
Add the services to the attribute server.
Weight scale service declaration.
Definition: svc_wss.h:48
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
Weight scale feature characteristic.
Definition: svc_wss.h:52
Weight measurement.
Definition: svc_wss.h:50
Maximum handle.
Definition: svc_wss.h:54
void SvcWssRemoveGroup(void)
Remove the services from the attribute server.
#define WSS_START_HDL
Start handle.
Definition: svc_wss.h:38
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
Weight scale feature.
Definition: svc_wss.h:53
void SvcWssCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback)
Register callbacks for the service.