feat: add device hotplug event notifications (USB on Linux)

This commit is contained in:
easyzoom
2026-02-14 13:56:08 +08:00
parent 5872e0f55e
commit 378045510d
8 changed files with 470 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
//go:build !linux
package sources
import (
"context"
"github.com/sipeed/picoclaw/pkg/devices/events"
)
type USBMonitor struct{}
func NewUSBMonitor() *USBMonitor {
return &USBMonitor{}
}
func (m *USBMonitor) Kind() events.Kind {
return events.KindUSB
}
func (m *USBMonitor) Start(ctx context.Context) (<-chan *events.DeviceEvent, error) {
ch := make(chan *events.DeviceEvent)
close(ch) // Immediately close, no events
return ch, nil
}
func (m *USBMonitor) Stop() error {
return nil
}