antplusbridge/cmd/bridge
Erik Brakkee 9efdfc9b83 Robustness for the USB connection.
ant: replace usb.GetDevice with direct gousb usage

Remove dependency on antgo/driver/usb to fix libusb context leaks on
device-not-found errors. The previous code called usb.GetDevice which
creates a gousb.Context via libusb_init but leaks it on every error
path (device not found, interface claim failure, etc.). Calling
ListenForTrainer repeatedly (e.g. starting with no dongle and plugging
it in later) triggered a libusb assertion in pthread_key_create because
the leaked contexts were never torn down.

Replace with direct gousb calls in ListenForTrainer, managing the
gousb.Context lifecycle explicitly. Cleanup is ordered correctly on
all paths: release interface, close device, close context, cancel
the ANT message goroutine context.

Also convert panics to returned errors for graceful retry.
2026-06-14 15:20:56 +02:00
..
ant.go Robustness for the USB connection. 2026-06-14 15:20:56 +02:00
bluetooth.go fixed syntax error. 2026-06-13 11:53:04 +02:00
cli.go Robustness for the USB connection. 2026-06-14 15:20:56 +02:00
event.go Now using the original time that the event was received instead of when 2026-06-05 18:35:17 +02:00
log.go fix: synchronize logs, buffer events channel, exit on goroutine failure 2026-05-27 00:36:06 +02:00