diff --git a/linux/hci/hci.go b/linux/hci/hci.go index 1c823005..489c0830 100644 --- a/linux/hci/hci.go +++ b/linux/hci/hci.go @@ -473,6 +473,10 @@ func (h *HCI) handleCommandStatus(b []byte) error { func (h *HCI) handleLEConnectionComplete(b []byte) error { e := evt.LEConnectionComplete(b) + if e.Role() == roleMaster && ErrCommand(e.Status()) == ErrConnID { + // The connection was canceled successfully. + return nil + } c := newConn(h, e) h.muConns.Lock() h.conns[e.ConnectionHandle()] = c @@ -486,10 +490,6 @@ func (h *HCI) handleLEConnectionComplete(b []byte) error { } return nil } - if ErrCommand(e.Status()) == ErrConnID { - // The connection was canceled successfully. - return nil - } return nil } if e.Status() == 0x00 {