Begin implementing Forza Dash telemetry protocol

This commit is contained in:
XANTRONIX 2023-12-17 12:47:37 -05:00
parent e1a3c8d6af
commit c512a74738
2 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,86 @@
#ifndef _HEXAGRAM_TELEMETRY_FORZA_DASH_H
#define _HEXAGRAM_TELEMETRY_FORZA_DASH_H
#include <inttypes.h>
#include <hexagram/types.h>
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 */

15
include/hexagram/types.h Normal file
View file

@ -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 */