Cordio Stack and Cordio Profiles  r2p3-02rel0
anpc_api.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Alert Notification profile client.
6  *
7  * Copyright (c) 2011-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 ANPC_API_H
20 #define ANPC_API_H
21 
22 #include "att_api.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*! \addtogroup ALERT_NOTIFICATION_PROFILE
29  * \{ */
30 
31 /**************************************************************************************************
32  Macros
33 **************************************************************************************************/
34 
35 /*! \brief Enumeration of handle indexes of characteristics to be discovered */
36 enum
37 {
38  ANPC_ANS_SNAC_HDL_IDX, /*!< \brief Supported new alert category */
39  ANPC_ANS_NA_HDL_IDX, /*!< \brief New alert */
40  ANPC_ANS_NA_CCC_HDL_IDX, /*!< \brief New alert CCC descriptor */
41  ANPC_ANS_SUAC_HDL_IDX, /*!< \brief Supported unread alert category */
42  ANPC_ANS_UAS_HDL_IDX, /*!< \brief Unread alert status */
43  ANPC_ANS_UAS_CCC_HDL_IDX, /*!< \brief Unread alert status CCC descriptor */
44  ANPC_ANS_ANCP_HDL_IDX, /*!< \brief Alert notification control point */
45  ANPC_ANS_HDL_LIST_LEN /*!< \brief Handle list length */
46 };
47 
48 /**************************************************************************************************
49  Function Declarations
50 **************************************************************************************************/
51 
52 /*************************************************************************************************/
53 /*!
54  * \brief Perform service and characteristic discovery for Alert Notification service.
55  * Parameter pHdlList must point to an array of length \ref ANPC_ANS_HDL_LIST_LEN.
56  * If discovery is successful the handles of discovered characteristics and
57  * descriptors will be set in pHdlList.
58  *
59  * \param connId Connection identifier.
60  * \param pHdlList Characteristic handle list.
61  *
62  * \return None.
63  */
64 /*************************************************************************************************/
65 void AnpcAnsDiscover(dmConnId_t connId, uint16_t *pHdlList);
66 
67 /*************************************************************************************************/
68 /*!
69  * \brief Send a command to the alert notification control point.
70  *
71  * \param connId Connection identifier.
72  * \param handle Attribute handle.
73  * \param command Control point command.
74  * \param catId Alert category ID.
75  *
76  * \return None.
77  */
78 /*************************************************************************************************/
79 void AnpcAnsControl(dmConnId_t connId, uint16_t handle, uint8_t command, uint8_t catId);
80 
81 /*************************************************************************************************/
82 /*!
83  * \brief Process a value received in an ATT read response, notification, or indication
84  * message. Parameter pHdlList must point to an array of length \ref ANPC_ANS_HDL_LIST_LEN.
85  * If the ATT handle of the message matches a handle in the handle list the value
86  * is processed, otherwise it is ignored.
87  *
88  * \param pHdlList Characteristic handle list.
89  * \param pMsg ATT callback message.
90  *
91  * \return \ref ATT_SUCCESS if handle is found, \ref ATT_ERR_NOT_FOUND otherwise.
92  */
93 /*************************************************************************************************/
95 
96 /*! \} */ /* ALERT_NOTIFICATION_PROFILE */
97 
98 #ifdef __cplusplus
99 };
100 #endif
101 
102 #endif /* ANPC_API_H */
uint8_t dmConnId_t
Connection identifier.
Definition: dm_api.h:501
ATT callback event.
Definition: att_api.h:154
Supported unread alert category.
Definition: anpc_api.h:41
Handle list length.
Definition: anpc_api.h:45
void AnpcAnsControl(dmConnId_t connId, uint16_t handle, uint8_t command, uint8_t catId)
Send a command to the alert notification control point.
Unread alert status CCC descriptor.
Definition: anpc_api.h:43
Alert notification control point.
Definition: anpc_api.h:44
Supported new alert category.
Definition: anpc_api.h:38
New alert.
Definition: anpc_api.h:39
uint8_t AnpcAnsValueUpdate(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 ANPC_ANS_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.
unsigned short uint16_t
Unsigned 16-bit value.
Definition: wsf_types.h:67
Unread alert status.
Definition: anpc_api.h:42
void AnpcAnsDiscover(dmConnId_t connId, uint16_t *pHdlList)
Perform service and characteristic discovery for Alert Notification service. Parameter pHdlList must ...
Attribute protocol client and server API.
New alert CCC descriptor.
Definition: anpc_api.h:40
unsigned char uint8_t
Unsigned 8-bit value.
Definition: wsf_types.h:63