fix: test mode forward proper 324-byte Forza-format packet to downstream devices
This commit is contained in:
@@ -187,7 +187,23 @@ class TelemetryListener:
|
||||
ws_manager.push_telemetry(td)
|
||||
|
||||
if self.forwarder._sock and self.forwarder._targets:
|
||||
buf = struct.pack("<32s", b"\x01" + b"\x00" * 323)
|
||||
buf = struct.pack("<iI" + "f" * 79 + "H" + "B" * 6 + "b" * 3,
|
||||
1, int(time.time() * 1000),
|
||||
max_rpm, 800.0, rpm,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, speed_kmh / 3.6, 0.0, torque,
|
||||
0.0, 0.0, 0.0, 0.0, boost, fuel,
|
||||
0.0, 0.0, best_lap, last_lap, lap_time,
|
||||
0.0, 0.0, 0.0,
|
||||
int(phase) % 15,
|
||||
1, int(throttle * 255), int(brake * 255), 0, 0, gear,
|
||||
int(steering * 127), 0, 0)
|
||||
self.forwarder.forward(buf)
|
||||
|
||||
for cb in self._callbacks:
|
||||
|
||||
Reference in New Issue
Block a user