Cordio Stack and Cordio Profiles  r2p3-02rel0
wspc_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Weight Scale profile client.
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 #ifndef WSPC_API_H
20 #define WSPC_API_H
21 
22 #include "att_api.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*! \addtogroup WEIGHT_SCALE_PROFILE
29  * \{ */
30 
31 /**************************************************************************************************
32  Macros
33 **************************************************************************************************/
34 
35 /*! \brief Weight Scale service enumeration of handle indexes of characteristics to be discovered */
36 enum
37 {
38  WSPC_WSS_WSM_HDL_IDX, /*!< \brief Weight scale measurement */
39  WSPC_WSS_WSM_CCC_HDL_IDX, /*!< \brief Weight scale measurement CCC descriptor */
40  WSPC_WSS_WSF_HDL_IDX, /*!< \brief Weight scale feature */
41  WSPC_WSS_HDL_LIST_LEN /*!< \brief Handle list length */
42 };
43 
44 /**************************************************************************************************
45  Function Declarations
46 **************************************************************************************************/
47 
48 /*************************************************************************************************/
49 /*!
50  * \brief Perform service and characteristic discovery for Weight Scale service.
51  * Parameter pHdlList must point to an array of length \ref WSPC_WSS_HDL_LIST_LEN.
52  * If discovery is successful the handles of discovered characteristics and
53  * descriptors will be set in pHdlList.
54  *
55  * \param connId Connection identifier.
56  * \param pHdlList Characteristic handle list.
57  *
58  * \return None.
59  */
60 /*************************************************************************************************/
61 void WspcWssDiscover(dmConnId_t connId, uint16_t *pHdlList);
62 
63 /*************************************************************************************************/
64 /*!
65  * \brief Process a value received in an ATT read response, notification, or indication
66  * message. Parameter pHdlList must point to an array of length \ref WSPC_WSS_HDL_LIST_LEN.
67  * If the ATT handle of the message matches a handle in the handle list the value
68  * is processed, otherwise it is ignored.
69  *
70  * \param pHdlList Characteristic handle list.
71  * \param pMsg ATT callback message.
72  *
73  * \return \ref ATT_SUCCESS if handle is found, \ref ATT_ERR_NOT_FOUND otherwise.
74  */
75 /*************************************************************************************************/
77 
78 /*! \} */ /* WEIGHT_SCALE_PROFILE */
79 
80 #ifdef __cplusplus
81 };
82 #endif
83 
84 #endif /* WSPC_API_H */
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
ATT callback event.
Definition: att_api.h:154
Weight scale measurement.
Definition: wspc_api.h:38
Weight scale feature.
Definition: wspc_api.h:40
Handle list length.
Definition: wspc_api.h:41
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
Weight scale measurement CCC descriptor.
Definition: wspc_api.h:39
uint8_t WspcWssValueUpdate(uint16_t *pHdlList, attEvt_t *pMsg)
Process a value received in an ATT read response, notification, or indication message. Parameter pHdlList must point to an array of length WSPC_WSS_HDL_LIST_LEN. If the ATT handle of the message matches a handle in the handle list the value is processed, otherwise it is ignored.
void WspcWssDiscover(dmConnId_t connId, uint16_t *pHdlList)
Perform service and characteristic discovery for Weight Scale service. Parameter pHdlList must point ...
Attribute protocol client and server API.
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63