Telemetry dashboard for fh6
- Odin 100%
| fh-telemetry | ||
| Skald@6625a910af | ||
| .gitmodules | ||
| README.md | ||
fh-telemetry
A small Odin program that currently listens for the UDP telemetry stream broadcast by Forza Horizon (the game's "Data Out" packet format), parses it into a structured type. Next steps are to start building an SL3/microui GUI dashboard to display the data with.
Procedural structure
main():
↓
Starts UDP receiver thread
↓
Starts Packet parsing thread
↓
Does nothing in a loop (reserved for GUI)
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
entry_receiver():
↓
Creates UDP Socket (init_receiver())
↓
Receives packets into PACKET_BUF with recv_udp() in a loop
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
entry_parser():
↓
Checks PACKET_IS_NEW in a loop, parse packet with data_from_packet() if true:
↓
Memcopies new packet into WORKING_DATA_BUF
↓
Assigns values to TELEMETRY_DATA based on packet data
Data Structures
I use global buffers as much as possible to minimize alocations
PACKET_BUF: Where net.recv_udp() dumps packets into
WORKING_DATA_BUF: Packets immediately get memcopied into this buffer when PACKET_IS_NEW == true
TELEMETRY_DATA: Struct that holds parsed data
TELEMETRY_DATA_IS_NEW: Will be used to tell the GUI to update once that's implemented