From 6b7c09c3149df0c3d00dd307af1932c46ad3fcc1 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Fri, 13 Mar 2026 19:05:11 +0000 Subject: [PATCH] added an empty telemetry field, will be usefull for developemnt --- providers/iracing/fieldMapping.go | 1 + providers/iracing/iracing.go | 7 ++++++- telemetry/data.go | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/providers/iracing/fieldMapping.go b/providers/iracing/fieldMapping.go index c899f85..5d199a7 100644 --- a/providers/iracing/fieldMapping.go +++ b/providers/iracing/fieldMapping.go @@ -8,4 +8,5 @@ var internalToSDKFieldNames = map[telemetry.FieldID]string{ telemetry.Speed: "Speed", telemetry.Gear: "Gear", telemetry.RPM: "RPM", + telemetry.Empty: "empty", } diff --git a/providers/iracing/iracing.go b/providers/iracing/iracing.go index f49050e..1e76a77 100644 --- a/providers/iracing/iracing.go +++ b/providers/iracing/iracing.go @@ -99,7 +99,7 @@ func (i *IRacing) readData() { // Read binded data for _, b := range i.data.ActiveBinds { v := i.SDK.Vars.Vars[b.Key].Value - // NOTE: for the love of god, find a way of avoiding this shit + b.Transform(v, &i.data.Values[b.ID]) } @@ -176,6 +176,11 @@ func (i *IRacing) Subscribe(requestFields map[int16]telem.FieldID) { out.Type = telem.DataTypeUINT16 out.Raw = uint64(uint16(v.(float32))) } + case telem.Empty: + binding.Transform = func(v any, out *telem.TelemetryField) { + out.Type = telem.DataTypeCHAR + out.Raw = uint64('-') + } } i.data.Values[id].ID = winID diff --git a/telemetry/data.go b/telemetry/data.go index 5ff4ecb..203f3d6 100644 --- a/telemetry/data.go +++ b/telemetry/data.go @@ -120,6 +120,7 @@ const ( Speed FieldID = iota RPM Gear + Empty MaxFields ) const FirstField = Speed @@ -128,11 +129,12 @@ var FieldNames = [MaxFields]string{ Speed: "Speed", RPM: "RPM", Gear: "Gear", + Empty: "Emtpy", } func GetFieldName(id FieldID) string { if id >= MaxFields { - return "Uknown" + return "Unknown" } return FieldNames[id]