hci: add check for poll buffer overflow

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2024-01-19 00:32:03 +01:00
parent bf647ecd57
commit e8c6a28223

View file

@ -185,6 +185,12 @@ func (h *hci) poll() error {
return err
case done:
return nil
case i+1 >= len(h.buf):
if debug {
println("hci error: buffer overflow")
}
i = 0
time.Sleep(5 * time.Millisecond)
default:
i++
time.Sleep(1 * time.Millisecond)