softdevice: fix event handler
This commit is contained in:
parent
ca2f0920f9
commit
6ded078c91
@ -114,13 +114,13 @@ func (a *Adapter) Enable() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func handleEvent() {
|
func handleEvent() {
|
||||||
|
id := eventBuf.header.evt_id
|
||||||
|
switch {
|
||||||
|
case id >= C.BLE_GAP_EVT_BASE && id <= C.BLE_GAP_EVT_LAST:
|
||||||
handler := defaultAdapter.handler
|
handler := defaultAdapter.handler
|
||||||
if handler == nil {
|
if handler == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
id := eventBuf.header.evt_id
|
|
||||||
switch {
|
|
||||||
case id >= C.BLE_GAP_EVT_BASE && id <= C.BLE_GAP_EVT_LAST:
|
|
||||||
gapEvent := GAPEvent{
|
gapEvent := GAPEvent{
|
||||||
Connection: Connection(eventBuf.evt.unionfield_gap_evt().conn_handle),
|
Connection: Connection(eventBuf.evt.unionfield_gap_evt().conn_handle),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user