1
- /* Copyright (c) 2009-2019 Arm Limited
2
- * SPDX-License-Identifier: Apache-2.0
1
+ /*************************************************************************************************/
2
+ /*!
3
+ * \file
3
4
*
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.
7
6
*
8
- * http://www.apache.org/licenses/LICENSE-2.0
7
+ * Copyright (c) 2009-2019 Arm Ltd. All Rights Reserved.
9
8
*
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.
20
22
*/
21
23
/*************************************************************************************************/
22
24
#ifndef ATT_API_H
@@ -107,16 +109,21 @@ enum /*!< \brief Internal note: event val
107
109
ATTC_EXECUTE_WRITE_RSP , /*!< \brief Execute write response */
108
110
ATTC_HANDLE_VALUE_NTF , /*!< \brief Handle value notification */
109
111
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 */
110
114
/* ATT server callback events */
111
115
ATTS_HANDLE_VALUE_CNF , /*!< \brief Handle value confirmation */
116
+ ATTS_MULT_VALUE_CNF , /*!< \brief Handle multiple value confirmation */
112
117
ATTS_CCC_STATE_IND , /*!< \brief Client chracteristic configuration state change */
113
118
ATTS_DB_HASH_CALC_CMPL_IND , /*!< \brief Database hash calculation complete */
114
119
/* 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 */
116
123
};
117
124
118
125
/*! \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 */
120
127
/**@}*/
121
128
122
129
/** \name ATT Client Awareness of Database Change
@@ -146,6 +153,18 @@ typedef struct
146
153
uint8_t numPrepWrites ; /*!< \brief number of queued prepare writes supported by server */
147
154
} attCfg_t ;
148
155
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
+
149
168
/*!
150
169
* \brief ATT callback event
151
170
*
@@ -386,6 +405,9 @@ typedef void (*attsCccCback_t)(attsCccEvt_t *pEvt);
386
405
/**@{*/
387
406
/*! \brief Configuration pointer */
388
407
extern attCfg_t * pAttCfg ;
408
+
409
+ /*! \brief Enhanced configuration pointer */
410
+ extern eattCfg_t * pEattCfg ;
389
411
/**@}*/
390
412
/*! \} */ /* STACK_INIT */
391
413
@@ -865,10 +887,10 @@ void AttsCsfGetFeatures(dmConnId_t connId, uint8_t *pCsfOut, uint8_t pCsfOutLen)
865
887
*
866
888
* \param connId DM connection ID.
867
889
*
868
- * \return Client's change-aware state.
890
+ * \return Client's change-aware state. See ::attClientAwareStates.
869
891
*/
870
892
/*************************************************************************************************/
871
- uint8_t AttsCsfGetChangeAwareState (dmConnId_t connId );
893
+ uint8_t AttsCsfGetClientChangeAwareState (dmConnId_t connId );
872
894
873
895
/*************************************************************************************************/
874
896
/*!
@@ -884,7 +906,7 @@ uint8_t AttsCsfGetChangeAwareState(dmConnId_t connId);
884
906
* application) will have updated all persistent records prior to calling this function.
885
907
*/
886
908
/*************************************************************************************************/
887
- void AttsCsfSetClientsChangeAwarenessState (dmConnId_t connId , uint8_t state );
909
+ void AttsCsfSetClientChangeAwareState (dmConnId_t connId , uint8_t state );
888
910
889
911
/*************************************************************************************************/
890
912
/*!
@@ -1273,6 +1295,36 @@ void AttcDiscCharStart(dmConnId_t connId, attcDiscCb_t *pCb);
1273
1295
/*************************************************************************************************/
1274
1296
uint8_t AttcDiscCharCmpl (attcDiscCb_t * pCb , attEvt_t * pMsg );
1275
1297
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
+
1276
1328
/*************************************************************************************************/
1277
1329
/*!
1278
1330
* \brief This utility function starts characteristic configuration for characteristics on a
@@ -1321,12 +1373,17 @@ uint8_t AttcDiscConfigResume(dmConnId_t connId, attcDiscCb_t *pCb);
1321
1373
1322
1374
/*************************************************************************************************/
1323
1375
/*!
1324
- * \brief For internal use only .
1376
+ * \brief Initiate an attribute protocol Exchange MTU Request .
1325
1377
*
1326
1378
* \param connId DM connection ID.
1327
1379
* \param mtu Attribute protocol MTU.
1328
1380
*
1329
1381
* \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.
1330
1387
*/
1331
1388
/*************************************************************************************************/
1332
1389
void AttcMtuReq (dmConnId_t connId , uint16_t mtu );
0 commit comments