Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on OS interrupt in some states. #6

Closed
mrverrall opened this issue Jun 23, 2020 · 1 comment
Closed

Crash on OS interrupt in some states. #6

mrverrall opened this issue Jun 23, 2020 · 1 comment

Comments

@mrverrall
Copy link
Owner

Not a massive issues as It's an interrupt so you wanted to close anyway, but need to handle this scenario.

2020/06/23 10:30:55 PM5 error: Unresolvable connection error: can't scan: context deadline exceeded
^C2020/06/23 10:30:58 signal received from os: interrupt
panic: close of closed channel

goroutine 1 [running]:
github.com/go-ble/ble/linux/hci/socket.(*Socket).Close(0x1043660, 0x0, 0x0)
/home/pi/go/src/github.com/go-ble/ble/linux/hci/socket/socket.go:148 +0x30
github.com/go-ble/ble/linux/hci.(*HCI).close(0x107c360, 0x0, 0x0, 0x101a03c, 0x101a03c)
/home/pi/go/src/github.com/go-ble/ble/linux/hci/hci.go:327 +0x50
github.com/go-ble/ble/linux/hci.(*HCI).Close(0x107c360, 0x1000194, 0x108d14)
/home/pi/go/src/github.com/go-ble/ble/linux/hci/hci.go:169 +0x2c
github.com/go-ble/ble/linux.(*Device).Stop(0x100eb00, 0x108d0c, 0x10000e0)
/home/pi/go/src/github.com/go-ble/ble/linux/device.go:105 +0x20
github.com/go-ble/ble.Stop(0x1000001, 0x1077f9c)
/home/pi/go/src/github.com/go-ble/ble/gatt.go:52 +0x34
main.unsetBT()
/home/pi/go/src/github.com/mrverrall/go-row-cycle/go-row-cycle.go:65 +0x14
main.main()
/home/pi/go/src/github.com/mrverrall/go-row-cycle/go-row-cycle.go:33 +0x104

@mrverrall
Copy link
Owner Author

Fixed by ensure BT is closed on OS interrupt before ending program

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant