Added healthchecks, and maybe got a bit lost

This commit is contained in:
2026-09-22 16:21:50 +01:00
parent 009609da93
commit 82972c9665
11 changed files with 241 additions and 84 deletions
+1 -33
View File
@@ -11,7 +11,6 @@ import (
"sync"
"time"
"esdi/constants"
helper "esdi/helpers"
"esdi/peripheral"
"esdi/peripheral/communication"
@@ -34,6 +33,7 @@ const (
updateWindowCMDID types.Command = 6 // Change this to a move cmd instead
sendDataCMDID types.Command = 7
newLayoutCMDID types.Command = 8
healthCheckCMDID types.Command = 9
)
const (
@@ -149,9 +149,6 @@ func (cds *CDashDisplay) Close() error {
return nil
}
func (d *CDashDisplay) SendCommand() {
}
func (d *CDashDisplay) RegisterFieldMapping(fieldID telemetry.FieldID, winID int16) {
d.fieldToWindows[fieldID] = append(d.fieldToWindows[fieldID], winID)
}
@@ -438,32 +435,3 @@ func (d *CDashDisplay) SendData(data *telemetry.TelemetryData) error {
return nil
}
func (cds *CDashDisplay) setupForIracing() error {
err := cds.LoadLayout("layout.yaml")
if err != nil {
return err
}
return nil
}
func (cds *CDashDisplay) setupForBeamNG() error {
err := cds.LoadLayout("beamng.yaml")
if err != nil {
return err
}
return nil
}
func (cds *CDashDisplay) Setup(provider string) error {
switch provider {
case constants.IRacingProviderName:
return cds.setupForIracing()
case constants.BeamNGProviderName:
return cds.setupForBeamNG()
default:
return fmt.Errorf("unknown provider: %s", provider)
}
}