add the identification ID for a telemetry field

we will use this so the serial device knows where to send the data
This commit is contained in:
2026-03-11 21:20:17 +00:00
parent 15ab85dbe1
commit 05af404db1
5 changed files with 33 additions and 17 deletions
+3 -2
View File
@@ -121,12 +121,12 @@ func (i *IRacing) Stream() (<-chan telem.TelemetryData, error) {
return i.streamCh, nil
}
func (i *IRacing) Subscribe(requestFields []telem.FieldID) {
func (i *IRacing) Subscribe(requestFields map[int16]telem.FieldID) {
i.logger.Debug(fmt.Sprintf("Len Req: %d\n", len(requestFields)))
i.data.ActiveBinds = make([]telem.BoundField, 0, len(requestFields))
for _, id := range requestFields {
for winID, id := range requestFields {
// Translate the UI FieldIDs to this provider's field names
sdkKey, ok := internalToSDKFieldNames[id]
if !ok {
@@ -178,6 +178,7 @@ func (i *IRacing) Subscribe(requestFields []telem.FieldID) {
}
}
i.data.Values[id].ID = winID
i.data.ActiveBinds = append(i.data.ActiveBinds, binding)
}