Skip to content

Commit be7571e

Browse files
authored
Merge pull request #13217 from ARMmbed/feature-cordio-update-20-05
Feature cordio update 20 05
2 parents 57a0cfe + bd9e819 commit be7571e

File tree

587 files changed

+60020
-16713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

587 files changed

+60020
-16713
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/mbed_lib.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cordio",
3-
"macros": [ "WSF_MS_PER_TICK=1" ],
3+
"macros": ["WSF_MS_PER_TICK=1"],
44
"config": {
55
"max-connections": {
66
"help": "Maximum number of connections",
@@ -71,6 +71,11 @@
7171
"preferred-tx-power": {
7272
"help": "Preferred value of tx power in dbm (-128,127). This value is not guaranteed and relies on existing support in the HCI driver.",
7373
"value": 0
74+
},
75+
"max-eatt-channels": {
76+
"help": "Maximum number of EATT channels per DM connection.",
77+
"value": 1,
78+
"macro_name": "EATT_CONN_CHAN_MAX"
7479
}
7580
}
76-
}
81+
}

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_api.h

Lines changed: 79 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
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 */
388407
extern 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
/*************************************************************************************************/
12741296
uint8_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
/*************************************************************************************************/
13321389
void AttcMtuReq(dmConnId_t connId, uint16_t mtu);

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_defs.h

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
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 constants and definitions from the Bluetooth specification.
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 constants and definitions from the Bluetooth specification.
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_DEFS_H
@@ -101,15 +103,20 @@ extern "C" {
101103
#define ATT_ERR_UNDEFINED 0x75 /*!< \brief Other undefined error */
102104
#define ATT_ERR_REQ_NOT_FOUND 0x76 /*!< \brief Required characteristic not found */
103105
#define ATT_ERR_MTU_EXCEEDED 0x77 /*!< \brief Attribute PDU length exceeded MTU size */
104-
#define ATT_CONTINUING 0x78 /*!< \brief Procedure continuing */
105-
#define ATT_RSP_PENDING 0x79 /*!< \brief Responsed delayed pending higher layer */
106+
#define ATT_ERR_NO_CHANNEL 0x78 /*!< \brief No enhanced channel available */
107+
#define ATT_CONTINUING 0x79 /*!< \brief Procedure continuing */
108+
#define ATT_RSP_PENDING 0x7A /*!< \brief Response delayed pending higher layer */
106109
/**@}*/
107110

108111
/** \name ATT Application Error Codes
109112
* These codes may be sent to application but are not present in any ATT PDU.
110113
*/
111114
/**@{*/
112115
#define ATT_ERR_VALUE_RANGE 0x80 /*!< \brief Value out of range */
116+
#define ATT_ERR_INVALID_CHANGE_CTR 0x80 /*!< \brief Invalid change counter */
117+
#define ATT_ERR_OPCODE_NOT_SUPPORTED 0x81 /*!< \brief Opcode out of range */
118+
#define ATT_ERR_MUTE_DISABLE 0x82 /*!< \brief Mute disable */
119+
#define ATT_ERR_VALUE_RANGE_x83 0x83 /*!< \brief Value out of range 0x83 */
113120
/**@}*/
114121

115122
/** \name ATT HCI Error Status
@@ -156,7 +163,9 @@ extern "C" {
156163
#define ATT_PDU_VALUE_NTF 0x1B /*!< \brief Handle value notification */
157164
#define ATT_PDU_VALUE_IND 0x1D /*!< \brief Handle value indication */
158165
#define ATT_PDU_VALUE_CNF 0x1E /*!< \brief Handle value confirmation */
159-
#define ATT_PDU_MAX 0x1F /*!< \brief PDU Maximum */
166+
#define ATT_PDU_READ_MULT_VAR_REQ 0x20 /*!< \brief Read multiple variable length request */
167+
#define ATT_PDU_READ_MULT_VAR_RSP 0x21 /*!< \brief Read multiple variable length response */
168+
#define ATT_PDU_MULT_VALUE_NTF 0x23 /*!< \brief Handle value multiple notification */
160169
/**@}*/
161170

162171
/** \name ATT PDU Length Fields
@@ -191,6 +200,9 @@ extern "C" {
191200
#define ATT_VALUE_NTF_LEN 3 /*!< \brief Value notification length. */
192201
#define ATT_VALUE_IND_LEN 3 /*!< \brief Value indication length. */
193202
#define ATT_VALUE_CNF_LEN 1 /*!< \brief Value confirmation length. */
203+
#define ATT_READ_MULT_VAR_REQ_LEN 1 /*!< \brief Base read multiple variable request length. */
204+
#define ATT_READ_MULT_VAR_RSP_LEN 1 /*!< \brief Base read multiple variable response length. */
205+
#define ATT_PDU_MULT_VALUE_NTF_LEN 1 /*!< \brief Base multiple variable notification length. */
194206
/**@}*/
195207

196208
/** \name ATT Find Information Response Format
@@ -317,12 +329,22 @@ extern "C" {
317329
* Flags of features supported by the GATT Client
318330
*/
319331
/**@{*/
320-
#define ATTS_CSF_ROBUST_CACHING 1 /*!< \brief Robust caching. */
321-
#define ATTS_CSF_OCT0_FEATURES ATTS_CSF_ROBUST_CACHING /*!< \brief Mask of all client supported features. */
332+
#define ATTS_CSF_ROBUST_CACHING (1<<0) /*!< \brief Robust caching. */
333+
#define ATTS_CSF_EATT_BEARER (1<<1) /*!< \brief Enhanced ATT Bearer. */
334+
#define ATTS_CSF_MULTI_VAL_NTF (1<<2) /*!< \brief Multiple Handle Value Notifications. */
335+
336+
#define ATTS_CSF_ALL_FEATURES (0x7) /*!< \brief Mask of all client supported features. */
322337

323338
#define ATT_CSF_LEN 1 /*!< \brief Length of client supported features array. */
324339
/**@}*/
325340

341+
/** \name GATT Server Supported Features
342+
* Flags of features supported by the GATT Server
343+
*/
344+
/**@{*/
345+
#define ATTS_SSF_EATT (1<<0) /*!< \brief Enhanced ATT supported. */
346+
/**@}*/
347+
326348
/*! \} */ /* STACK_ATT_API */
327349

328350
#ifdef __cplusplus

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host/include/att_handler.h

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
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 Interface to ATT event handler.
76
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
7+
* Copyright (c) 2009-2018 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 Interface to ATT event handler.
9+
* Copyright (c) 2019 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_HANDLER_H

0 commit comments

Comments
 (0)