Trying to figure a way of mapping the telemetry agents fields back to my UI

This commit is contained in:
2026-03-09 23:37:29 +00:00
parent ef2c7bf173
commit 19c2ac2d07
7 changed files with 127 additions and 36 deletions
+25
View File
@@ -0,0 +1,25 @@
package iracing
import (
"esdi/telemetry"
)
type FieldMapper struct {
SDKKey string
DataType telemetry.DataType
Transform func(any) uint64
}
// NOTE: Update the iracing SDK to write data to the same map ALWAYS, then
// I can bind that address and read directly from there on the transform
type boundField struct {
Key string
ID telemetry.FieldID
Transform func(any, *telemetry.TelemetryField)
}
var internalToSDKFieldNames = map[telemetry.FieldID]string{
telemetry.Speed: "Speed",
telemetry.Gear: "Gear",
telemetry.RPM: "RPM",
}