From c512a747389deba93f6a446b1399e28735928527 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Sun, 17 Dec 2023 12:47:37 -0500 Subject: [PATCH] Begin implementing Forza Dash telemetry protocol --- include/hexagram/telemetry/forza-dash.h | 86 +++++++++++++++++++++++++ include/hexagram/types.h | 15 +++++ 2 files changed, 101 insertions(+) create mode 100644 include/hexagram/telemetry/forza-dash.h create mode 100644 include/hexagram/types.h diff --git a/include/hexagram/telemetry/forza-dash.h b/include/hexagram/telemetry/forza-dash.h new file mode 100644 index 0000000..5c60c6d --- /dev/null +++ b/include/hexagram/telemetry/forza-dash.h @@ -0,0 +1,86 @@ +#ifndef _HEXAGRAM_TELEMETRY_FORZA_DASH_H +#define _HEXAGRAM_TELEMETRY_FORZA_DASH_H + +#include +#include + +hexagram_coord { + float x, y, z; +}; + +hexagram_corner { + float front_left, front_right, rear_left, rear_right; +}; + +typedef struct _hexagram_telemetry_forza_dash_car { + int32_t id, + class, + drivetrain, + engine_cylinders; + + hexagram_coord position; + + float speed, power, torque; + + hexagram_corner tire_temp; + + float boost, + fuel, + odometer; + +} hexagram_telemetry_forza_dash_car; + +typedef struct _hexagram_telemetry_forza_dash_race { + float lap_best, + lap_last, + lap_current, + race_time_current; + + uint16_t lap_number; + uint8_t race_position, + throttle, + clutch, + handbrake, + gear; + + int8_t steer, + normalized_driving_line, + normalized_ai_brake_difference; + + hexagram_corner tire_wear; + + int32_t track_id; +} hexagram_telemetry_forza_dash_race; + +typedef struct _hexagram_telemetry_forza_dash_packet { + int32_t race_on; + uint32_t timestamp_ms; + + struct { + float max, idle, current; + } engine_rpm; + + hexagram_coord acceleration, + velocity, + angular_velocity; + + float yaw, pitch, roll; + + hexagram_corner normalized_suspension_travel, + tire_slip_ratio; + + struct { + int32_t front_left, front_right, rear_left, rear_right; + } wheel_on_rumble_strip; + + hexagram_corner wheel_in_puddle_depth, + surface_rumble, + tire_slip_angle, + tire_combined_slip, + suspension_travel; + + hexagram_telemetry_forza_dash_car car; + hexagram_telemetry_forza_dash_race race; +} hexagram_telemetry_forza_dash_packet; + +#endif /* _HEXAGRAM_TELEMETRY_FORZA_DASH_H */ diff --git a/include/hexagram/types.h b/include/hexagram/types.h new file mode 100644 index 0000000..8688447 --- /dev/null +++ b/include/hexagram/types.h @@ -0,0 +1,15 @@ +#ifndef _HEXAGRAM_TYPES_H +#define _HEXAGRAM_TYPES_H + +typedef struct _hexagram_coord { + float x, y, z; +} hexagram_coord; + +typedef struct _hexagram_corner { + float front_left, + front_right, + rear_left, + rear_right; +} hexagram_corner; + +#endif /* _HEXAGRAM_TYPES_H */