Cordio Stack and Cordio Profiles  r2p3-02rel0
svc_px.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Example Proximity services implementation.
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 
20 #ifndef SVC_PX_H
21 #define SVC_PX_H
22 
23 #include "att_api.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /*! \addtogroup PROXIMITY_SERVICE
30  * \{ */
31 
32 /**************************************************************************************************
33  Handle Ranges
34 **************************************************************************************************/
35 
36 /** \name Proximity Service Handles
37  *
38  */
39 /**@{*/
40 #define PX_START_HDL 0x50 /*!< \brief Start handle. */
41 #define PX_END_HDL (PX_MAX_HDL - 1) /*!< \brief End handle. */
42 
43 /**************************************************************************************************
44  Handles
45 **************************************************************************************************/
46 
47 /*! \brief Service Handles */
48 enum
49 {
50  LLS_SVC_HDL = PX_START_HDL, /*!< \brief Link loss service declaration */
51  LLS_AL_CH_HDL, /*!< \brief Alert level characteristic */
52  LLS_AL_HDL, /*!< \brief Alert level */
53  IAS_SVC_HDL, /*!< \brief Immediate alert service declaration */
54  IAS_AL_CH_HDL, /*!< \brief Alert level characteristic */
55  IAS_AL_HDL, /*!< \brief Alert level */
56  TXS_SVC_HDL, /*!< \brief TX power service declaration */
57  TXS_TX_CH_HDL, /*!< \brief TX power level characteristic */
58  TXS_TX_HDL, /*!< \brief TX power level */
59  PX_MAX_HDL /*!< \brief Maximum handle. */
60 };
61 /**@}*/
62 
63 /**************************************************************************************************
64  Function Declarations
65 **************************************************************************************************/
66 
67 /*************************************************************************************************/
68 /*!
69  * \brief Add the services to the attribute server.
70  *
71  * \return None.
72  */
73 /*************************************************************************************************/
74 void SvcPxAddGroup(void);
75 
76 /*************************************************************************************************/
77 /*!
78  * \brief Remove the services from the attribute server.
79  *
80  * \return None.
81  */
82 /*************************************************************************************************/
83 void SvcPxRemoveGroup(void);
84 
85 /*************************************************************************************************/
86 /*!
87  * \brief Register callbacks for the service.
88  *
89  * \param readCback Read callback function.
90  * \param writeCback Write callback function.
91  *
92  * \return None.
93  */
94 /*************************************************************************************************/
95 void SvcPxCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback);
96 
97 /*! \} */ /* PROXIMITY_SERVICE */
98 
99 #ifdef __cplusplus
100 };
101 #endif
102 
103 #endif /* SVC_PX_H */
104 
Maximum handle.
Definition: svc_px.h:59
Alert level characteristic.
Definition: svc_px.h:51
Immediate alert service declaration.
Definition: svc_px.h:53
void SvcPxCbackRegister(attsReadCback_t readCback, attsWriteCback_t writeCback)
Register callbacks for the service.
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
#define PX_START_HDL
Start handle.
Definition: svc_px.h:40
void SvcPxAddGroup(void)
Add the services to the attribute server.
Link loss service declaration.
Definition: svc_px.h:50
Alert level.
Definition: svc_px.h:52
Alert level.
Definition: svc_px.h:55
TX power service declaration.
Definition: svc_px.h:56
TX power level.
Definition: svc_px.h:58
Alert level characteristic.
Definition: svc_px.h:54
TX power level characteristic.
Definition: svc_px.h:57
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.
void SvcPxRemoveGroup(void)
Remove the services from the attribute server.