Skip to content
Snippets Groups Projects
Commit 03b8486c authored by schneider's avatar schneider
Browse files

fix(mp-ble): Only process relevant ATT messages

parent edf6180d
Branches
Tags
1 merge request!446Initial MicroPython BLE support (GATTS)
......@@ -25,13 +25,16 @@ static int next_handle = ATTS_DYN_START_HANDLE;
void ble_epic_att_api_event(attEvt_t *att_event)
{
attEvt_t *e = WsfBufAlloc(sizeof(*e));
if (att_event->handle >= ATTS_DYN_START_HANDLE &&
att_event->handle < next_handle) {
attEvt_t *e = WsfBufAlloc(sizeof(*e));
if (e) {
memcpy(e, att_event, sizeof(*e));
ble_epic_ble_api_trigger_event(BLE_EVENT_ATT_EVENT, e);
} else {
LOG_WARN("ble", "could not allocate att event");
if (e) {
memcpy(e, att_event, sizeof(*e));
ble_epic_ble_api_trigger_event(BLE_EVENT_ATT_EVENT, e);
} else {
LOG_WARN("ble", "could not allocate att event");
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment