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
39a2b81d
Commit
39a2b81d
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
chore(ess): Code style
parent
1e892a31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!428
Environmental Sensing Service
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/ble/ess.c
+23
-17
23 additions, 17 deletions
epicardium/ble/ess.c
with
23 additions
and
17 deletions
epicardium/ble/ess.c
+
23
−
17
View file @
39a2b81d
...
...
@@ -36,7 +36,6 @@ static uint16_t initTemperatureLen = sizeof(initTemperatureValue);
static
uint8_t
essValTempChCcc
[]
=
{
UINT16_TO_BYTES
(
0x0000
)};
static
const
uint16_t
essLenTempChCcc
=
sizeof
(
essValTempChCcc
);
/* clang-format on */
/*
...
...
@@ -61,22 +60,24 @@ static const attsAttr_t ESSSvcAttrList[] = {
.
permissions
=
ATTS_PERMIT_READ
,
},
{
.
pUuid
=
attTemperatureChUuid
,
.
pValue
=
initTemperatureValue
,
.
pLen
=
&
initTemperatureLen
,
.
maxLen
=
sizeof
(
initTemperatureValue
),
.
pUuid
=
attTemperatureChUuid
,
.
pValue
=
initTemperatureValue
,
.
pLen
=
&
initTemperatureLen
,
.
maxLen
=
sizeof
(
initTemperatureValue
),
//.settings = ATTS_SET_READ_CBACK,
.
permissions
=
ATTS_PERMIT_READ
|
ATTS_PERMIT_READ_ENC
|
ATTS_PERMIT_READ_AUTH
,
},
/* Characteristic CCC descriptor */
{
.
pUuid
=
attCliChCfgUuid
,
.
pValue
=
essValTempChCcc
,
.
pLen
=
(
uint16_t
*
)
&
essLenTempChCcc
,
.
maxLen
=
sizeof
(
essValTempChCcc
),
.
settings
=
ATTS_SET_CCC
,
.
permissions
=
(
ATTS_PERMIT_READ
|
ATTS_PERMIT_WRITE
)
// How about security?
.
pUuid
=
attCliChCfgUuid
,
.
pValue
=
essValTempChCcc
,
.
pLen
=
(
uint16_t
*
)
&
essLenTempChCcc
,
.
maxLen
=
sizeof
(
essValTempChCcc
),
.
settings
=
ATTS_SET_CCC
,
.
permissions
=
(
ATTS_PERMIT_READ
|
ATTS_PERMIT_WRITE
)
// How about security?
},
};
...
...
@@ -114,9 +115,9 @@ static uint8_t readESSCB(
#endif
static
attsGroup_t
svcESSGroup
=
{
.
pNext
=
NULL
,
.
pAttr
=
(
attsAttr_t
*
)
ESSSvcAttrList
,
.
readCback
=
NULL
,
.
pNext
=
NULL
,
.
pAttr
=
(
attsAttr_t
*
)
ESSSvcAttrList
,
.
readCback
=
NULL
,
//.readCback = readESSCB,
.
writeCback
=
NULL
,
.
startHandle
=
ESS_START_HDL
,
...
...
@@ -129,9 +130,14 @@ void bleESS_update(void)
AttsSetAttr
(
ESS_TEMPERATURE_VAL_HDL
,
sizeof
(
i16
),
(
uint8_t
*
)
&
i16
);
dmConnId_t
connId
=
AppConnIsOpen
();
if
(
connId
!=
DM_CONN_ID_NONE
)
{
if
(
AttsCccEnabled
(
connId
,
BLE_ESS_TEMP_CCC_IDX
))
{
AttsHandleValueNtf
(
connId
,
ESS_TEMPERATURE_VAL_HDL
,
sizeof
(
i16
),
(
uint8_t
*
)
&
i16
);
if
(
connId
!=
DM_CONN_ID_NONE
)
{
if
(
AttsCccEnabled
(
connId
,
BLE_ESS_TEMP_CCC_IDX
))
{
AttsHandleValueNtf
(
connId
,
ESS_TEMPERATURE_VAL_HDL
,
sizeof
(
i16
),
(
uint8_t
*
)
&
i16
);
}
}
}
...
...
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