1- /* Copyright (c) 2009-2019 Arm Limited
2- * SPDX-License-Identifier: Apache-2.0
1+ /*************************************************************************************************/
2+ /*!
3+ * \file
34 *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
5+ * \brief Attribute protocol client and server API.
76 *
8- * http://www.apache.org/licenses/LICENSE-2.0
7+ * Copyright (c) 2009-2019 Arm Ltd. All Rights Reserved.
98 *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-
17- /*************************************************************************************************/
18- /*!
19- * \brief Attribute protocol client and server API.
9+ * Copyright (c) 2019-2020 Packetcraft, Inc.
10+ *
11+ * Licensed under the Apache License, Version 2.0 (the "License");
12+ * you may not use this file except in compliance with the License.
13+ * You may obtain a copy of the License at
14+ *
15+ * http://www.apache.org/licenses/LICENSE-2.0
16+ *
17+ * Unless required by applicable law or agreed to in writing, software
18+ * distributed under the License is distributed on an "AS IS" BASIS,
19+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+ * See the License for the specific language governing permissions and
21+ * limitations under the License.
2022 */
2123/*************************************************************************************************/
2224#ifndef ATT_API_H
@@ -107,16 +109,21 @@ enum /*!< \brief Internal note: event val
107109 ATTC_EXECUTE_WRITE_RSP , /*!< \brief Execute write response */
108110 ATTC_HANDLE_VALUE_NTF , /*!< \brief Handle value notification */
109111 ATTC_HANDLE_VALUE_IND , /*!< \brief Handle value indication */
112+ ATTC_READ_MULT_VAR_RSP = 16 , /*!< \brief Read multiple variable length response */
113+ ATTC_MULT_VALUE_NTF , /*!< \brief Read multiple value notification */
110114 /* ATT server callback events */
111115 ATTS_HANDLE_VALUE_CNF , /*!< \brief Handle value confirmation */
116+ ATTS_MULT_VALUE_CNF , /*!< \brief Handle multiple value confirmation */
112117 ATTS_CCC_STATE_IND , /*!< \brief Client chracteristic configuration state change */
113118 ATTS_DB_HASH_CALC_CMPL_IND , /*!< \brief Database hash calculation complete */
114119 /* ATT common callback events */
115- ATT_MTU_UPDATE_IND /*!< \brief Negotiated MTU value */
120+ ATT_MTU_UPDATE_IND , /*!< \brief Negotiated MTU value */
121+ ATT_EATT_CONN_CMPL_IND , /*!< \brief EATT Connect channels complete */
122+ ATT_EATT_RECONFIG_CMPL_IND /*!< \brief EATT Reconfigure complete */
116123};
117124
118125/*! \brief ATT callback events */
119- #define ATT_CBACK_END ATT_MTU_UPDATE_IND /*!< \brief ATT callback event ending value */
126+ #define ATT_CBACK_END ATT_EATT_RECONFIG_CMPL_IND /*!< \brief ATT callback event ending value */
120127/**@}*/
121128
122129/** \name ATT Client Awareness of Database Change
@@ -146,6 +153,18 @@ typedef struct
146153 uint8_t numPrepWrites ; /*!< \brief number of queued prepare writes supported by server */
147154} attCfg_t ;
148155
156+ /*! \brief EATT run-time configurable parameters */
157+ typedef struct
158+ {
159+ uint16_t mtu ; /*!< \brief MTU */
160+ uint16_t mps ; /*!< \brief MPS */
161+ bool_t initiateEatt ; /*!< \brief Open EATT channels automatically on connect */
162+ uint8_t authoriz ; /*!< \brief Authorization required */
163+ uint8_t secLevel ; /*!< \brief Security level required */
164+ uint8_t numChans ; /*!< \brief Number of enhanced l2cap channels per connection */
165+ uint8_t * pPriorityTbl ; /*!< \brief Min priority required for each channel */
166+ } eattCfg_t ;
167+
149168/*!
150169 * \brief ATT callback event
151170 *
@@ -386,6 +405,9 @@ typedef void (*attsCccCback_t)(attsCccEvt_t *pEvt);
386405/**@{*/
387406/*! \brief Configuration pointer */
388407extern attCfg_t * pAttCfg ;
408+
409+ /*! \brief Enhanced configuration pointer */
410+ extern eattCfg_t * pEattCfg ;
389411/**@}*/
390412/*! \} */ /* STACK_INIT */
391413
@@ -865,10 +887,10 @@ void AttsCsfGetFeatures(dmConnId_t connId, uint8_t *pCsfOut, uint8_t pCsfOutLen)
865887 *
866888 * \param connId DM connection ID.
867889 *
868- * \return Client's change-aware state.
890+ * \return Client's change-aware state. See ::attClientAwareStates.
869891 */
870892/*************************************************************************************************/
871- uint8_t AttsCsfGetChangeAwareState (dmConnId_t connId );
893+ uint8_t AttsCsfGetClientChangeAwareState (dmConnId_t connId );
872894
873895/*************************************************************************************************/
874896/*!
@@ -884,7 +906,7 @@ uint8_t AttsCsfGetChangeAwareState(dmConnId_t connId);
884906 * application) will have updated all persistent records prior to calling this function.
885907 */
886908/*************************************************************************************************/
887- void AttsCsfSetClientsChangeAwarenessState (dmConnId_t connId , uint8_t state );
909+ void AttsCsfSetClientChangeAwareState (dmConnId_t connId , uint8_t state );
888910
889911/*************************************************************************************************/
890912/*!
@@ -1273,6 +1295,36 @@ void AttcDiscCharStart(dmConnId_t connId, attcDiscCb_t *pCb);
12731295/*************************************************************************************************/
12741296uint8_t AttcDiscCharCmpl (attcDiscCb_t * pCb , attEvt_t * pMsg );
12751297
1298+ /*************************************************************************************************/
1299+ /*!
1300+ * \brief This utility function starts service include discovery for a service on a peer device.
1301+ * The service must have been previously discovered by calling AttcDiscService() and
1302+ * AttcDiscServiceCmpl().
1303+ *
1304+ * \param connId DM connection ID.
1305+ * \param pCb Pointer to service discovery control block.
1306+ *
1307+ * \return None.
1308+ */
1309+ /*************************************************************************************************/
1310+ void AttcDiscIncSvcStart (dmConnId_t connId , attcDiscCb_t * pCb );
1311+
1312+ /*************************************************************************************************/
1313+ /*!
1314+ * \brief This utility function processes a service include discovery result. It should be
1315+ * called when an ATTC_READ_BY_TYPE_RSP allback event is received after service include
1316+ * discovery is initiated by calling AttcDiscIncSvcStart().
1317+ *
1318+ * \param pCb Pointer to service discovery control block.
1319+ * \param pMsg ATT callback event message.
1320+ *
1321+ * \return ATT_CONTINUING if successful and discovery procedure is continuing.
1322+ * ATT_SUCCESS if discovery procedure completed successfully.
1323+ * Otherwise the discovery procedure failed.
1324+ */
1325+ /*************************************************************************************************/
1326+ uint8_t AttcDiscIncSvcCmpl (attcDiscCb_t * pCb , attEvt_t * pMsg );
1327+
12761328/*************************************************************************************************/
12771329/*!
12781330 * \brief This utility function starts characteristic configuration for characteristics on a
@@ -1321,12 +1373,17 @@ uint8_t AttcDiscConfigResume(dmConnId_t connId, attcDiscCb_t *pCb);
13211373
13221374/*************************************************************************************************/
13231375/*!
1324- * \brief For internal use only .
1376+ * \brief Initiate an attribute protocol Exchange MTU Request .
13251377 *
13261378 * \param connId DM connection ID.
13271379 * \param mtu Attribute protocol MTU.
13281380 *
13291381 * \return None.
1382+ *
1383+ * \note The Exchange MTU Request will be initiated automatically on a master connection.
1384+ *
1385+ * \note This API can be used by the application to initiate an Exchange MTU Request on slave
1386+ * connections.
13301387 */
13311388/*************************************************************************************************/
13321389void AttcMtuReq (dmConnId_t connId , uint16_t mtu );
0 commit comments