automatic setup for devices

Its not close to being done and still need to work out the flows due to
who arrives first: telemetry or the peripheral?
This commit is contained in:
2026-09-21 15:27:42 +01:00
parent 6ff4cc3014
commit b364931c80
8 changed files with 134 additions and 15 deletions
+8 -2
View File
@@ -17,14 +17,20 @@ func NewOrchestrator(logger *slog.Logger) (*Orchestrator, error) {
devService := NewDeviceService(logger.With("service", "DeviceService"), msg)
telemService := NewTelemetryService(logger.With("service", "TelemetryService"), devService, msg)
telemService := NewTelemetryService(logger.With("service", "TelemetryService"), msg)
if telemService == nil {
return nil, errors.New("failed to create telemetry service")
}
go telemService.FindProvider(telemService.CtxMonitor)
// Need to setup the callbacks on the services
// Setup device service callbacks
devService.OnPeripheralFound = telemService.PeripheralFoundCallback
devService.telemetryProvider = telemService.GetTelemetryProviderName
// Setup telemetry service callbacks
telemService.OnProviderFound = devService.ProviderFoundCallback
telemService.peripheralProvider = devService.GetDevices
return &Orchestrator{
DeviceService: devService,