fix project life and plug-and-replay on peripherals

This commit is contained in:
2025-11-11 20:13:27 +01:00
parent 621c1922ca
commit b094019ed9
12 changed files with 326 additions and 262 deletions

View File

@@ -30,9 +30,9 @@ func NewOS2LPeripheral(peripheralData PeripheralInfo) (*OS2LPeripheral, error) {
func (p *OS2LPeripheral) Connect(ctx context.Context) error {
log.Info().Str("file", "OS2LPeripheral").Msg("OS2L peripheral connected")
go func() {
runtime.EventsEmit(ctx, string(PeripheralStatus), p.info, "connecting")
runtime.EventsEmit(ctx, string(PeripheralStatusUpdated), p.info, "connecting")
time.Sleep(5 * time.Second)
runtime.EventsEmit(ctx, string(PeripheralStatus), p.info, "disconnected")
runtime.EventsEmit(ctx, string(PeripheralStatusUpdated), p.info, "disconnected")
}()
return nil
}