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
97716103
Commit
97716103
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
feat(ess): Use BSEC if it is enabled
parent
47aca370
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!380
BSEC support
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
epicardium/ble/ess.c
+23
-3
23 additions, 3 deletions
epicardium/ble/ess.c
epicardium/ble/ess.h
+1
-0
1 addition, 0 deletions
epicardium/ble/ess.h
epicardium/modules/bsec.c
+4
-0
4 additions, 0 deletions
epicardium/modules/bsec.c
with
28 additions
and
3 deletions
epicardium/ble/ess.c
+
23
−
3
View file @
97716103
...
...
@@ -180,13 +180,13 @@ WSF_CT_ASSERT(
static
TimerHandle_t
poll_timer
;
static
StaticTimer_t
poll_timer_buffer
;
static
void
bleESS_update
(
struct
bme680_sensor_data
*
data
);
static
void
update_from_bme680
(
struct
bme680_sensor_data
*
data
);
static
void
workpoll
(
void
*
data
)
{
struct
bme680_sensor_data
sensor_data
;
if
(
epic_bme680_read_sensors
(
&
sensor_data
)
==
0
)
{
bleESS_update
(
&
sensor_data
);
update_from_bme680
(
&
sensor_data
);
}
}
...
...
@@ -254,6 +254,11 @@ static void setAttrFromBME680(struct bme680_sensor_data *data)
);
}
static
void
setAttrFromBSEC
(
struct
bsec_sensor_data
*
data
)
{
setAttrFromBME680
((
struct
bme680_sensor_data
*
)
data
);
}
/*
* BLE ESS read callback.
*
...
...
@@ -316,7 +321,7 @@ static attsGroup_t svcESSGroup = {
.
endHandle
=
ESS_END_HDL
,
};
static
void
bleESS_update
(
struct
bme680_sensor_data
*
data
)
static
void
update_from_bme680
(
struct
bme680_sensor_data
*
data
)
{
setAttrFromBME680
(
data
);
...
...
@@ -327,6 +332,17 @@ static void bleESS_update(struct bme680_sensor_data *data)
sendNotification
(
connId
,
ESS_PRESSURE_VAL_HDL
,
BLE_ESS_PRES_CCC_IDX
);
}
void
bleESS_update_from_bsec_data
(
struct
bsec_sensor_data
*
data
)
{
setAttrFromBSEC
(
data
);
/* Send notifications (if enabled) for all characteristics. */
dmConnId_t
connId
=
AppConnIsOpen
();
sendNotification
(
connId
,
ESS_TEMPERATURE_VAL_HDL
,
BLE_ESS_TEMP_CCC_IDX
);
sendNotification
(
connId
,
ESS_HUMIDITY_VAL_HDL
,
BLE_ESS_HUMI_CCC_IDX
);
sendNotification
(
connId
,
ESS_PRESSURE_VAL_HDL
,
BLE_ESS_PRES_CCC_IDX
);
}
/*
* This registers and starts the ESS service.
*/
...
...
@@ -341,6 +357,10 @@ void bleESS_init(void)
*/
void
bleESS_ccc_update
(
void
)
{
if
(
bsec_active
())
{
return
;
}
dmConnId_t
connId
=
AppConnIsOpen
();
if
(
connId
!=
DM_CONN_ID_NONE
&&
(
AttsCccEnabled
(
connId
,
BLE_ESS_TEMP_CCC_IDX
)
||
...
...
This diff is collapsed.
Click to expand it.
epicardium/ble/ess.h
+
1
−
0
View file @
97716103
...
...
@@ -29,3 +29,4 @@ enum {
};
void
bleESS_ccc_update
(
void
);
void
bleESS_update_from_bsec_data
(
struct
bsec_sensor_data
*
data
);
This diff is collapsed.
Click to expand it.
epicardium/modules/bsec.c
+
4
−
0
View file @
97716103
...
...
@@ -4,6 +4,8 @@
#include
"bosch.h"
#include
"bsec_integration.h"
#include
"ble/ess.h"
#include
"epicardium.h"
#include
"modules.h"
#include
"config.h"
...
...
@@ -119,6 +121,8 @@ void output_ready(
last_bme680_timestamp
=
timestamp
;
bleESS_update_from_bsec_data
(
&
last_bsec_data
);
if
(
debug
)
{
LOG_INFO
(
"bsec"
,
...
...
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