Skip to content
C

Release 1.4.1 stability fixes

YU CHIH CHANGb9795ab8e106
diff --git a/VERSION b/VERSION
index 88c5fb8..347f583 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.4.0
+1.4.1
diff --git a/include/version.h b/include/version.h
index 2238d4e..e400c1c 100644
--- a/include/version.h
+++ b/include/version.h
@@ -1,3 +1,3 @@
#pragma once
-inline constexpr char GT7_DASH_VERSION[] = "1.4.0";
+inline constexpr char GT7_DASH_VERSION[] = "1.4.1";
diff --git a/installer/firmware/firmware-ili9341.bin b/installer/firmware/firmware-ili9341.bin
index 8092329..7e5e89c 100644
Binary files a/installer/firmware/firmware-ili9341.bin and b/installer/firmware/firmware-ili9341.bin differ
diff --git a/installer/firmware/firmware-st7789.bin b/installer/firmware/firmware-st7789.bin
index 658800d..2cef76b 100644
Binary files a/installer/firmware/firmware-st7789.bin and b/installer/firmware/firmware-st7789.bin differ
diff --git a/installer/manifest-st7789.json b/installer/manifest-st7789.json
index 5274254..8358ce9 100644
--- a/installer/manifest-st7789.json
+++ b/installer/manifest-st7789.json
@@ -1,6 +1,6 @@
{
"name": "ESP32 GT7 Dashboard (ST7789)",
- "version": "1.4.0",
+ "version": "1.4.1",
"new_install_prompt_erase": true,
"builds": [
{
diff --git a/installer/manifest.json b/installer/manifest.json
index c12becb..de149ce 100644
--- a/installer/manifest.json
+++ b/installer/manifest.json
@@ -1,6 +1,6 @@
{
"name": "ESP32 GT7 Dashboard (ILI9341)",
- "version": "1.4.0",
+ "version": "1.4.1",
"new_install_prompt_erase": true,
"builds": [
{
diff --git a/installer/release-notes.json b/installer/release-notes.json
index c188a6c..d8028b4 100644
--- a/installer/release-notes.json
+++ b/installer/release-notes.json
@@ -1,4 +1,9 @@
{
+ "1.4.1": [
+ "Fixed touch wake-up when the display sleeps while Settings is open.",
+ "Bundled the customized GT7 UDP parser directly with the project for reliable clean builds.",
+ "Reduced telemetry heap fragmentation by replacing per-packet dynamic buffers and removing packet dump logging."
+ ],
"1.4.0": [
"Added the Radar dashboard theme with a circular telemetry-driven shift-light display.",
"Expanded Theme Selection to a four-theme 2 x 2 layout while preserving saved enum values.",
diff --git a/installer/releases.json b/installer/releases.json
index 1a930cc..5d5cd60 100644
--- a/installer/releases.json
+++ b/installer/releases.json
@@ -1,5 +1,17 @@
{
"versions": [
+ {
+ "version": "1.4.1",
+ "notes": [
+ "Fixed touch wake-up when the display sleeps while Settings is open.",
+ "Bundled the customized GT7 UDP parser directly with the project for reliable clean builds.",
+ "Reduced telemetry heap fragmentation by replacing per-packet dynamic buffers and removing packet dump logging."
+ ],
+ "manifests": {
+ "ili9341": "versions/1.4.1/manifest-ili9341.json",
+ "st7789": "versions/1.4.1/manifest-st7789.json"
+ }
+ },
{
"version": "1.4.0",
"notes": [
diff --git a/installer/versions/1.4.1/boot_app0.bin b/installer/versions/1.4.1/boot_app0.bin
new file mode 100644
index 0000000..13562ca
Binary files /dev/null and b/installer/versions/1.4.1/boot_app0.bin differ
diff --git a/installer/versions/1.4.1/bootloader.bin b/installer/versions/1.4.1/bootloader.bin
new file mode 100644
index 0000000..d592359
Binary files /dev/null and b/installer/versions/1.4.1/bootloader.bin differ
diff --git a/installer/versions/1.4.1/firmware-ili9341.bin b/installer/versions/1.4.1/firmware-ili9341.bin
new file mode 100644
index 0000000..7e5e89c
Binary files /dev/null and b/installer/versions/1.4.1/firmware-ili9341.bin differ
diff --git a/installer/versions/1.4.1/firmware-st7789.bin b/installer/versions/1.4.1/firmware-st7789.bin
new file mode 100644
index 0000000..2cef76b
Binary files /dev/null and b/installer/versions/1.4.1/firmware-st7789.bin differ
diff --git a/installer/versions/1.4.1/manifest-ili9341.json b/installer/versions/1.4.1/manifest-ili9341.json
new file mode 100644
index 0000000..bd30f05
--- /dev/null
+++ b/installer/versions/1.4.1/manifest-ili9341.json
@@ -0,0 +1,28 @@
+{
+ "name": "ESP32 GT7 Dashboard (ILI9341)",
+ "version": "1.4.1",
+ "new_install_prompt_erase": true,
+ "builds": [
+ {
+ "chipFamily": "ESP32",
+ "parts": [
+ {
+ "path": "bootloader.bin",
+ "offset": 4096
+ },
+ {
+ "path": "partitions.bin",
+ "offset": 32768
+ },
+ {
+ "path": "boot_app0.bin",
+ "offset": 57344
+ },
+ {
+ "path": "firmware-ili9341.bin",
+ "offset": 65536
+ }
+ ]
+ }
+ ]
+}
diff --git a/installer/versions/1.4.1/manifest-st7789.json b/installer/versions/1.4.1/manifest-st7789.json
new file mode 100644
index 0000000..39e0f4a
--- /dev/null
+++ b/installer/versions/1.4.1/manifest-st7789.json
@@ -0,0 +1,28 @@
+{
+ "name": "ESP32 GT7 Dashboard (ST7789)",
+ "version": "1.4.1",
+ "new_install_prompt_erase": true,
+ "builds": [
+ {
+ "chipFamily": "ESP32",
+ "parts": [
+ {
+ "path": "bootloader.bin",
+ "offset": 4096
+ },
+ {
+ "path": "partitions.bin",
+ "offset": 32768
+ },
+ {
+ "path": "boot_app0.bin",
+ "offset": 57344
+ },
+ {
+ "path": "firmware-st7789.bin",
+ "offset": 65536
+ }
+ ]
+ }
+ ]
+}
diff --git a/installer/versions/1.4.1/partitions.bin b/installer/versions/1.4.1/partitions.bin
new file mode 100644
index 0000000..1954582
Binary files /dev/null and b/installer/versions/1.4.1/partitions.bin differ
diff --git a/lib/GT7Udp b/lib/GT7Udp
deleted file mode 160000
index dc58225..0000000
--- a/lib/GT7Udp
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit dc58225c9c6b6d271218145edfd68ef0528aad3d
diff --git a/lib/GT7Udp/.gitignore b/lib/GT7Udp/.gitignore
new file mode 100644
index 0000000..259148f
--- /dev/null
+++ b/lib/GT7Udp/.gitignore
@@ -0,0 +1,32 @@
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
diff --git a/lib/GT7Udp/LICENSE b/lib/GT7Udp/LICENSE
new file mode 100644
index 0000000..33a8cff
--- /dev/null
+++ b/lib/GT7Udp/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 MacManley
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/lib/GT7Udp/README.md b/lib/GT7Udp/README.md
new file mode 100644
index 0000000..db2489b
--- /dev/null
+++ b/lib/GT7Udp/README.md
@@ -0,0 +1,800 @@
+# Gran Turismo 7 UDP | Library for use on ESP 32 / ESP8266 devices
+**Data Output from the Gran Turismo 7 Game**
+
+This program captures and parses packets that are sent by UDP from the Gran Turismo 7 game on PS4/PS5. This library is written in C++, specifically for usage on the ESP32 and ESP8266.
+
+# Usage:
+```c++
+#include <GT7UDPParser.h>
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+IPAddress playstationIP;
+char packetVersion;
+
+void setup()
+{
+ gt7Telem.begin(playstationIP, packetVersion);
+ gt7Telem.sendHeartbeat();
+}
+
+void loop()
+{
+ packetContent = gt7Telem.read();
+//...
+}
+```
+
+### Packet
+
+The following data types are used in the structure:
+
+| Type | Description |
+| ------ | ----------------------- |
+| char | 8-bit character |
+| uint8 | Unsigned 8-bit integer |
+| int16 | Signed 16-bit integer |
+| uint32 | Unsigned 32-bit integer |
+| int32 | Signed 32-bit integer |
+| float | Floating point (32-bit) |
+
+There is an encrypted packet sent out by GT7. The packet is encrypted in the Salsa20 stream cipher. The packets will only be sent from the console if there is a heartbeat sent from a device (in our case an ESP8266/ESP32). Once the console receives a heartbeat, it then establishes a connection with the ESP8266/ESP32 and sends the data to the IP address that was used to send the heartbeat. The console will expect a heartbeat every 1000 packets (around 16 seconds) or else the connection will cease.
+
+## Packet Types
+
+Since Update 1.42, two new packet type have been added to the game, known as the "B" and "\~" packets, alongside the original "A" packet. These new packets can be accessed by changing the "A" character sent via the heartbeat to either "B" or "\~".
+
+Since around Update ~1.68, a new packet type emerged known as the "C" packet. It can be accessed by changing the "A", "B" or "\~" heartbeat to "C".
+
+## Packet "A":
+
+This base packet details many different telemetry points such as positioning, car telemetry, laptimes and more.
+
+Size: 296 bytes
+
+Frequency: 60Hz (60 times a second)
+
+```c++
+struct PacketA {
+int32_t magic; // Magic, different value defines what game is being played
+float position[3]; // Position on Track in meters in each axis
+float worldVelocity[3]; // Velocity in meters for each axis
+float rotation[3]; // Rotation (Pitch/Yaw/Roll) (RANGE: -1 -> 1)
+float orientationRelativeToNorth; // Orientation to North (RANGE: 1.0 (North) -> 0.0 (South))
+float angularVelocity[3]; // Speed at which the car turns around axis in rad/s (RANGE: -1 -> 1)
+float bodyHeight; // Body height
+float EngineRPM; // Engine revolutions per minute
+uint8_t iv[4]; // IV for Salsa20 encryption/decryption
+float fuelLevel; // Fuel level of car in liters
+float fuelCapacity; // Max fuel capacity for current car (RANGE: 100 (most cars) -> 5 (karts) -> 0 (electric cars))
+float speed; // Speed in m/s
+float boost; // Offset by +1 (EXAMPLE: 1.0 = 0 X 100kPa, 2.0 = 1 x 100kPa)
+float oilPressure; // Oil pressure in bars
+float waterTemp; // Always 85
+float oilTemp; // Always 110
+float tyreTemp[4]; // Tyre temp for all 4 tires (FL -> FR -> RL -> RR)
+int32_t packetId; // ID of packet
+int16_t lapCount; // Lap count
+int16_t totalLaps; // Laps to finish
+int32_t bestLaptime; // Best lap time, defaults to -1 if not set
+int32_t lastLaptime; // Previous lap time, defaults to -1 if not set
+int32_t dayProgression; // Current time of day on track in ms
+int16_t RaceStartPosition; // Position of the car before the start of the race, defaults to -1 after race start
+int16_t preRaceNumCars; // Number of cars before the race start, defaults to -1 after start of the race
+int16_t minAlertRPM; // Minimum RPM that the rev limiter displays an alert
+int16_t maxAlertRPM; // Maximum RPM that the rev limiter displays an alert
+int16_t calcMaxSpeed; // Highest possible speed achievable of the current transmission settings
+SimulatorFlags flags; // Packet flags
+uint8_t gears; // First 4 bits: Current Gear, Last 4 bits: Suggested Gear, see appendices (getCurrentGearFromByte and getSuggestedGearFromByte)
+uint8_t throttle; // Throttle (RANGE: 0 -> 255)
+uint8_t brake; // Brake (RANGE: 0 -> 255)
+uint8_t UNKNOWNBYTE1; // Padding byte
+float roadPlane[3]; // Banking of the road
+float roadPlaneDistance; // Distance above or below the plane, e.g a dip in the road is negative, hill is positive.
+float wheelRPS[4]; // Revolutions per second of tyres in rads
+float tyreRadius[4]; // Radius of the tyre in meters
+float suspHeight[4]; // Suspension height of the car
+float UNKNOWNFLOATS[8]; // Unknown floats
+float clutch; // Clutch (RANGE: 0.0 -> 1.0)
+float clutchEngagement; // Clutch Engangement (RANGE: 0.0 -> 1.0)
+float RPMFromClutchToGearbox; // Pretty much same as engine RPM, is 0 when clutch is depressed
+float transmissionTopSpeed; // Top speed as gear ratio value
+float gearRatios[8]; // Gear ratios of the car up to 8
+int32_t carCode; // This value may be overriden if using a car with more then 9 gears, see appendices
+};
+```
+
+## Packet "B":
+
+Packet "B" features the same structure as Packet A, excluding 5 additional floats.
+
+Size: 316 bytes
+
+Frequency: 60Hz (not available in Sport Mode)
+
+```c++
+//...
+struct PacketB : public PacketA {
+float wheelRotation; // Calculates the wheel rotation in radians
+float steeringAngularVelocity; // Angular velocity of the steering wheel in rad/s
+float sway; // X axis acceleration
+float heave; // Y axis acceleration
+float surge; // Z axis acceleration
+};
+```
+
+## Packet "\~":
+
+Packet "\~" includes all data from both Packet A and Packet B, while adding various miscellanous datapoints such as active aero vectors.
+
+Size: 344 Bytes
+
+Frequency: 60Hz (not available in Replays)
+
+```c++
+//...
+struct PacketTilda : public PacketB {
+uint8_t throttleFiltered; // Filtered Throttle Output
+uint8_t brakeFiltered; // Filtered Brake Output
+uint8_t UNKNOWNUINT81; // Unknown unsigned 8 bit integer
+uint8_t UNKNOWNUINT82; // Unknown unsigned 8 bit integer
+float torqueVectors[4]; // Torque vectoring for certain cars - Positive = driving force - Negative = braking or regenerating
+float energyRecovery; // Energy being recovered to the battery
+float UNKNOWNFLOAT11; // Unknown float
+};
+```
+
+> Note: Unlike the unknown bytes and floats of packet A which are assumed to be padding, Packet "\~" is still under ongoing research to determine the function of the unknown integers and floats. Therefore, the packet structure is subject to change upon any new findings.
+
+## Packet "C":
+
+Packet C includes all the data from previous packets, while adding car and laptime metrics.
+
+Size: 368 Bytes
+
+Frequency: 60Hz
+
+```c++
+struct PacketC : public PacketB {
+char surfaceType[4]; // The kind of surface in contact with the tyres (T: tarmac, C: curb/kerb D: Dirt/Grass)
+int32_t currentLap; // The current lap being set in milliseconds
+float wheelSteeringAngle[2]; // Steering angle of the front wheels in radians (left to right)
+float wheelBase; // Distance between the front and rear axles in meters (front left of the car to rear left of the car)
+char carCategory[4]; // Null terminated string of car category (G R 3 NUL, G R X NUL etc. Look at 3rd character for the actual type, the GR can be ignored most of the time)
+};
+```
+
+## Encryption
+
+The packet is encrypted in the Salsa20 cipher stream with a 32 byte key and 8 byte nonce.
+
+### ***Key***
+
+```
+Simulator Interface Packet GT7 ver 0.0
+```
+
+This key is 39 bytes long. Each character in the string has to be converted into a byte slice of length 32, so the first 32 characters are used. Each character converted of the string will be represented by its corresponding ASCII value.
+
+### ***Nonce***
+
+The beginnings of the 8 byte nonce can be located at position \[0x40:0x44]. 4 bytes are extracted from the buffer. The extracted value is interpreted as a 32-bit integer, denoted as `iv1`. This value also undergoes an XOR operation with the constant `0xDEADBEAF`, `0xDEADBEEF` or `0x55FABB4F` depending on the packet version, producing a new integer value called `iv2`. These byte slices are then combined into the full 8 byte nonce, with the first 4 bytes initialized as `iv2`, and the last 4 bytes as `iv1`.
+
+# **Appendices**
+
+## Additional Functions
+
+These are the current additional functions needed to retrieve additional information not immediately present in the packet
+
+```c++
+uint8_t getCurrentGearFromByte(); // Get the currently selected gear, Using gears
+uint8_t getSuggestedGearFromByte(); // Get the currently suggested gear, Using gears (Will be 15 if no gear is currently suggested)
+uint8_t getPowertrainType(); // Get the powertrain type, Using fuelCapacity, 0: Combustion Engine, 1: Electric, 2: Karts
+float getTyreSpeed(); // Get linear tyre speed, using tyreRPS and tyreRadius
+float getTyreSlipRatio(); // Get the tyre slip ratio, using speed and tyreSpeed
+```
+
+Here is how you can use them in your program:
+
+```c++
+#include <GT7UDPParser.h>
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+
+void setup()
+{
+ gt7Telem.begin();
+ gt7Telem.sendHeartbeat();
+}
+
+void loop()
+{
+ packetContent = gt7Telem.read();
+ uint8_t currentGear = gt7Telem.getCurrentGearFromByte();
+}
+```
+
+## Surface Type
+
+These are the surface type IDs for each surface type. surfaceType is comprised of 4 characters, one for each wheel.
+
+|ID |Surface Type |
+|---|-----------|
+| C | Curb/Kerb |
+| D | Dirt |
+| G | Grass |
+| S | Sand |
+| s | Snow |
+| T | Tarmac |
+
+## Simulator Flags
+
+
+There are bit flags sent out in the packet that detail game and car state. flags is a signed 16 bit integer.
+
+|ID |Name |Operation|
+|----|----------------------|---------------|
+|0 |None (No Active Flags)|flags == 0 |
+|1 |Car On Track |flags & 1 << 0 |
+|2 |Paused |flags & 1 << 1 |
+|3 |Loading Or Processing |flags & 1 << 2 |
+|4 |In Gear |flags & 1 << 3 |
+|5 |Has Turbo |flags & 1 << 4 |
+|6 |Rev Limit Alert Active|flags & 1 << 5 |
+|7 |Handbrake Active |flags & 1 << 6 |
+|8 |Lights Active |flags & 1 << 7 |
+|9 |High Beams Active |flags & 1 << 8 |
+|10 |Low Beams Active |flags & 1 << 9 |
+|11 |ASM Active |flags & 1 << 10|
+|12 |TCS Active |flags & 1 << 11|
+
+These bit flags can be accessed using the getFlag() function as shown below:
+
+```C++
+#include <GT7UDPParser.h>
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+
+void loop()
+{
+ packetContent = gt7Telem.read();
+ uint8_t TCSActive = gt7Telem.getFlag(12);
+ if (TCSActive) {
+ Serial.println("TCS: Active");
+ } else {
+ Serial.println("TCS: Not Active");
+ }
+}
+```
+
+
+## Car and Manufacturer IDs
+
+
+|ID |Name |Manufacturer|
+|----|-----------------------------------------------|-----|
+|24 |180SX Type X '96 |28 |
+|31 |Camaro Z28 '69 |7 |
+|36 |Chevelle SS 454 Sport Coupé |7 |
+|41 |Corvette Stingray (C3) '69 |7 |
+|48 |Fairlady 240ZG (HS30) '71 |28 |
+|63 |Corolla Levin 1600GT APEX (AE86) '83 |43 |
+|78 |Silvia K's Aero (S14) '96 |28 |
+|82 |Supra RZ '97 |43 |
+|104 |Sileighty '98 |28 |
+|105 |205 Turbo 16 Evolution 2 '86 |32 |
+|116 |GT-One (TS020) '99 |43 |
+|135 |S800 '66 |15 |
+|137 |Beat '91 |15 |
+|145 |Copen '02 |10 |
+|173 |R5 Turbo '80 |34 |
+|187 |Tuscan Speed 6 '00 |44 |
+|201 |Eunos Roadster (NA) '89 |21 |
+|203 |Integra Type R (DC2) '98 |15 |
+|204 |Civic Type R (EK) '98 |15 |
+|205 |RX-7 Spirit R Type A (FD) '02 |21 |
+|207 |MR2 GT-S '97 |43 |
+|210 |R34 GT-R V-spec II Nur '02 |28 |
+|211 |Lancer Evolution V GSR '98 |25 |
+|216 |McLaren F1 GTR Race Car '97 |6 |
+|293 |NSX Type R '92 |15 |
+|296 |787B '91 |21 |
+|301 |Lancer Evolution IV GSR '96 |25 |
+|315 |Cobra 427 '66 |36 |
+|334 |Clio V6 24V '00 |34 |
+|345 |Sprinter Trueno 1600GT APEX (S.Shigeno Version)|43 |
+|365 |155 2.5 V6 TI '93 |3 |
+|374 |RX-7 GT-X (FC) '90 |21 |
+|379 |Impreza Coupe WRX Type R STi Ver.VI '99 |38 |
+|387 |300 SL Coupe '54 |22 |
+|396 |NSX Type R '02 |15 |
+|451 |Impreza 22B-STi '98 |38 |
+|485 |GT-R GT500 '99 |28 |
+|489 |R33 GT-R V-spec '97 |28 |
+|514 |S2000 '99 |15 |
+|533 |Stratos '73 |18 |
+|543 |XJ220 '92 |17 |
+|575 |190 E 2.5-16 Evolution II '91 |22 |
+|604 |2000GT '67 |43 |
+|665 |Superbird '70 |55 |
+|688 |Integra Type R (DC2) '95 |15 |
+|709 |Fairlady Z 300ZX TT 2seater '89 |28 |
+|773 |R32 GT-R V-spec II '94 |28 |
+|779 |Cappuccino (EA11R) '91 |39 |
+|781 |Celica GT-FOUR Rally Car (ST205) '95 |43 |
+|799 |Lancer Evolution VIII MR GSR '04 |25 |
+|808 |V6 Escudo Pikes Peak Special spec.98 |39 |
+|810 |Sprinter Trueno 1600GT APEX (AE86) '83 |43 |
+|818 |Corvette (C2) '63 |7 |
+|821 |Civic Type R (EK) '97 |15 |
+|829 |Delta HF Integrale Evoluzione '91 |18 |
+|836 |Skyline 2000GT-R (KPGC110) '73 |28 |
+|837 |Skyline Hard Top 2000GT-R (KPGC10) '70 |28 |
+|843 |Supra 3.0GT Turbo A '88 |43 |
+|919 |Silvia Q's (S13) '88 |28 |
+|931 |Lancer Evolution III GSR '95 |25 |
+|942 |Corvette ZR-1 (C4) '89 |7 |
+|954 |R92CP '92 |28 |
+|959 |TT Coupe 3.2 quattro '03 |5 |
+|998 |Sauber Mercedes C9 '89 |22 |
+|1027|DeLorean S2 '04 |65 |
+|1040|Ford GT LM Race Car Spec II |13 |
+|1044|Sports 800 '65 |43 |
+|1067|XJR-9 '88 |17 |
+|1069|2J '70 |93 |
+|1365|R8 4.2 '07 |5 |
+|1370|MINI Cooper S '05 |51 |
+|1373|Viper GTS '02 |11 |
+|1378|F430 '06 |110 |
+|1384|Fairlady Z Version S (Z33) '07 |28 |
+|1385|Swift Sport '07 |39 |
+|1399|M3 '07 |6 |
+|1402|Viper SRT10 Coupe '06 |11 |
+|1409|F40 '92 |110 |
+|1410|512 BB '76 |110 |
+|1425|Ford GT LM Spec II Test Car |13 |
+|1426|Ford GT '06 |13 |
+|1431|RE Amemiya FD3S RX-7 |87 |
+|1433|Amuse S2000 GT1 Turbo |59 |
+|1448|SILVIA spec-R Aero (S15) '02 |28 |
+|1458|Fairlady Z (Z34) '08 |28 |
+|1461|Silvia K's Dia Selection (S13) '90 |28 |
+|1466|GT-R GT500 '08 |28 |
+|1470|Supra GT500 '97 |43 |
+|1474|Enzo Ferrari '02 |110 |
+|1480|Corvette ZR1 (C6) '09 |7 |
+|1481|Countach 25th Anniversary '88 |112 |
+|1484|Countach LP400 '74 |112 |
+|1504|458 Italia '09 |110 |
+|1506|Gallardo LP 560-4 '08 |112 |
+|1507|SLS AMG '10 |153 |
+|1508|Lancer Evolution VI GSR T.M. SCP '99 |25 |
+|1510|NSX GT500 '08 |15 |
+|1516|SC430 GT500 '08 |50 |
+|1523|500 F '68 |12 |
+|1527|500 1.2 8V Lounge SS '08 |12 |
+|1528|SLR McLaren '09 |22 |
+|1536|Zonda R '09 |30 |
+|1537|Prius G '09 |43 |
+|1539|GranTurismo S '08 |116 |
+|1540|McLaren F1 '94 |117 |
+|1541|TTS Coupe '09 |5 |
+|1542|Corvette Convertible (C3) '69 |7 |
+|1543|Challenger R/T '70 |11 |
+|1544|430 Scuderia '07 |110 |
+|1545|Murcielago LP 640 '09 |112 |
+|1549|Amuse NISMO 380RS Super Leggera |59 |
+|1551|330 P4 '67 |110 |
+|1553|XJ13 '66 |17 |
+|1562|LFA '10 |50 |
+|1563|Megane Trophy '11 |34 |
+|1565|Mark IV Race Car '67 |13 |
+|1578|8C Competizione '08 |3 |
+|1581|GT by Citroen Road Car |9 |
+|1582|Miura P400 Bertone Prototype '67 |112 |
+|1645|GIULIA TZ2 carrozzata da ZAGATO '65 |3 |
+|1646|908 HDi FAP '10 |32 |
+|1671|Sambabus Typ 2 '62 |46 |
+|1689|Civic Type R (EK) Touring Car |15 |
+|1722|MP4-12C '10 |117 |
+|1729|Mustang Mach 1 '71 |13 |
+|1746|Roadster Touring Car |21 |
+|1770|Aventador LP 700-4 '11 |112 |
+|1773|Scirocco R '10 |46 |
+|1778|Volkswagen 1200 '66 |46 |
+|1796|A110 '72 |86 |
+|1797|SLS AMG GT3 '11 |153 |
+|1893|Z8 '01 |6 |
+|1895|Dino 246 GT '71 |110 |
+|1896|Model S Signature Performance '12 |119 |
+|1898|One-77 '11 |4 |
+|1900|XNR Ghia Roadster '60 |55 |
+|1902|Z4 GT3 '11 |6 |
+|1904|M3 GT '11 |6 |
+|1905|GT-R NISMO GT3 '13 |28 |
+|1907|X-BOW R '12 |121 |
+|1916|Corvette C7 '14 |7 |
+|1925|G.T.350 '65 |36 |
+|1926|Cobra Daytona Coupe '64 |36 |
+|1927|Sport quattro S1 Pikes Peak '87 |5 |
+|1931|250 GT Berlinetta passo corto '61 |110 |
+|1932|1500 Biposto Bertone B.A.T 1 '52 |125 |
+|1933|MiTo '09 |3 |
+|1935|GT40 Mark I '66 |13 |
+|1956|Viper GTS '13 |11 |
+|1965|R18 TDI '11 |5 |
+|1973|Abarth 500 '09 |125 |
+|1975|RX500 '70 |21 |
+|1984|McLaren F1 GTR - BMW '95 |117 |
+|1985|Firebird Trans Am '78 |52 |
+|1986|R8 Gordini '66 |34 |
+|1987|Megane R.S. Trophy '11 |34 |
+|1990|Diablo GT '00 |112 |
+|2010|250 GTO '62 |110 |
+|2011|500 Mondial Pinin Farina Coupe '54 |110 |
+|2017|GTO '84 |110 |
+|2018|365 GTB4 '71 |110 |
+|2026|Aqua S '11 |43 |
+|2049|Veyron 16.4 '13 |113 |
+|2050|Huayra '13 |30 |
+|2051|Genesis Coupe 3.8 '13 |16 |
+|2055|Mercedes-Benz AMG VGT |153 |
+|2059|Corvette Stingray Racer Concept '59 |7 |
+|2060|Racing Kart 125 Shifter |33 |
+|2074|M4 '14 |6 |
+|2076|Mercedes-Benz AMG VGT Racing Series |153 |
+|2077|Red Bull X2014 Standard |33 |
+|2078|Red Bull X2014 Junior |33 |
+|2080|FT-1 |43 |
+|2087|BMW VGT |6 |
+|2095|Concept XR-PHEV EVOLUTION VGT |25 |
+|2098|GTI Roadster VGT |46 |
+|2099|VIZIV GT VGT |38 |
+|2101|TS030 Hybrid '12 |43 |
+|2103|DP-100 VGT |4 |
+|2106|FT-1 VGT |43 |
+|2107|Chaparral 2X VGT |93 |
+|2108|SRT Tomahawk X VGT |11 |
+|2109|MINI Clubman VGT |51 |
+|2110|SRT Tomahawk GTS-R VGT |11 |
+|2111|SRT Tomahawk S VGT |11 |
+|2112|Alpine VGT |86 |
+|2113|PEUGEOT VGT |32 |
+|2116|Alpine VGT Race |86 |
+|2117|INFINITI CONCEPT VGT |49 |
+|2118|LM55 VGT |21 |
+|2119|Italdesign VGT Street Mode |135 |
+|2120|Italdesign VGT Off-road Mode |135 |
+|2121|Honda Sports VGT |15 |
+|2122|IsoRivolta Zagato VGT |134 |
+|2123|LF-LC GT VGT |50 |
+|2124|GTI Supersport VGT |46 |
+|2127|GT-R LM NISMO '15 |28 |
+|2131|V12 Vantage GT3 '12 |4 |
+|2134|Bugatti VGT |113 |
+|2135|HYUNDAI N 2025 VGT |16 |
+|2136|4C '14 |3 |
+|2138|Mustang GT '15 |13 |
+|2139|RC F '14 |50 |
+|2141|Golf VII GTI '14 |46 |
+|2142|NISSAN CONCEPT 2020 VGT |28 |
+|2143|R8 LMS '15 |5 |
+|2144|S-FR '15 |43 |
+|2145|Focus ST '15 |13 |
+|2146|F-type R '14 |17 |
+|2147|Veneno '14 |112 |
+|2148|Roadster S (ND) '15 |21 |
+|2149|Mercedes-AMG GT S '15 |153 |
+|2150|Lancer Evolution Final '15 |25 |
+|2152|Charger SRT Hellcat '15 |11 |
+|2153|WRX STI Type S '14 |38 |
+|2154|86 GT '15 |43 |
+|2155|Polo GTI '14 |46 |
+|2156|2&4 powered by RC213V |15 |
+|2157|V8 Vantage Gr.4 |4 |
+|2158|458 Italia GT3 '13 |110 |
+|2159|Mustang Gr.3 |13 |
+|2160|Genesis Gr.3 |16 |
+|2161|GT-R Gr.4 |28 |
+|2162|LaFerrari '13 |110 |
+|2163|Genesis Gr.4 |16 |
+|2164|Mustang Gr.4 |13 |
+|2166|4C Gr.4 |3 |
+|2167|GT-R '17 |28 |
+|2169|TTS Coupe '14 |5 |
+|2170|A 45 AMG '13 |153 |
+|2171|Huracan LP 610-4 '15 |112 |
+|2172|DS 3 Racing '11 |154 |
+|2173|Atenza Sedan XD L Package '15 |21 |
+|2174|650S '14 |117 |
+|2175|V8 Vantage S '15 |4 |
+|2176|RCZ GT Line '15 |32 |
+|2177|Huracan GT3 '15 |112 |
+|2178|S-FR Racing Concept '16 |43 |
+|2179|Bugatti VGT (Gr.1) |113 |
+|2180|HYUNDAI N 2025 VGT (Gr.1) |16 |
+|2181|LM55 VGT (Gr.1) |21 |
+|2182|650S GT3 '15 |117 |
+|2183|Corvette C7 Gr.3 |7 |
+|2184|F-type Gr.3 |17 |
+|2185|Lancer Evolution Final Gr.3 |25 |
+|2186|WRX Gr.3 |38 |
+|2187|FT-1 VGT (Gr.3) |43 |
+|2188|R.S.01 GT3 '16 |34 |
+|2190|GT by Citroen Race Car (Gr.3) |9 |
+|2192|Volkswagen GTI VGT (Gr.3) |46 |
+|3183|PEUGEOT VGT (Gr.3) |32 |
+|3185|4C Gr.3 |3 |
+|3187|Alpine VGT '17 |86 |
+|3188|SRT Tomahawk VGT (Gr.1) |11 |
+|3192|SLS AMG Gr.4 |153 |
+|3209|M4 Safety Car |6 |
+|3210|Mercedes-AMG GT Safety Car |153 |
+|3214|Civic Type R (FK2) '15 |15 |
+|3215|208 GTi by Peugeot Sport '14 |32 |
+|3216|R.S.01 '16 |34 |
+|3217|Camaro SS '16 |7 |
+|3218|M6 GT3 Endurance Model '16 |6 |
+|3219|NSX '17 |15 |
+|3220|Clio R.S. 220 Trophy '15 |34 |
+|3221|M6 GT3 Sprint Model '16 |6 |
+|3222|86 GRMN '16 |43 |
+|3223|Viper SRT GT3-R '15 |11 |
+|3224|Mercedes-AMG GT3 '16 |153 |
+|3225|GT-R Safety Car |28 |
+|3227|LC500 '17 |50 |
+|3228|RC F GT3 prototype '16 |50 |
+|3229|Mustang Gr.B Rally Car |13 |
+|3230|Lancer Evolution Final Gr.B Rally Car |25 |
+|3231|Scirocco Gr.4 |46 |
+|3232|WRX Gr.B Rally Car |38 |
+|3234|Genesis Gr.B Rally Car |16 |
+|3235|NSX Gr.3 |15 |
+|3237|Atenza Gr.3 |21 |
+|3238|RCZ Gr.3 |32 |
+|3239|NSX Gr.B Rally Car |15 |
+|3241|GT-R Gr.B Rally Car |28 |
+|3242|RCZ Gr.B Rally Car |32 |
+|3245|M4 Gr.4 |6 |
+|3246|Veyron Gr.4 |113 |
+|3247|Corvette C7 Gr.4 |7 |
+|3248|GT by Citroen Gr.4 |9 |
+|3249|Viper Gr.4 |11 |
+|3251|NSX Gr.4 |15 |
+|3252|F-type Gr.4 |17 |
+|3253|Huracan Gr.4 |112 |
+|3254|RC F Gr.4 |50 |
+|3256|Atenza Gr.4 |21 |
+|3257|650S Gr.4 |117 |
+|3258|Lancer Evolution Final Gr.4 |25 |
+|3259|RCZ Gr.4 |32 |
+|3260|Megane Gr.4 |34 |
+|3261|WRX Gr.4 |38 |
+|3262|86 Gr.4 |43 |
+|3263|458 Italia Gr.4 |110 |
+|3264|Focus Gr.B Rally Car |13 |
+|3265|86 Gr.B Rally Car |43 |
+|3266|i3 '15 |6 |
+|3267|F12berlinetta '12 |110 |
+|3268|911 GT3 RS (991) '16 |136 |
+|3295|86 GT 'Limited' '16 |43 |
+|3296|Corvette C7 Gr.3 Road Car |7 |
+|3297|WRX STI Isle of Man '16 |38 |
+|3298|TT Cup '16 |5 |
+|3299|4C Gr.3 Road Car |3 |
+|3300|Mustang Gr.3 Road Car |13 |
+|3301|Lancer Evolution Final Gr.B Road Car |25 |
+|3303|RCZ Gr.3 Road Car |32 |
+|3304|WRX Gr.B Road Car |38 |
+|3305|Beetle Gr.3 |46 |
+|3306|Atenza Gr.3 Road Car |21 |
+|3309|Vulcan '16 |4 |
+|3310|Cayman GT4 Clubsport '16 |136 |
+|3311|911 RSR (991) '17 |136 |
+|3312|TS050 - Hybrid '16 |43 |
+|3313|919 Hybrid '16 |136 |
+|3314|Audi VGT |5 |
+|3315|McLaren VGT |117 |
+|3316|COPEN RJ VGT |10 |
+|3332|L500R HYbrid VGT 2017 |32 |
+|3333|L750R HYbrid VGT 2017 |32 |
+|3334|R18 '16 |5 |
+|3335|McLaren VGT (Gr.1) |117 |
+|3336|F-150 SVT Raptor '11 |13 |
+|3337|A110 '17 |86 |
+|3338|CHC 1967 Chevy Nova |147 |
+|3339|BRZ Drift Car '17 |38 |
+|3340|RC F GT3 '17 |50 |
+|3341|Pantera '71 |140 |
+|3342|F1500T-A |33 |
+|3343|DB11 '16 |4 |
+|3344|M3 Sport Evolution '89 |6 |
+|3345|GT-R NISMO '17 |28 |
+|3346|Mach Forty |148 |
+|3348|NSX CONCEPT-GT '16 |15 |
+|3349|RC F GT500 '16 |50 |
+|3350|GT-R NISMO GT500 '16 |28 |
+|3351|Audi e-tron VGT |5 |
+|3352|GR Supra Racing Concept '18 |43 |
+|3353|Clio R.S. 220 Trophy '16 |34 |
+|3354|BRZ S '15 |38 |
+|3356|Mini-Cooper 'S' '65 |51 |
+|3357|S660 '15 |15 |
+|3358|911 GT3 (996) '01 |136 |
+|3359|911 GT3 (997) '09 |136 |
+|3360|McLaren P1 GTR '16 |117 |
+|3361|E-type Coupe '61 |17 |
+|3362|F50 '95 |110 |
+|3363|DB3S '53 |4 |
+|3364|Greddy Fugu Z |149 |
+|3365|356 A/1500 GS GT Carrera Speedster '56 |136 |
+|3367|GR Supra RZ '19 |43 |
+|3368|Tundra TRD Pro '19 |43 |
+|3369|SR3 SL '13 |141 |
+|3370|Fit Hybrid '14 |15 |
+|3371|SF19 Super Formula / Toyota '19 |143 |
+|3372|SF19 Super Formula / Honda '19 |143 |
+|3373|962 C '88 |136 |
+|3374|Red Bull X2019 Competition |33 |
+|3375|356 A/1500 GS Carrera '56 |136 |
+|3376|D-type '54 |17 |
+|3377|Super Bee '70 |11 |
+|3383|Demio XD Touring '15 |21 |
+|3384|GTO Twin Turbo '91 |25 |
+|3385|911 Turbo (930) '81 |136 |
+|3387|Camaro ZL1 1LE Package '18 |7 |
+|3388|300 SEL 6.8 AMG '71 |153 |
+|3389|M3 '03 |6 |
+|3390|Taycan Turbo S '19 |136 |
+|3391|Shelby GT350R '16 |13 |
+|3392|Aventador LP 750-4 SV '15 |112 |
+|3393|Carrera GT '04 |136 |
+|3394|DBR9 GT1 '10 |4 |
+|3396|Jaguar VGT Coupe |17 |
+|3397|CLK-LM '98 |22 |
+|3398|CTR3 '07 |35 |
+|3399|GR Supra Race Car '19 |43 |
+|3400|911 GT1 Strassenversion '97 |136 |
+|3401|Crown Athlete G '13 |43 |
+|3402|Ford GT '17 |13 |
+|3403|Golf I GTI '83 |46 |
+|3404|911 Carrera RS CS (993) '95 |136 |
+|3405|R8 LMS Evo '19 |5 |
+|3406|Charger SRT Hellcat Safety Car |11 |
+|3407|Megane R.S. Trophy Safety Car |34 |
+|3408|Crown Athlete G Safety Car |43 |
+|3409|Mono '16 |144 |
+|3410|917K '70 |136 |
+|3411|Giulia GTAm '20 |3 |
+|3412|R8 Coupé V10 plus '16 |5 |
+|3413|BRZ STI Sport '18 |38 |
+|3414|Lambo V12 VGT |112 |
+|3415|8C 2900B Touring Berlinetta '38 |3 |
+|3416|Mercedes-AMG GT R '17 |153 |
+|3417|Jaguar VGT SV |17 |
+|3418|GR Supra RZ '20 |43 |
+|3419|RX-VISION GT3 CONCEPT |21 |
+|3420|Focus RS '18 |13 |
+|3421|Merak SS '80 |116 |
+|3422|3.0 CSL '73 |6 |
+|3423|Wicked Fabrication GT 51 |150 |
+|3424|Lancer Evolution IX MR GSR '06 |25 |
+|3426|Roadster Shop Rampage |151 |
+|3427|RX-8 Spirit R '12 |21 |
+|3428|S Barker Tourer '29 |22 |
+|3429|Fairlady Z 432 '69 |28 |
+|3430|Willys MB '45 |146 |
+|3431|911 Carrera RS (964) '92 |136 |
+|3432|Impreza Sedan WRX STi '04 |38 |
+|3433|FXX K '14 |110 |
+|3434|Testarossa '91 |110 |
+|3436|Ford GT Race Car '18 |13 |
+|3437|Mangusta '69 |140 |
+|3438|Abarth 595 SS '70 |125 |
+|3439|911 Carrera RS (993) '95 |136 |
+|3441|300 SL (W194) '52 |22 |
+|3442|A112 Abarth '85 |57 |
+|3443|308 GTB '75 |110 |
+|3444|1932 Ford Roadster Hot Rod |13 |
+|3445|DB5 '64 |4 |
+|3446|Spyder type 550/1500RS '55 |136 |
+|3449|Corvette C7 ZR1 '19 |7 |
+|3450|GT-R NISMO GT3 '18 |28 |
+|3451|GR Yaris RZ 'High performance' '20 |43 |
+|3452|917 LIVING LEGEND |136 |
+|3453|M3 '89 |6 |
+|3454|3.0 CSL '71 |6 |
+|3456|Swift Sport '17 |39 |
+|3457|A220 Race Car '68 |86 |
+|3458|Mercedes-AMG C 63 S '15 |153 |
+|3459|918 Spyder '13 |136 |
+|3462|GTO 'The Judge' '69 |52 |
+|3464|Corvette (C1) '58 |7 |
+|3466|Sierra RS 500 Cosworth '87 |13 |
+|3467|Civic Type R Limited Edition (FK8) '20 |15 |
+|3468|RGT 4.2 '16 |35 |
+|3469|F8 Tributo '19 |110 |
+|3471|Celica GT-Four (ST205) '94 |43 |
+|3473|Chiron '16 |113 |
+|3474|BRZ GT300 '21 |38 |
+|3475|MP4/4 '88 |117 |
+|3476|Suzuki Vision Gran Turismo |39 |
+|3477|Silvia spec-R Aero (S15) Touring Car |28 |
+|3478|Porsche VGT |136 |
+|3479|Jaguar VGT Roadster |17 |
+|3480|Swift Sport Gr.4 |39 |
+|3481|GR86 RZ '21 |43 |
+|3483|M2 Competition '18 |6 |
+|3485|Mercedes-AMG GT Black Series '20 |153 |
+|3486|Challenger SRT Demon '18 |11 |
+|3487|Mustang Boss 429 '69 |13 |
+|3488|Cayman GT4 '16 |136 |
+|3489|A6GCS/53 Spyder '54 |116 |
+|3490|Carrera GTS (904) '64 |136 |
+|3493|Skyline Super Silhouette Group 5 '84 |28 |
+|3494|Alphard Executive Lounge '18 |43 |
+|3495|RX-VISION '15 |21 |
+|3499|GR010 HYBRID '21 |43 |
+|3500|G70 3.3T AWD Prestige Package '22 |152 |
+|3501|G70 GR4 |152 |
+|3502|Genesis X GR3 |152 |
+|3503|RX-VISION GT3 CONCEPT Stealth Model |21 |
+|3504|Z Performance '23 |28 |
+|3505|Mangusta (Christian Dior) |140 |
+|3506|BRZ S '21 |38 |
+|3507|Porsche VGT Spyder |136 |
+|3508|SUZUKI Vision Gran Turismo (Gr.3 Version) |39 |
+|3509|911 Carrera RS (901) '73 |136 |
+|3510|Ferrari Vision Gran Turismo |110 |
+|3511|ID.R '19 |46 |
+|3512|Roadster NR-A (ND) '22 |21 |
+|3513|Silvia K's Type S (S14) '94 |28 |
+|3514|DS 21 Pallas '70 |9 |
+|3515|GR010 HYBRID (Olympic Esports Series) '21 |43 |
+|3517|Red Bull X2019 25th Anniversary |33 |
+|3518|Corvette C8 Stingray '20 |7 |
+|3519|959 '87 |136 |
+|3520|400R '95 |155 |
+|3521|Mazda3 '19 |21 |
+|3522|Maverick |156 |
+|3523|RS 5 Turbo DTM '19 |5 |
+|3524|GT-R NISMO (R32) '90 |28 |
+|3525|RA272 '65 |15 |
+|3526|Civic |157 |
+|3528|SF23 Super Formula / Honda '23 |143 |
+|3529|SF23 Super Formula / Toyota '23 |143 |
+|3530|Giulia Sprint GT Veloce '67 |3 |
+|3531|GT3 '20 |153 |
+|3532|Valkyrie '21 |4 |
+|3533|MC20 '20 |116 |
+|3534|Ambulance Himedic '21 |43 |
+|3535|GR Corolla MORIZO Edition '22 |43 |
+|3536|Civic Type R (FL5) '22 |15 |
+|3537|MAZDA3 Gr.4 |21 |
+|3538|Charger R/T 426 Hemi '68 |11 |
+|3539|911 GT3 RS (992) '22 |136 |
+|3540|Model 3 Performance '23 |119 |
+|3541|BVLGARI Aluminium VGT |158 |
+|3542|SKODA Vision Gran Turismo |159 |
+|3543|Genesis X Gran Berlinetta VGT Concept |152 |
+|3544|Genesis X Gran Racer Vision Gran Turismo Concept|152 |
+|3545|Jimny XC '18 |39 |
+|3546|AFEELA Prototype 2024 |160 |
+|3547|R4 GTL '85 |34 |
+|3548|Urus '18 |112 |
+|3550|Impreza Rally Car '98 |38 |
+|3551|M3 '97 |6 |
+|3553|GT-R Premium edition T-spec '24 |28 |
+|3554|Hiace Van DX '16 |43 |
+
+## Credits
+
+Credit to [everard](https://github.com/everard/Salsa20) for the C++11 implementation of the stream cipher Salsa20.
+
+Credit to [Nenkai](https://github.com/Nenkai/PDTools) for help with IV setup and their work on GT7 UDP Capabilities.
+
+Credit to [ddm999](https://github.com/ddm999/gt7info) for CSV file of car and manufacturer IDs (I converted it into a markdown table).
+
+Credit to [vwhitteron](https://github.com/vwhitteron), [Chi-Ho](https://github.com/Chi-Ho), and [Beregoz](https://github.com/Beregoz) for their help in researching the [new](https://github.com/Nenkai/PDTools/issues/18) packet variant, Packet "C".
+
+Thanks to members of GTPlanet for their findings on this hidden gem in GT7, find the thread [here](https://www.gtplanet.net/forum/threads/gt7-is-compatible-with-motion-rig.410728/).
+
diff --git a/lib/GT7Udp/examples/packetBsimple/packetBsimple.ino b/lib/GT7Udp/examples/packetBsimple/packetBsimple.ino
new file mode 100644
index 0000000..5b7244b
--- /dev/null
+++ b/lib/GT7Udp/examples/packetBsimple/packetBsimple.ino
@@ -0,0 +1,66 @@
+//File: packetTildasimple.ino
+
+//#include "Wifi.h" // ESP32 WiFi include
+#include <ESP8266WiFi.h> // ESP8266 WiFi include
+#include <GT7UDPParser.h>
+
+const char *SSID = "Your WiFi SSID";
+const char *Password = "Your WiFi Password";
+const IPAddress ip(255, 255, 255, 255); // Insert your PS4/5 IP address here
+
+void startWiFi();
+
+unsigned long previousT = 0;
+const long interval = 500;
+
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+
+void setup()
+{
+ Serial.begin(115200);
+ startWiFi();
+ gt7Telem.begin(ip, 'B');
+ gt7Telem.sendHeartbeat();
+}
+
+void loop()
+{
+ unsigned long currentT = millis();
+ packetContent= gt7Telem.readData();
+
+ float wheelRot = (packetContent.packetContent.wheelRotation);
+
+ Serial.print("Wheel Rotation (rads): ");
+ Serial.println(wheelRot);
+
+ if (currentT - previousT >= interval)
+ { // Send heartbeat every 500ms
+ previousT = currentT;
+ gt7Telem.sendHeartbeat();
+ //Serial.println("Pckt sent");
+ }
+}
+
+void startWiFi()
+{
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(SSID, Password);
+ Serial.print("Attempting to connect to ");
+ Serial.println(SSID);
+
+ uint8_t i = 0;
+ while (WiFi.status() != WL_CONNECTED)
+ {
+ Serial.print('.');
+ delay(250);
+
+ if ((++i % 16) == 0)
+ {
+ Serial.println(F(" still trying to connect"));
+ }
+ }
+
+ Serial.print(F("Connection Successful | IP Address: "));
+ Serial.println(WiFi.localIP());
+}
diff --git a/lib/GT7Udp/examples/packetTildasimple/packetTildasimple.ino b/lib/GT7Udp/examples/packetTildasimple/packetTildasimple.ino
new file mode 100644
index 0000000..e989c9f
--- /dev/null
+++ b/lib/GT7Udp/examples/packetTildasimple/packetTildasimple.ino
@@ -0,0 +1,66 @@
+//File: packetBsimple.ino
+
+//#include "Wifi.h" // ESP32 WiFi include
+#include <ESP8266WiFi.h> // ESP8266 WiFi include
+#include <GT7UDPParser.h>
+
+const char *SSID = "Your WiFi SSID";
+const char *Password = "Your WiFi Password";
+const IPAddress ip(255, 255, 255, 255); // Insert your PS4/5 IP address here
+
+void startWiFi();
+
+unsigned long previousT = 0;
+const long interval = 500;
+
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+
+void setup()
+{
+ Serial.begin(115200);
+ startWiFi();
+ gt7Telem.begin(ip, '~');
+ gt7Telem.sendHeartbeat();
+}
+
+void loop()
+{
+ unsigned long currentT = millis();
+ packetContent= gt7Telem.readData();
+
+ float recovery = (packetContent.packetContent.energyRecovery);
+
+ Serial.print("Energy Recovery: ");
+ Serial.println(recovery);
+
+ if (currentT - previousT >= interval)
+ { // Send heartbeat every 500ms
+ previousT = currentT;
+ gt7Telem.sendHeartbeat();
+ //Serial.println("Pckt sent");
+ }
+}
+
+void startWiFi()
+{
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(SSID, Password);
+ Serial.print("Attempting to connect to ");
+ Serial.println(SSID);
+
+ uint8_t i = 0;
+ while (WiFi.status() != WL_CONNECTED)
+ {
+ Serial.print('.');
+ delay(250);
+
+ if ((++i % 16) == 0)
+ {
+ Serial.println(F(" still trying to connect"));
+ }
+ }
+
+ Serial.print(F("Connection Successful | IP Address: "));
+ Serial.println(WiFi.localIP());
+}
diff --git a/lib/GT7Udp/examples/simpleserialprint/simpleserialprint.ino b/lib/GT7Udp/examples/simpleserialprint/simpleserialprint.ino
new file mode 100644
index 0000000..78ef36f
--- /dev/null
+++ b/lib/GT7Udp/examples/simpleserialprint/simpleserialprint.ino
@@ -0,0 +1,66 @@
+//File: simpleserialprint.ino
+
+//#include "Wifi.h" // ESP32 WiFi include
+#include <ESP8266WiFi.h> // ESP8266 WiFi include
+#include <GT7UDPParser.h>
+
+const char *SSID = "Your WiFi SSID";
+const char *Password = "Your WiFi Password";
+const IPAddress ip(255, 255, 255, 255); // Insert your PS4/5 IP address here
+
+void startWiFi();
+
+unsigned long previousT = 0;
+const long interval = 500;
+
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+
+void setup()
+{
+ Serial.begin(115200);
+ startWiFi();
+ gt7Telem.begin(ip); // Will default to Packet A with no secondary input, put "B" or "~" to access other packets
+ gt7Telem.sendHeartbeat();
+}
+
+void loop()
+{
+ unsigned long currentT = millis();
+ packetContent= gt7Telem.readData();
+
+ float speed = (packetContent.packetContent.speed) * 3.6; // Times by 3.6 to convert from m/s to km/h
+
+ Serial.print("Speed: ");
+ Serial.println(speed);
+
+ if (currentT - previousT >= interval)
+ { // Send heartbeat every 500ms
+ previousT = currentT;
+ gt7Telem.sendHeartbeat();
+ //Serial.println("Pckt sent");
+ }
+}
+
+void startWiFi()
+{
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(SSID, Password);
+ Serial.print("Attempting to connect to ");
+ Serial.println(SSID);
+
+ uint8_t i = 0;
+ while (WiFi.status() != WL_CONNECTED)
+ {
+ Serial.print('.');
+ delay(250);
+
+ if ((++i % 16) == 0)
+ {
+ Serial.println(F(" still trying to connect"));
+ }
+ }
+
+ Serial.print(F("Connection Successful | IP Address: "));
+ Serial.println(WiFi.localIP());
+}
diff --git a/lib/GT7Udp/examples/simulatorflags/simulatorflags.ino b/lib/GT7Udp/examples/simulatorflags/simulatorflags.ino
new file mode 100644
index 0000000..10f749c
--- /dev/null
+++ b/lib/GT7Udp/examples/simulatorflags/simulatorflags.ino
@@ -0,0 +1,69 @@
+//File: simulatorflags.ino
+
+//#include "Wifi.h" // ESP32 WiFi include
+#include <ESP8266WiFi.h> // ESP8266 WiFi include
+#include <GT7UDPParser.h>
+
+const char *SSID = "Your WiFi SSID";
+const char *Password = "Your WiFi Password";
+const IPAddress ip(255, 255, 255, 255); // Enter your Playstations IP here
+
+void startWiFi();
+
+unsigned long previousT = 0;
+const long interval = 500;
+
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+
+void setup()
+{
+ Serial.begin(115200);
+ startWiFi();
+ gt7Telem.begin(ip);
+ gt7Telem.sendHeartbeat();
+}
+
+void loop()
+{
+ unsigned long currentT = millis();
+ packetContent = gt7Telem.readData();
+
+ for (int i = 0; i < 13; ++i)
+ {
+ uint8_t flag = gt7Telem.getFlag(i);
+ Serial.print("Flag ");
+ Serial.print(i);
+ Serial.print(": ");
+ Serial.println(flag);
+ }
+
+ if (currentT - previousT >= interval)
+ {
+ previousT = currentT;
+ gt7Telem.sendHeartbeat();
+ }
+ }
+
+void startWiFi()
+{
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(SSID, Password);
+ Serial.print("Attempting to connect to ");
+ Serial.println(SSID);
+
+ uint8_t i = 0;
+ while (WiFi.status() != WL_CONNECTED)
+ {
+ Serial.print('.');
+ delay(250);
+
+ if ((++i % 16) == 0)
+ {
+ Serial.println(F(" still trying to connect"));
+ }
+ }
+
+ Serial.print(F("Connection Successful | IP Address: "));
+ Serial.println(WiFi.localIP());
+}
diff --git a/lib/GT7Udp/examples/startlightsexploit/startlightsexploit.ino b/lib/GT7Udp/examples/startlightsexploit/startlightsexploit.ino
new file mode 100644
index 0000000..a4c04bc
--- /dev/null
+++ b/lib/GT7Udp/examples/startlightsexploit/startlightsexploit.ino
@@ -0,0 +1,81 @@
+//File: startlightsexploit.ino
+
+// This sketch utilises the dayProgression data point to find the exact moment of lights out, as the day time progression does not begin until after lights out in rolling starts, grid start and grid start with false check.
+// The ESP32/ESP8266 can be connected to a servo motor that pushes the button mapped to the handbrake to let go at the exact time of lights out, giving the user an almost instant start with a quick servo
+// You should begin running the script once the practice/qualifying ends and terminate it once you begin the race, I may make this automatic in a future update
+
+// NOTE: I do not condone the use of this sketch outside of testing/private lobbies. Any penalties or reprimands received due to this exploit in public lobbies or sport mode solely lies on the user of the script.
+
+//#include "Wifi.h" // ESP32 WiFi include
+#include <ESP8266WiFi.h> // ESP8266 WiFi include
+#include <GT7UDPParser.h>
+#include <Servo.h>
+
+const char *SSID = "Your WiFi SSID";
+const char *Password = "Your WiFi Password";
+const IPAddress ip(255, 255, 255, 255); // Insert your PS4/5 IP address here
+
+Servo servo;
+
+void startWiFi();
+
+unsigned long previousT = 0;
+const long interval = 500;
+int32_t prevDay;
+
+GT7_UDP_Parser gt7Telem;
+Packet packetContent;
+
+void setup()
+{
+ Serial.begin(115200);
+ startWiFi();
+ gt7Telem.begin(ip);
+ gt7Telem.sendHeartbeat();
+ servo.attach(2); // gpio pin 2 (D4)
+ servo.write(180);
+}
+
+void loop()
+{
+ unsigned long currentT = millis() / 10;
+ packetContent = gt7Telem.readData();
+
+ if (prevDay != packetContent.packetContent.dayProgression && packetContent.packetContent.dayProgression != 0 && prevDay != 0) {
+ servo.write(0);
+ Serial.println("Lights Out!");
+ }
+
+ if (currentT - previousT >= interval)
+ { // Send heartbeat every 500ms
+ previousT = currentT;
+ gt7Telem.sendHeartbeat();
+ //Serial.println("Pckt sent");
+ }
+
+ prevDay = packetContent.packetContent.dayProgression;
+
+}
+
+void startWiFi()
+{
+ WiFi.mode(WIFI_STA);
+ WiFi.begin(SSID, Password);
+ Serial.print("Attempting to connect to ");
+ Serial.println(SSID);
+
+ uint8_t i = 0;
+ while (WiFi.status() != WL_CONNECTED)
+ {
+ Serial.print('.');
+ delay(250);
+
+ if ((++i % 16) == 0)
+ {
+ Serial.println(F(" still trying to connect"));
+ }
+ }
+
+ Serial.print(F("Connection Successful | IP Address: "));
+ Serial.println(WiFi.localIP());
+}
diff --git a/lib/GT7Udp/library.properties b/lib/GT7Udp/library.properties
new file mode 100644
index 0000000..5fb1a29
--- /dev/null
+++ b/lib/GT7Udp/library.properties
@@ -0,0 +1,10 @@
+name=GT7 UDP Telemetry Parser
+version=2.1.1
+author=MacManley
+maintainer=MacManley
+sentence=UDP Telemetry Parser for Gran Turismo 7
+paragraph=UDP Telemetry Parser for Gran Turismo 7
+category=Communication
+depends=WiFiUDP
+url=https://github.com/MacManley/gt7-udp
+architectures=*
diff --git a/lib/GT7Udp/src/GT7UDPParser.cpp b/lib/GT7Udp/src/GT7UDPParser.cpp
new file mode 100644
index 0000000..663f028
--- /dev/null
+++ b/lib/GT7Udp/src/GT7UDPParser.cpp
@@ -0,0 +1,175 @@
+#include <WiFiUdp.h>
+#include "GT7UDPParser.h"
+#include "Salsa20.h"
+#include <string>
+#include <array>
+
+constexpr unsigned int localPort = 33740;
+constexpr unsigned int remotePort = 33739;
+constexpr int PACKET_A_SIZE = 296;
+constexpr int PACKET_B_SIZE = 316;
+constexpr int PACKET_TILDA_SIZE = 344;
+constexpr int PACKET_C_SIZE = 368;
+const std::string Key = "Simulator Interface Packet GT7 ver 0.0";
+
+
+union IntToBytes {
+ uint32_t integer;
+ uint8_t bytes[4];
+};
+
+std::array<uint8_t, 32> GT7_UDP_Parser::getAsciiBytes(const std::string& inputString) {
+ std::array<uint8_t, 32> asciiBytes = {};
+ for (size_t i = 0; i < inputString.size() && i < asciiBytes.size(); ++i) {
+ asciiBytes[i] = static_cast<uint8_t>(inputString[i]);
+ }
+ return asciiBytes;
+}
+
+void GT7_UDP_Parser::begin(const IPAddress playstationIP, const char packetVersion) {
+ Udp.begin(localPort);
+ remoteIP = playstationIP;
+ if ((packetVersion == 'A') || (packetVersion == 'B') || (packetVersion == '~') || (packetVersion == 'C')) {
+ heartbeatMsg = packetVersion;
+ } else {
+ heartbeatMsg = 'A';
+ }
+ dKey = getAsciiBytes(Key);
+}
+
+void GT7_UDP_Parser::sendHeartbeat(void) {
+ Udp.beginPacket(remoteIP, remotePort);
+ Udp.write(heartbeatMsg);
+ Udp.endPacket();
+}
+
+uint8_t GT7_UDP_Parser::getCurrentGearFromByte(void) {
+ return packet.packetContent.gears & 0b00001111; // Extract the lower 4 bits for gears
+}
+
+// Function to extract suggested gear from the byte
+uint8_t GT7_UDP_Parser::getSuggestedGearFromByte(void) {
+ return packet.packetContent.gears >> 4; // Shift right by 4 bits to get the upper 4 bits for suggested gear
+}
+
+
+uint8_t GT7_UDP_Parser::getPowertrainType(void) {
+ if (static_cast<uint8_t>(packet.packetContent.fuelCapacity) > 10) {
+ return 0;
+ } else {
+ switch(static_cast<uint8_t>(packet.packetContent.fuelCapacity)) {
+ case 0: return 1;
+ break;
+ case 5: return 2;
+ break;
+ default: return 255;
+ }
+ }
+}
+
+float GT7_UDP_Parser::getTyreSpeed(int index) {
+ if (index >= 0 && index < 4) {
+ return abs(3.6f * packet.packetContent.tyreRadius[index] * packet.packetContent.wheelRPS[index]);
+ } else return 0.0f;
+}
+
+float GT7_UDP_Parser::getTyreSlipRatio(int index) {
+ float carSpeed = (packet.packetContent.speed * 3.6);
+ float tyreSpeed = getTyreSpeed(index);
+ if (carSpeed != 0.0f) {
+ return tyreSpeed / carSpeed;
+ } else return 0.0f;
+}
+
+uint8_t GT7_UDP_Parser::getFlag(int index) {
+ SimulatorFlags flags = packet.packetContent.flags;
+ if (index < 0 || index > 12) {
+ return 0;
+ }
+
+ if (index == 0) {
+ return (static_cast<int16_t>(flags) == 0) ? 1 : 0;
+ } else {
+ return (static_cast<int16_t>(flags) & (1 << (index - 1))) ? 1 : 0;
+ }
+}
+
+Packet GT7_UDP_Parser::readData() {
+
+
+
+
+ uint8_t recvBuffer[sizeof(packet.packetContent)] = {};
+ const int packetSize = Udp.parsePacket();
+ // 沒有收到 UDP 封包,不要繼續讀取或解密
+ if (packetSize <= 0)
+ {
+ return packet;
+ }
+ // 避免超過接收 buffer
+ if (packetSize > static_cast<int>(sizeof(recvBuffer)))
+ {
+ // 丟棄過大的封包
+ while (Udp.available())
+ {
+ Udp.read();
+ }
+
+ return packet;
+ }
+
+ const int byteStream = Udp.read(
+ recvBuffer,
+ sizeof(recvBuffer)
+ );
+
+ // UDP read 失敗或沒有實際資料
+ if (byteStream <= 0)
+ {
+ return packet;
+ }
+
+ if (byteStream == PACKET_A_SIZE) {
+ detectedPacketVersion = 'A';
+ } else if (byteStream == PACKET_B_SIZE) {
+ detectedPacketVersion = 'B';
+ } else if (byteStream == PACKET_TILDA_SIZE) {
+ detectedPacketVersion = '~';
+ } else if (byteStream == PACKET_C_SIZE) {
+ detectedPacketVersion = 'C';
+ } else {
+ detectedPacketVersion = ' ';
+ }
+
+ int iv1 = *reinterpret_cast<int*>(&recvBuffer[0x40]); // Seed IV is always located there
+
+ switch (detectedPacketVersion) {
+ case 'A': iv2 = iv1 ^ 0xDEADBEAF;
+ break;
+ case 'B': iv2 = iv1 ^ 0xDEADBEEF;
+ break;
+ case '~': iv2 = iv1 ^ 0x55FABB4F;
+ break;
+ case 'C': iv2 = iv1 ^ 0xDEADBEEF;
+ break;
+ default: iv2 = iv1;
+ break;
+ }
+
+ IntToBytes iv1Bytes, iv2Bytes;
+ iv1Bytes.integer = iv1;
+ iv2Bytes.integer = iv2;
+
+ uint8_t iv[8] = {
+ iv2Bytes.bytes[0], iv2Bytes.bytes[1], iv2Bytes.bytes[2], iv2Bytes.bytes[3],
+ iv1Bytes.bytes[0], iv1Bytes.bytes[1], iv1Bytes.bytes[2], iv1Bytes.bytes[3]
+ };
+
+ ucstk::Salsa20 salsa20(dKey.data());
+ salsa20.setIv(iv);
+
+ std::array<uint8_t, sizeof(packet.packetContent)> decryptedData;
+ salsa20.processBytes((recvBuffer), decryptedData.data(), byteStream);
+ memcpy(&packet.packetContent, decryptedData.data(), byteStream);
+ return packet;
+ }
diff --git a/lib/GT7Udp/src/GT7UDPParser.h b/lib/GT7Udp/src/GT7UDPParser.h
new file mode 100644
index 0000000..2fd92f8
--- /dev/null
+++ b/lib/GT7Udp/src/GT7UDPParser.h
@@ -0,0 +1,141 @@
+#ifndef GT7UDPPARSER_H
+#define GT7UDPPARSER_H
+
+#include <inttypes.h>
+#include <WiFiUdp.h>
+#include <array>
+#include <string>
+
+#pragma pack(push, 1)
+
+enum class SimulatorFlags : int16_t {
+ None = 0,
+
+ CarOnTrack = 1 << 0,
+
+ Paused = 1 << 1,
+
+ LoadingOrProcessing = 1 << 2,
+
+ InGear = 1 << 3,
+
+ HasTurbo = 1 << 4,
+
+ RevLimiterBlinkAlertActive = 1 << 5,
+
+ HandBrakeActive = 1 << 6,
+
+ LightsActive = 1 << 7,
+
+ HighBeamActive = 1 << 8,
+
+ LowBeamActive = 1 << 9,
+
+ ASMActive = 1 << 10,
+
+ TCSActive = 1 << 11
+};
+
+struct PacketA {
+ int32_t magic; // Magic, different value defines what game is being played
+ float position[3]; // Position on Track in meters in each axis
+ float worldVelocity[3]; // Velocity in meters for each axis
+ float rotation[3]; // Rotation (Pitch/Yaw/Roll) (RANGE: -1 -> 1)
+ float orientationRelativeToNorth; // Orientation to North (RANGE: 1.0 (North) -> 0.0 (South))
+ float angularVelocity[3]; // Speed at which the car turns around axis in rad/s (RANGE: -1 -> 1)
+ float bodyHeight; // Body height
+ float EngineRPM; // Engine revolutions per minute
+ uint8_t iv[4]; // IV for Salsa20 encryption/decryption
+ float fuelLevel; // Fuel level of car in liters
+ float fuelCapacity; // Max fuel capacity for current car (RANGE: 100 (most cars) -> 5 (karts) -> 0 (electric cars))
+ float speed; // Speed in m/s
+ float boost; // Offset by +1 (EXAMPLE: 1.0 = 0 X 100kPa, 2.0 = 1 x 100kPa) // TODO apply -1 offset
+ float oilPressure; // Oil pressure in bars
+ float waterTemp; // Constantly 85
+ float oilTemp; // Constantly 110
+ float tyreTemp[4]; // Tyre temp for all 4 tires (FL -> FR -> RL -> RR)
+ int32_t packetId; // ID of packet
+ int16_t lapCount; // Lap count
+ int16_t totalLaps; // Laps to finish
+ int32_t bestLaptime; // Best lap time, defaults to -1 if not set
+ int32_t lastLaptime; // Previous lap time, defaults to -1 if not set
+ int32_t dayProgression; // Current time of day on track in ms
+ int16_t RaceStartPosition; // Position of the car before the start of the race, defaults to -1 after race start
+ int16_t preRaceNumCars; // Number of cars before the race start, defaults to -1 after start of the race
+ int16_t minAlertRPM; // Minimum RPM that the rev limiter displays an alert
+ int16_t maxAlertRPM; // Maximum RPM that the rev limiter displays an alert
+ int16_t calcMaxSpeed; // Highest possible speed achievable of the current transmission settings
+ SimulatorFlags flags; // Packet flags // TODO: Get working
+ uint8_t gears; // First 4 bits: Current Gear, Last 4 bits: Suggested Gear, see getCurrentGearFromByte and getSuggestedGearFromByte
+ uint8_t throttle; // Throttle (RANGE: 0 -> 255)
+ uint8_t brake; // Brake (RANGE: 0 -> 255)
+ uint8_t PADDING; // Padding byte
+ float roadPlane[3]; // Banking of the road
+ float roadPlaneDistance; // Distance above or below the plane, e.g a dip in the road is negative, hill is positive.
+ float wheelRPS[4]; // Revolutions per second of tyres in rads
+ float tyreRadius[4]; // Radius of the tyre in meters
+ float suspHeight[4]; // Suspension height of the car
+ float UNKNOWNFLOATS[8]; // Unknown float
+ float clutch; // Clutch (RANGE: 0.0 -> 1.0)
+ float clutchEngagement; // Clutch Engangement (RANGE: 0.0 -> 1.0)
+ float RPMFromClutchToGearbox; // Pretty much same as engine RPM, is 0 when clutch is depressed
+ float transmissionTopSpeed; // Top speed as gear ratio value
+ float gearRatios[8]; // Gear ratios of the car up to 8
+ int32_t carCode; // This value may be overriden if using a car with more then 9 gears
+};
+
+struct PacketB : public PacketA {
+ float wheelRotation; // Calculates the wheel rotation in radians
+ float steeringAngularVelocity; // Angular velocity of the steering wheel in rad/s
+ float sway; // X axis acceleration
+ float heave; // Y axis acceleration
+ float surge; // Z axis acceleration
+};
+
+struct PacketTilda : public PacketB {
+ uint8_t throttleFiltered; // Filtered Throttle Output
+ uint8_t brakeFiltered; // Filtered Brake Output
+ uint8_t UNKNOWNUINT81; // Unknown unsigned 8 bit integer
+ uint8_t UNKNOWNUINT82; // Unknown unsigned 8 bit integer
+ float torqueVectors[4]; // Torque vectoring for certain cars - Positive = driving force - Negative = braking or regenerating
+ float energyRecovery; // Energy being recovered to the battery
+ float UNKNOWNFLOAT11; // Unknown float
+};
+
+struct PacketC : public PacketTilda {
+ char surfaceType[4]; // The kind of surface in contact with the tyres (T: tarmac, C: curb/kerb D: Dirt/Grass)
+ int32_t currentLap; // The current lap being set in milliseconds
+ float wheelSteeringAngle[2]; // Steering angle of the front wheels in radians (left to right)
+ float wheelBase; // Distance between the front and rear axles in meters (front left of the car to rear left of the car)
+ char carCategory[4]; // Null terminated string of car category (GR3, GRX etc.)
+};
+
+struct Packet {
+ PacketC packetContent;
+};
+
+class GT7_UDP_Parser {
+ public:
+ void begin(const IPAddress playstationIP, const char packetVersion = 'A');
+ void sendHeartbeat();
+ uint8_t getFlag(int index);
+ uint8_t getCurrentGearFromByte(void);
+ uint8_t getSuggestedGearFromByte(void);
+ uint8_t getPowertrainType(void);
+ float getTyreSpeed(int index);
+ float getTyreSlipRatio(int index);
+ Packet readData();
+ private:
+ WiFiUDP Udp;
+ IPAddress remoteIP;
+ Packet packet;
+ int iv2;
+ char detectedPacketVersion;
+ char heartbeatMsg;
+ std::array<uint8_t, 32> dKey;
+ std::array<uint8_t, 32> getAsciiBytes(const std::string& inputString);
+};
+
+#pragma pack(pop)
+
+#endif
diff --git a/lib/GT7Udp/src/Main.cpp b/lib/GT7Udp/src/Main.cpp
new file mode 100644
index 0000000..ed87ce3
--- /dev/null
+++ b/lib/GT7Udp/src/Main.cpp
@@ -0,0 +1,267 @@
+/*
+Copyright (c) 2014 Nezametdinov E. Ildus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+#include "Salsa20.h"
+
+#include <iostream>
+#include <cstdlib>
+#include <fstream>
+#include <string>
+
+using namespace ucstk;
+
+/**
+ * Represents program.
+ */
+class Program
+{
+public:
+ Program(): inputFileName_(), outputFileName_(), shouldShowHelp_(false)
+ {
+ std::memset(key_, 0, sizeof(key_));
+ }
+ Program(const Program&) = delete;
+ Program(Program&&) = delete;
+ ~Program() {}
+ Program& operator =(const Program&) = delete;
+ Program& operator =(Program&&) = delete;
+
+ /**
+ * \brief Reads parameters from command line and validates them.
+ * \param[in] argc number of command line arguments passed
+ * \param[in] argv array of command line arguments
+ * \return true on success
+ */
+ bool initialize(int argc, char* argv[])
+ {
+ std::string key;
+ shouldShowHelp_ = false;
+
+ for(int i = 0; i < argc; ++i)
+ {
+ std::string parameter = argv[i];
+
+ if(parameter == "-p")
+ {
+ if((argc - i - 1) != 3)
+ break;
+
+ inputFileName_ = argv[++i];
+ outputFileName_ = argv[++i];
+ key = argv[++i];
+ break;
+ }
+
+ if(parameter == "-h")
+ {
+ shouldShowHelp_ = true;
+ return true;
+ }
+ }
+
+ if(inputFileName_.empty())
+ {
+ std::cout << "E: Input file name was not specified." << std::endl;
+ return false;
+ }
+
+ if(outputFileName_.empty())
+ {
+ std::cout << "E: Output file name was not specified." << std::endl;
+ return false;
+ }
+
+ if(inputFileName_ == outputFileName_)
+ {
+ std::cout << "E: Input and output files should be distinct." << std::endl;
+ return false;
+ }
+
+ if(key.empty())
+ {
+ std::cout << "E: Key was not specified." << std::endl;
+ return false;
+ }
+
+ if(!readKeyFromString(key))
+ {
+ std::cout << "E: Invalid key value." << std::endl;
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * \brief Encrypts or decrypts the file.
+ * \return true on success
+ */
+ bool execute()
+ {
+ if(shouldShowHelp_)
+ {
+ std::cout << "Usage: salsa20 -p INPUT OUTPUT KEY" << std::endl;
+ std::cout << " salsa20 -h" << std::endl;
+ std::cout << std::endl << "Salsa20 is a stream cypher (see http://cr.yp.to/snuffle.html).";
+ std::cout << std::endl << std::endl;
+ std::cout << "Options:" << std::endl;
+ std::cout << " -h Shows this help text." << std::endl;
+ std::cout << " -p Encrypts or decrypts file INPUT with KEY and outputs result to file OUTPUT.";
+ std::cout << std::endl;
+ std::cout << " KEY is a 32-byte key concatenated with 8-byte IV written in HEX.";
+ std::cout << std::endl;
+ return true;
+ }
+
+ std::ifstream inputStream(inputFileName_, std::ios_base::binary);
+ if(!inputStream)
+ {
+ std::cout << "E: Could not open input file." << std::endl;
+ return false;
+ }
+
+ std::ofstream outputStream(outputFileName_, std::ios_base::binary);
+ if(!outputStream)
+ {
+ std::cout << "E: Could not create output file." << std::endl;
+ return false;
+ }
+
+ const auto chunkSize = NUM_OF_BLOCKS_PER_CHUNK * Salsa20::BLOCK_SIZE;
+ uint8_t chunk[chunkSize];
+
+ // determine size of the file
+ inputStream.seekg(0, std::ios_base::end);
+ auto fileSize = inputStream.tellg();
+ inputStream.seekg(0, std::ios_base::beg);
+
+ // compute number of chunks and size of the remainder
+ auto numChunks = fileSize / chunkSize;
+ auto remainderSize = fileSize % chunkSize;
+
+ // process file
+ Salsa20 salsa20(key_);
+ salsa20.setIv(&key_[IV_OFFSET]);
+ std::cout << "Processing file \"" << inputFileName_ << '"' << std::endl;
+
+ for(decltype(numChunks) i = 0; i < numChunks; ++i)
+ {
+ inputStream.read(reinterpret_cast<char*>(chunk), sizeof(chunk));
+ salsa20.processBlocks(chunk, chunk, NUM_OF_BLOCKS_PER_CHUNK);
+ outputStream.write(reinterpret_cast<const char*>(chunk), sizeof(chunk));
+
+ float percentage = 100.0f * static_cast<float>(i + 1) / static_cast<float>(numChunks);
+ std::printf("[%3.2f]\r", percentage);
+ }
+
+ if(remainderSize != 0)
+ {
+ inputStream.read(reinterpret_cast<char*>(chunk), remainderSize);
+ salsa20.processBytes(chunk, chunk, remainderSize);
+ outputStream.write(reinterpret_cast<const char*>(chunk), remainderSize);
+ std::cout << "[100.00]";
+ }
+
+ std::cout << std::endl << "OK" << std::endl;
+ return true;
+ }
+
+private:
+ /// Helper constants
+ enum: size_t
+ {
+ NUM_OF_BLOCKS_PER_CHUNK = 8192,
+ IV_OFFSET = Salsa20::KEY_SIZE,
+ KEY_SIZE = Salsa20::KEY_SIZE + Salsa20::IV_SIZE
+ };
+
+ /**
+ * \brief Reads byte from string.
+ * \param[in] string string
+ * \param[out] byte byte
+ * \return true on success
+ */
+ bool readByte(const char* string, uint8_t& byte)
+ {
+ byte = 0;
+
+ for(uint32_t i = 0; i < 2; ++i)
+ {
+ uint8_t value = 0;
+ char c = string[i];
+
+ if(c >= '0' && c <= '9')
+ value = c - '0';
+ else if(c >= 'A' && c <= 'F')
+ value = c - 'A' + 0x0A;
+ else if(c >= 'a' && c <= 'f')
+ value = c - 'a' + 0x0A;
+ else
+ return false;
+
+ byte |= (value << (4 - i * 4));
+ }
+
+ return true;
+ }
+
+ /**
+ * \brief Reads key from string.
+ * \param[in] string string
+ * \return true on success
+ */
+ bool readKeyFromString(const std::string& string)
+ {
+ auto stringLength = string.length();
+
+ if(stringLength != 2 * KEY_SIZE)
+ return false;
+
+ for(decltype(stringLength) i = 0; i < stringLength; i += 2)
+ {
+ if(!readByte(&string[i], key_[i / 2]))
+ return false;
+ }
+
+ return true;
+ }
+
+ // Data members
+ std::string inputFileName_, outputFileName_;
+ uint8_t key_[KEY_SIZE];
+ bool shouldShowHelp_;
+
+};
+
+// Entry point
+int main(int argc, char* argv[])
+{
+ Program program;
+
+ if(!program.initialize(argc, argv))
+ return 1;
+
+ if(!program.execute())
+ return 2;
+
+ return 0;
+}
\ No newline at end of file
diff --git a/lib/GT7Udp/src/Salsa20.h b/lib/GT7Udp/src/Salsa20.h
new file mode 100644
index 0000000..52dd553
--- /dev/null
+++ b/lib/GT7Udp/src/Salsa20.h
@@ -0,0 +1,135 @@
+/*
+Copyright (c) 2014 Nezametdinov E. Ildus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+#ifndef SALSA20_H
+#define SALSA20_H
+
+#include <cassert>
+#include <climits>
+#include <cstdint>
+#include <cstring>
+
+namespace ucstk
+{
+
+ using std::size_t;
+ using std::int32_t;
+ using std::uint8_t;
+ using std::uint32_t;
+
+ /**
+ * Represents Salsa20 cypher. Supports only 256-bit keys.
+ */
+ class Salsa20
+ {
+ public:
+ /// Helper constants
+ enum: size_t
+ {
+ VECTOR_SIZE = 16,
+ BLOCK_SIZE = 64,
+ KEY_SIZE = 32,
+ IV_SIZE = 8
+ };
+
+ /**
+ * \brief Constructs cypher with given key.
+ * \param[in] key 256-bit key
+ */
+ inline Salsa20(const uint8_t* key = nullptr);
+ Salsa20(const Salsa20&) = default;
+ Salsa20(Salsa20&&) = default;
+ ~Salsa20() = default;
+ Salsa20& operator =(const Salsa20&) = default;
+ Salsa20& operator =(Salsa20&&) = default;
+
+ /**
+ * \brief Sets key.
+ * \param[in] key 256-bit key
+ */
+ inline void setKey(const uint8_t* key);
+
+ /**
+ * \brief Sets IV.
+ * \param[in] iv 64-bit IV
+ */
+ inline void setIv(const uint8_t* iv);
+
+ /**
+ * \brief Generates key stream.
+ * \param[out] output generated key stream
+ */
+ inline void generateKeyStream(uint8_t output[BLOCK_SIZE]);
+
+ /**
+ * \brief Processes blocks.
+ * \param[in] input input
+ * \param[out] output output
+ * \param[in] numBlocks number of blocks
+ */
+ inline void processBlocks(const uint8_t* input, uint8_t* output, size_t numBlocks);
+
+ /**
+ * \brief Processes bytes.
+ *
+ * This function should be used carefully. If number of bytes is not multiple of
+ * block size, then next call to the processBlocks function will be invalid.
+ * Normally this function should be used once at the end of encryption or
+ * decryption.
+ * \param[in] input input
+ * \param[out] output output
+ * \param[in] numBytes number of bytes
+ */
+ inline void processBytes(const uint8_t* input, uint8_t* output, size_t numBytes);
+
+ private:
+ /**
+ * \brief Rotates value.
+ * \param[in] value value
+ * \param[in] numBits number of bits to rotate
+ * \return result of the rotation
+ */
+ inline uint32_t rotate(uint32_t value, uint32_t numBits);
+
+ /**
+ * \brief Converts 32-bit unsigned integer value to the array of bytes.
+ * \param[in] value 32-bit unsigned integer value
+ * \param[out] array array of bytes
+ */
+ inline void convert(uint32_t value, uint8_t* array);
+
+ /**
+ * \brief Converts array of bytes to the 32-bit unsigned integer value.
+ * \param[in] array array of bytes
+ * \return 32-bit unsigned integer value
+ */
+ inline uint32_t convert(const uint8_t* array);
+
+ // Data members
+ uint32_t vector_[VECTOR_SIZE];
+
+ };
+
+}
+
+#include "Salsa20.inl"
+#endif
\ No newline at end of file
diff --git a/lib/GT7Udp/src/Salsa20.inl b/lib/GT7Udp/src/Salsa20.inl
new file mode 100644
index 0000000..ad1f927
--- /dev/null
+++ b/lib/GT7Udp/src/Salsa20.inl
@@ -0,0 +1,180 @@
+/*
+Copyright (c) 2014 Nezametdinov E. Ildus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+#include "Salsa20.h"
+
+namespace ucstk
+{
+
+ Salsa20::Salsa20(const uint8_t* key)
+ {
+ std::memset(vector_, 0, sizeof(vector_));
+ setKey(key);
+ }
+
+ //----------------------------------------------------------------------------------
+ void Salsa20::setKey(const uint8_t* key)
+ {
+ static const char constants[] = "expand 32-byte k";
+
+ if(key == nullptr)
+ return;
+
+ vector_[0] = convert(reinterpret_cast<const uint8_t*>(&constants[0]));
+ vector_[1] = convert(&key[0]);
+ vector_[2] = convert(&key[4]);
+ vector_[3] = convert(&key[8]);
+ vector_[4] = convert(&key[12]);
+ vector_[5] = convert(reinterpret_cast<const uint8_t*>(&constants[4]));
+
+ std::memset(&vector_[6], 0, 4 * sizeof(uint32_t));
+
+ vector_[10] = convert(reinterpret_cast<const uint8_t*>(&constants[8]));
+ vector_[11] = convert(&key[16]);
+ vector_[12] = convert(&key[20]);
+ vector_[13] = convert(&key[24]);
+ vector_[14] = convert(&key[28]);
+ vector_[15] = convert(reinterpret_cast<const uint8_t*>(&constants[12]));
+ }
+
+ //----------------------------------------------------------------------------------
+ void Salsa20::setIv(const uint8_t* iv)
+ {
+ if(iv == nullptr)
+ return;
+
+ vector_[6] = convert(&iv[0]);
+ vector_[7] = convert(&iv[4]);
+ vector_[8] = vector_[9] = 0;
+ }
+
+ //----------------------------------------------------------------------------------
+ void Salsa20::generateKeyStream(uint8_t output[BLOCK_SIZE])
+ {
+ uint32_t x[VECTOR_SIZE];
+ std::memcpy(x, vector_, sizeof(vector_));
+
+ for(int32_t i = 20; i > 0; i -= 2)
+ {
+ x[4 ] ^= rotate(static_cast<uint32_t>(x[0 ] + x[12]), 7);
+ x[8 ] ^= rotate(static_cast<uint32_t>(x[4 ] + x[0 ]), 9);
+ x[12] ^= rotate(static_cast<uint32_t>(x[8 ] + x[4 ]), 13);
+ x[0 ] ^= rotate(static_cast<uint32_t>(x[12] + x[8 ]), 18);
+ x[9 ] ^= rotate(static_cast<uint32_t>(x[5 ] + x[1 ]), 7);
+ x[13] ^= rotate(static_cast<uint32_t>(x[9 ] + x[5 ]), 9);
+ x[1 ] ^= rotate(static_cast<uint32_t>(x[13] + x[9 ]), 13);
+ x[5 ] ^= rotate(static_cast<uint32_t>(x[1 ] + x[13]), 18);
+ x[14] ^= rotate(static_cast<uint32_t>(x[10] + x[6 ]), 7);
+ x[2 ] ^= rotate(static_cast<uint32_t>(x[14] + x[10]), 9);
+ x[6 ] ^= rotate(static_cast<uint32_t>(x[2 ] + x[14]), 13);
+ x[10] ^= rotate(static_cast<uint32_t>(x[6 ] + x[2 ]), 18);
+ x[3 ] ^= rotate(static_cast<uint32_t>(x[15] + x[11]), 7);
+ x[7 ] ^= rotate(static_cast<uint32_t>(x[3 ] + x[15]), 9);
+ x[11] ^= rotate(static_cast<uint32_t>(x[7 ] + x[3 ]), 13);
+ x[15] ^= rotate(static_cast<uint32_t>(x[11] + x[7 ]), 18);
+ x[1 ] ^= rotate(static_cast<uint32_t>(x[0 ] + x[3 ]), 7);
+ x[2 ] ^= rotate(static_cast<uint32_t>(x[1 ] + x[0 ]), 9);
+ x[3 ] ^= rotate(static_cast<uint32_t>(x[2 ] + x[1 ]), 13);
+ x[0 ] ^= rotate(static_cast<uint32_t>(x[3 ] + x[2 ]), 18);
+ x[6 ] ^= rotate(static_cast<uint32_t>(x[5 ] + x[4 ]), 7);
+ x[7 ] ^= rotate(static_cast<uint32_t>(x[6 ] + x[5 ]), 9);
+ x[4 ] ^= rotate(static_cast<uint32_t>(x[7 ] + x[6 ]), 13);
+ x[5 ] ^= rotate(static_cast<uint32_t>(x[4 ] + x[7 ]), 18);
+ x[11] ^= rotate(static_cast<uint32_t>(x[10] + x[9 ]), 7);
+ x[8 ] ^= rotate(static_cast<uint32_t>(x[11] + x[10]), 9);
+ x[9 ] ^= rotate(static_cast<uint32_t>(x[8 ] + x[11]), 13);
+ x[10] ^= rotate(static_cast<uint32_t>(x[9 ] + x[8 ]), 18);
+ x[12] ^= rotate(static_cast<uint32_t>(x[15] + x[14]), 7);
+ x[13] ^= rotate(static_cast<uint32_t>(x[12] + x[15]), 9);
+ x[14] ^= rotate(static_cast<uint32_t>(x[13] + x[12]), 13);
+ x[15] ^= rotate(static_cast<uint32_t>(x[14] + x[13]), 18);
+ }
+
+ for(size_t i = 0; i < VECTOR_SIZE; ++i)
+ {
+ x[i] += vector_[i];
+ convert(x[i], &output[4 * i]);
+ }
+
+ ++vector_[8];
+ vector_[9] += vector_[8] == 0 ? 1 : 0;
+ }
+
+ //----------------------------------------------------------------------------------
+ void Salsa20::processBlocks(const uint8_t* input, uint8_t* output, size_t numBlocks)
+ {
+ assert(input != nullptr && output != nullptr);
+
+ uint8_t keyStream[BLOCK_SIZE];
+
+ for(size_t i = 0; i < numBlocks; ++i)
+ {
+ generateKeyStream(keyStream);
+
+ for(size_t j = 0; j < BLOCK_SIZE; ++j)
+ *(output++) = keyStream[j] ^ *(input++);
+ }
+ }
+
+ //----------------------------------------------------------------------------------
+ void Salsa20::processBytes(const uint8_t* input, uint8_t* output, size_t numBytes)
+ {
+ assert(input != nullptr && output != nullptr);
+
+ uint8_t keyStream[BLOCK_SIZE];
+ size_t numBytesToProcess;
+
+ while(numBytes != 0)
+ {
+ generateKeyStream(keyStream);
+ numBytesToProcess = numBytes >= BLOCK_SIZE ? BLOCK_SIZE : numBytes;
+
+ for(size_t i = 0; i < numBytesToProcess; ++i, --numBytes)
+ *(output++) = keyStream[i] ^ *(input++);
+ }
+ }
+
+ //----------------------------------------------------------------------------------
+ uint32_t Salsa20::rotate(uint32_t value, uint32_t numBits)
+ {
+ return (value << numBits) | (value >> (32 - numBits));
+ }
+
+ //----------------------------------------------------------------------------------
+ void Salsa20::convert(uint32_t value, uint8_t* array)
+ {
+ array[0] = static_cast<uint8_t>(value >> 0);
+ array[1] = static_cast<uint8_t>(value >> 8);
+ array[2] = static_cast<uint8_t>(value >> 16);
+ array[3] = static_cast<uint8_t>(value >> 24);
+ }
+
+ //----------------------------------------------------------------------------------
+ uint32_t Salsa20::convert(const uint8_t* array)
+ {
+ return ((static_cast<uint32_t>(array[0]) << 0) |
+ (static_cast<uint32_t>(array[1]) << 8) |
+ (static_cast<uint32_t>(array[2]) << 16) |
+ (static_cast<uint32_t>(array[3]) << 24));
+ }
+
+}
\ No newline at end of file
diff --git a/src/SHCustomProtocol.h b/src/SHCustomProtocol.h
index 7796d3f..3a1139d 100644
--- a/src/SHCustomProtocol.h
+++ b/src/SHCustomProtocol.h
@@ -4184,6 +4184,39 @@ public:
return;
}
+ // Waking always takes precedence over Settings touch targets. The first
+ // tap only restores the display; it never activates a hidden button.
+ if (screenSleeping)
+ {
+ if (!isTouched && wasTouched)
+ {
+ screenSleeping = false;
+ screenOffByUser = false;
+ fadeScreenOn();
+ forceUpdate = true;
+ if (!previousGameRunning)
+ {
+ gameStoppedTimerStarted = true;
+ gameStoppedTime = millis();
+ }
+ else
+ {
+ gameStoppedTimerStarted = false;
+ }
+
+ if (settingsScreen != SettingsScreen::Closed)
+ drawSettingsScreen();
+ }
+ wasTouched = isTouched;
+ return;
+ }
+
+ if (isTouched && !wasTouched && !previousGameRunning)
+ {
+ gameStoppedTimerStarted = true;
+ gameStoppedTime = millis();
+ }
+
if (settingsScreen != SettingsScreen::Closed)
{
if (!isTouched && settingsLastInteractionTime != 0 &&
@@ -4218,27 +4251,8 @@ public:
if (!isTouched && wasTouched)
{
- if (screenSleeping)
- {
- screenSleeping = false;
- screenOffByUser = false;
- fadeScreenOn();
- forceUpdate = true;
- if (!previousGameRunning)
- {
- gameStoppedTimerStarted = true;
- gameStoppedTime = millis();
- }
- else
- {
- gameStoppedTimerStarted = false;
- }
- }
- else
- {
- showSettingsScreen(SettingsScreen::Main);
- waitForReleaseAfterScreenChange = true;
- }
+ showSettingsScreen(SettingsScreen::Main);
+ waitForReleaseAfterScreenChange = true;
}
wasTouched = isTouched;