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
a86715f2
Commit
a86715f2
authored
3 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
feat(ble): Don't send DM and ATT events until disc/cfg complete
parent
e181fcad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!459
feat(ble): Don't send DM and ATT events until disc/cfg complete
Pipeline
#5161
passed
3 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/ble/epic_ble_api.c
+21
-0
21 additions, 0 deletions
epicardium/ble/epic_ble_api.c
with
21 additions
and
0 deletions
epicardium/ble/epic_ble_api.c
+
21
−
0
View file @
a86715f2
...
...
@@ -26,6 +26,8 @@ static uint8_t adv_data_buf[HCI_ADV_DATA_LEN];
static
uint8_t
sr_data_buf
[
HCI_ADV_DATA_LEN
];
static
dmEvt_t
connection_open_event
;
static
bool
connection_open
;
int
epic_ble_free_event
(
struct
epic_ble_event
*
e
)
{
if
(
e
->
data
)
{
...
...
@@ -46,6 +48,25 @@ void ble_epic_ble_api_trigger_event(enum epic_ble_event_type type, void *data)
struct
epic_ble_event
e
=
{
.
type
=
type
,
.
data
=
data
};
if
(
type
==
BLE_EVENT_DM_EVENT
)
{
dmEvt_t
*
dm_event
=
data
;
if
(
dm_event
->
hdr
.
event
==
DM_CONN_OPEN_IND
)
{
connection_open
=
true
;
}
if
(
dm_event
->
hdr
.
event
==
DM_CONN_CLOSE_IND
)
{
connection_open
=
false
;
}
}
if
(
!
connection_open
&&
(
type
==
BLE_EVENT_ATT_EVENT
||
type
==
BLE_EVENT_DM_EVENT
))
{
// Don't forward DM and ATT events until epicardium is done setting up
// the connection
epic_ble_free_event
(
&
e
);
return
;
}
if
(
enabled
)
{
if
(
xQueueSend
(
ble_event_queue
,
&
e
,
0
)
!=
pdTRUE
)
{
/* Print a warning if the app is missing events. Missing scan results
...
...
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