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
card10
firmware
Commits
045d3a2c
Commit
045d3a2c
authored
Apr 02, 2021
by
schneider
Browse files
feat(ble): Delay epic con open ind until epicardium is done
parent
62791cdf
Pipeline
#5159
passed with stages
in 28 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
epicardium/ble/ble_api.h
View file @
045d3a2c
...
...
@@ -48,6 +48,7 @@ void ble_epic_att_api_free_att_write_data(struct epic_att_write *w);
void
ble_epic_ble_api_trigger_event
(
enum
epic_ble_event_type
type
,
void
*
data
);
void
ble_epic_ble_api_init
(
void
);
void
ble_epic_dm_api_event
(
dmEvt_t
*
dm_event
);
void
ble_epic_disc_cfg_complete
(
void
);
void
ble_adv_init
(
void
);
void
ble_adv_setup
(
void
);
...
...
epicardium/ble/ble_attc.c
View file @
045d3a2c
#include <stdint.h>
#include <stdbool.h>
#include "ble_api.h"
#include "wsf_types.h"
#include "util/bstream.h"
#include "app_api.h"
...
...
@@ -258,6 +259,7 @@ void bleDiscCback(dmConnId_t connId, uint8_t status)
case
APP_DISC_CFG_CMPL
:
AppDiscComplete
(
connId
,
APP_DISC_CFG_CMPL
);
ble_epic_disc_cfg_complete
();
break
;
case
APP_DISC_CFG_CONN_START
:
...
...
epicardium/ble/epic_ble_api.c
View file @
045d3a2c
...
...
@@ -24,6 +24,7 @@ static StaticQueue_t ble_event_queue_data;
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
;
int
epic_ble_free_event
(
struct
epic_ble_event
*
e
)
{
...
...
@@ -85,7 +86,7 @@ void ble_epic_ble_api_init(void)
ble_epic_att_api_init
();
}
void
ble_epic_dm_api
_event
(
dmEvt_t
*
dm_event
)
static
void
send_dm
_event
(
dmEvt_t
*
dm_event
)
{
dmEvt_t
*
e
=
WsfBufAlloc
(
sizeof
(
*
e
));
...
...
@@ -97,6 +98,24 @@ void ble_epic_dm_api_event(dmEvt_t *dm_event)
}
}
void
ble_epic_dm_api_event
(
dmEvt_t
*
dm_event
)
{
if
(
dm_event
->
hdr
.
event
==
DM_CONN_OPEN_IND
)
{
/* Cache the connection open indication until
* epicardium is done dicovering services. */
memcpy
(
&
connection_open_event
,
dm_event
,
sizeof
(
connection_open_event
));
}
else
{
send_dm_event
(
dm_event
);
}
}
void
ble_epic_disc_cfg_complete
(
void
)
{
send_dm_event
(
&
connection_open_event
);
}
void
epic_ble_close_connection
(
uint8_t
connId
)
{
AppConnClose
(
connId
);
...
...
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