File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
features/FEATURE_BLE/targets/TARGET_CORDIO/stack/ble-host Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 11/* Copyright (c) 2009-2019 Arm Limited
2+ * Copyright (c) 2019-2020 Packetcraft, Inc.
23 * SPDX-License-Identifier: Apache-2.0
34 *
45 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -252,6 +253,17 @@ void SmpDmMsgSend(smpDmMsg_t *pMsg);
252253/*************************************************************************************************/
253254void SmpDmEncryptInd (wsfMsgHdr_t * pMsg );
254255
256+ /*************************************************************************************************/
257+ /*!
258+ * \brief Check if LE Secure Connections is enabled on the connection.
259+ *
260+ * \param connId Connection identifier.
261+ *
262+ * \return TRUE is Secure Connections is enabled, else FALSE
263+ */
264+ /*************************************************************************************************/
265+ bool_t SmpDmLescEnabled (dmConnId_t connId );
266+
255267/*************************************************************************************************/
256268/*!
257269 * \brief Return the STK for the given connection.
Original file line number Diff line number Diff line change 11/* Copyright (c) 2009-2019 Arm Limited
2+ * Copyright (c) 2019-2020 Packetcraft, Inc.
23 * SPDX-License-Identifier: Apache-2.0
34 *
45 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -117,6 +118,12 @@ void dmSecHciHandler(hciEvt_t *pEvent)
117118 return ;
118119 }
119120 }
121+ else if (SmpDmLescEnabled (pCcb -> connId ) == TRUE)
122+ {
123+ /* EDIV and Rand must be zero in LE Secure Connections */
124+ HciLeLtkReqNegReplCmd (pEvent -> hdr .param );
125+ return ;
126+ }
120127
121128 /* call callback to get key from app */
122129
Original file line number Diff line number Diff line change @@ -695,6 +695,27 @@ uint8_t smpGetScSecLevel(smpCcb_t *pCcb)
695695 return secLevel ;
696696}
697697
698+ /*************************************************************************************************/
699+ /*!
700+ * \brief Check if LE Secure Connections is enabled on the connection.
701+ *
702+ * \param connId Connection identifier.
703+ *
704+ * \return TRUE is Secure Connections is enabled, else FALSE
705+ */
706+ /*************************************************************************************************/
707+ bool_t SmpDmLescEnabled (dmConnId_t connId )
708+ {
709+ smpCcb_t * pCcb = smpCcbByConnId (connId );
710+
711+ if (pCcb == NULL || pCcb -> pScCcb == NULL )
712+ {
713+ return FALSE;
714+ }
715+
716+ return pCcb -> pScCcb -> lescEnabled ;
717+ }
718+
698719/*************************************************************************************************/
699720/*!
700721 * \brief Return the STK for the given connection.
You can’t perform that action at this time.
0 commit comments