From 6ded078c91ede52612c43b4bfcfdd81f2fd116c2 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 16 Nov 2019 19:00:18 +0100 Subject: [PATCH] softdevice: fix event handler --- adapter_sd.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adapter_sd.go b/adapter_sd.go index b174afc..f70b0b1 100644 --- a/adapter_sd.go +++ b/adapter_sd.go @@ -114,13 +114,13 @@ func (a *Adapter) Enable() error { } func handleEvent() { - handler := defaultAdapter.handler - if handler == nil { - return - } id := eventBuf.header.evt_id switch { case id >= C.BLE_GAP_EVT_BASE && id <= C.BLE_GAP_EVT_LAST: + handler := defaultAdapter.handler + if handler == nil { + return + } gapEvent := GAPEvent{ Connection: Connection(eventBuf.evt.unionfield_gap_evt().conn_handle), }