From 1e9e07a93b29b4ab80498d0cf965ee7bb7be0910 Mon Sep 17 00:00:00 2001
From: schneider <schneider@blinkenlichts.net>
Date: Sat, 27 Jun 2020 21:48:51 +0200
Subject: [PATCH] fix(ble): Dont report missed scan events

---
 epicardium/ble/ble_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/epicardium/ble/ble_main.c b/epicardium/ble/ble_main.c
index ceb399bca..a5522b4e7 100644
--- a/epicardium/ble/ble_main.c
+++ b/epicardium/ble/ble_main.c
@@ -593,7 +593,10 @@ static void trigger_event(enum ble_event_type event)
 {
 	bool enabled;
 	epic_interrupt_is_enabled(EPIC_INT_BLE, &enabled);
-	if(ble_event && enabled) {
+
+	/* Print a warning if the app is missing events. Missing scan results
+	 * is considered OK though, as they are queued and periodic. */
+	if(ble_event && enabled && ble_event != BLE_EVENT_SCAN_REPORT) {
 		LOG_WARN("ble", "Application missed event %u", ble_event);
 	}
 
-- 
GitLab