Initial commit of restructured Forza telemetry
This commit is contained in:
parent
4f202804a0
commit
28375c64c5
1 changed files with 102 additions and 0 deletions
102
include/hexagram/telemetry/forza.h
Normal file
102
include/hexagram/telemetry/forza.h
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
#ifndef _HEXAGRAM_TELEMETRY_FORZA_H
|
||||||
|
#define _HEXAGRAM_TELEMETRY_FORZA_H
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <hexagram/types.h>
|
||||||
|
|
||||||
|
#pragma pack(push)
|
||||||
|
#pragma pack(1)
|
||||||
|
|
||||||
|
typedef struct _hexagram_telemetry_forza_car {
|
||||||
|
int32_t id,
|
||||||
|
class,
|
||||||
|
performance_index,
|
||||||
|
drivetrain_type,
|
||||||
|
engine_cylinders;
|
||||||
|
} hexagram_telemetry_forza_car;
|
||||||
|
|
||||||
|
typedef struct _hexagram_telemetry_forza_dash {
|
||||||
|
hexagram_coord position;
|
||||||
|
|
||||||
|
float speed, power, torque;
|
||||||
|
|
||||||
|
hexagram_corner tire_temp;
|
||||||
|
|
||||||
|
float boost,
|
||||||
|
fuel,
|
||||||
|
odometer;
|
||||||
|
} hexagram_telemetry_forza_dash;
|
||||||
|
|
||||||
|
typedef struct _hexagram_telemetry_forza_race {
|
||||||
|
float lap_best,
|
||||||
|
lap_last,
|
||||||
|
lap_current,
|
||||||
|
race_current;
|
||||||
|
|
||||||
|
uint16_t lap_number;
|
||||||
|
uint8_t race_position;
|
||||||
|
|
||||||
|
uint8_t throttle,
|
||||||
|
brake,
|
||||||
|
clutch,
|
||||||
|
handbrake,
|
||||||
|
gear;
|
||||||
|
|
||||||
|
int8_t steer,
|
||||||
|
normalized_driving_line,
|
||||||
|
normalized_ai_brake_difference;
|
||||||
|
} hexagram_telemetry_forza_race;
|
||||||
|
|
||||||
|
typedef struct _hexagram_telemetry_forza_7_race {
|
||||||
|
hexagram_corner tire_wear;
|
||||||
|
int32_t track_id;
|
||||||
|
} hexagram_telemetry_forza_7_race;
|
||||||
|
|
||||||
|
typedef struct _hexagram_telemetry_forza_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,
|
||||||
|
wheel_rotation;
|
||||||
|
|
||||||
|
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_car car;
|
||||||
|
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
uint8_t padding[12];
|
||||||
|
hexagram_telemetry_forza_dash dash;
|
||||||
|
hexagram_telemetry_forza_race race;
|
||||||
|
} fh4;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
hexagram_telemetry_forza_dash dash;
|
||||||
|
hexagram_telemetry_forza_race race;
|
||||||
|
hexagram_telemetry_forza_7_race race_f7;
|
||||||
|
} f7;
|
||||||
|
};
|
||||||
|
} hexagram_telemetry_forza_packet;
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
#endif /* _HEXAGRAM_TELEMETRY_FORZA_H */
|
Loading…
Add table
Reference in a new issue