Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
François Revol
firmware
Commits
ef7e8958
Verified
Commit
ef7e8958
authored
Jul 30, 2019
by
schneider
Committed by
Rahix
Aug 06, 2019
Browse files
fix(ble): Add some static checking of the attribute group sizes
parent
048196e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
epicardium/ble/svc_core.c
View file @
ef7e8958
...
...
@@ -27,6 +27,7 @@
#include
"svc_core.h"
#include
"svc_ch.h"
#include
"svc_cfg.h"
#include
"wsf_assert.h"
/**************************************************************************************************
Macros
...
...
@@ -79,6 +80,9 @@ static const uint16_t gapLenCarCh = sizeof(gapValCarCh);
/* central address resolution */
static
uint8_t
gapValCar
[]
=
{
FALSE
};
static
const
uint16_t
gapLenCar
=
sizeof
(
gapValCar
);
#if 0
/* TODO card10:
* Enable these if "privacy" is enabled. See svc_core.h lien 38 */
/* resolvable private address only characteristic */
static const uint8_t gapValRpaoCh[] = {ATT_PROP_READ, UINT16_TO_BYTES(GAP_RPAO_HDL), UINT16_TO_BYTES(ATT_UUID_RPAO)};
...
...
@@ -87,6 +91,7 @@ static const uint16_t gapLenRpaoCh = sizeof(gapValRpaoCh);
/* resolvable private address only */
static uint8_t gapValRpao[] = {0};
static const uint16_t gapLenRpao = sizeof(gapValRpao);
#endif
/* Attribute list for GAP group */
static
const
attsAttr_t
gapList
[]
=
...
...
@@ -147,6 +152,9 @@ static const attsAttr_t gapList[] =
0
,
ATTS_PERMIT_READ
},
#if 0
/* TODO card10:
* Enable these if "privacy" is enabled. See svc_core.h lien 38 */
{
attChUuid,
(uint8_t *) gapValRpaoCh,
...
...
@@ -163,6 +171,7 @@ static const attsAttr_t gapList[] =
0,
ATTS_PERMIT_READ
}
#endif
};
/* GAP group structure */
...
...
@@ -176,6 +185,7 @@ static attsGroup_t svcGapGroup =
GAP_END_HDL
};
WSF_CT_ASSERT
(((
sizeof
(
gapList
)
/
sizeof
(
gapList
[
0
]))
==
GAP_END_HDL
-
GAP_START_HDL
+
1
));
/**************************************************************************************************
GATT group
**************************************************************************************************/
...
...
@@ -244,6 +254,8 @@ static attsGroup_t svcGattGroup =
GATT_END_HDL
};
WSF_CT_ASSERT
(((
sizeof
(
gattList
)
/
sizeof
(
gattList
[
0
]))
==
GATT_END_HDL
-
GATT_START_HDL
+
1
));
/*************************************************************************************************/
/*!
* \brief Add the services to the attribute server.
...
...
epicardium/ble/svc_dis.c
View file @
ef7e8958
...
...
@@ -24,6 +24,7 @@
*/
#include
"wsf_types.h"
#include
"att_api.h"
#include
"wsf_assert.h"
#include
"wsf_trace.h"
#include
"util/bstream.h"
#include
"svc_dis.h"
...
...
@@ -306,6 +307,7 @@ static attsGroup_t svcDisGroup =
DIS_END_HDL
};
WSF_CT_ASSERT
(((
sizeof
(
disList
)
/
sizeof
(
disList
[
0
]))
==
DIS_END_HDL
-
DIS_START_HDL
+
1
));
/*************************************************************************************************/
/*!
* \brief Add the services to the attribute server.
...
...
lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/services/svc_core.h
View file @
ef7e8958
...
...
@@ -33,6 +33,8 @@ extern "C" {
Handle Ranges
**************************************************************************************************/
/** \name GAP Service Handles
* TODO card10:
* WTF!
* \note GAP -- RPAO characterstic added only when DM Privacy enabled
*/
/**@{*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment