Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
9db5524b
Commit
9db5524b
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
change(ble): Fail new pairings if there is no slot available
parent
6b91b1a7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/ble/bondings.c
+2
-13
2 additions, 13 deletions
epicardium/ble/bondings.c
lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave.c
+7
-0
7 additions, 0 deletions
...ries/BTLE/stack/ble-profiles/sources/apps/app/app_slave.c
with
9 additions
and
13 deletions
epicardium/ble/bondings.c
+
2
−
13
View file @
9db5524b
...
@@ -114,9 +114,6 @@ typedef struct
...
@@ -114,9 +114,6 @@ typedef struct
/*! Database */
/*! Database */
static
appDbRec_t
records
[
APP_DB_NUM_RECS
];
static
appDbRec_t
records
[
APP_DB_NUM_RECS
];
/*! When all records are allocated use this index to determine which to overwrite */
static
appDbRec_t
*
pAppDbNewRec
=
records
;
/* clang-format on */
/* clang-format on */
/* Translate a pointer to a record into the filename to be used for it. */
/* Translate a pointer to a record into the filename to be used for it. */
static
int
record_to_filename
(
appDbRec_t
*
record
,
char
*
buf
,
size_t
buf_size
)
static
int
record_to_filename
(
appDbRec_t
*
record
,
char
*
buf
,
size_t
buf_size
)
...
@@ -317,7 +314,7 @@ void AppDbInit(void)
...
@@ -317,7 +314,7 @@ void AppDbInit(void)
* \param addrType Address type.
* \param addrType Address type.
* \param pAddr Peer device address.
* \param pAddr Peer device address.
*
*
* \return Database record handle.
* \return Database record handle.
APP_DB_HDL_NONE if none is available.
*/
*/
/*************************************************************************************************/
/*************************************************************************************************/
appDbHdl_t
AppDbNewRecord
(
uint8_t
addrType
,
uint8_t
*
pAddr
)
appDbHdl_t
AppDbNewRecord
(
uint8_t
addrType
,
uint8_t
*
pAddr
)
...
@@ -337,15 +334,7 @@ appDbHdl_t AppDbNewRecord(uint8_t addrType, uint8_t *pAddr)
...
@@ -337,15 +334,7 @@ appDbHdl_t AppDbNewRecord(uint8_t addrType, uint8_t *pAddr)
/* if all records were allocated */
/* if all records were allocated */
if
(
i
==
0
)
if
(
i
==
0
)
{
{
/* overwrite a record */
return
APP_DB_HDL_NONE
;
pRec
=
pAppDbNewRec
;
/* get next record to overwrite */
pAppDbNewRec
++
;
if
(
pAppDbNewRec
==
&
records
[
APP_DB_NUM_RECS
])
{
pAppDbNewRec
=
records
;
}
}
}
/* initialize record */
/* initialize record */
...
...
This diff is collapsed.
Click to expand it.
lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_slave.c
+
7
−
0
View file @
9db5524b
...
@@ -706,6 +706,13 @@ static void appSecPairInd(dmEvt_t *pMsg, appConnCb_t *pCb)
...
@@ -706,6 +706,13 @@ static void appSecPairInd(dmEvt_t *pMsg, appConnCb_t *pCb)
{
{
/* create a device record if none exists */
/* create a device record if none exists */
pCb
->
dbHdl
=
AppDbNewRecord
(
DmConnPeerAddrType
(
pCb
->
connId
),
DmConnPeerAddr
(
pCb
->
connId
));
pCb
->
dbHdl
=
AppDbNewRecord
(
DmConnPeerAddrType
(
pCb
->
connId
),
DmConnPeerAddr
(
pCb
->
connId
));
/* If there is no free record available, fail the pairing attempt */
if
(
pCb
->
dbHdl
==
APP_DB_HDL_NONE
)
{
DmSecCancelReq
(
pCb
->
connId
,
SMP_ERR_PAIRING_NOT_SUP
);
return
;
}
}
}
/* initialize stored keys */
/* initialize stored keys */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment