Small application to map racing sim telemetry data to USB CAN devices.
Used to test or use automotive hardware devices (dashes/steering wheels/etc.) away from real cars.
Using the application is very straightforward, select the sim + CAN device from the combo boxes and press Start (and Stop to end sim/CAN)
New sims can be added using ISimInterface
public delegate void DataUpdatedHandler(object sender, SimDataEventArgs e);
public interface ISimInterface
{
void Start();
DataUpdatedHandler DataUpdated { get; set; }
}
- Use
SimData
to define the data your hardware can support.- This data is used with all sims and CAN interfaces.
- Reading the sim data should begin on
Start()
by accessing shared memory, opening a UDP port, using a library, etc. - New CAN messages are sent when
DataUpdated()
is called. - Local sim data should be sent out using the
SimDataEventArgs
ofDataUpdated()
New USB CAN interfaces can be added using ICANInterface
public interface ICanInterface
{
bool Init();
bool Start();
bool Stop();
bool Write(CanData canData);
}
- Use
Init()
,Start()
,Stop()
to handle any interface requirements- Load/close library, open/close socket, etc.
- Use
Write(CanData data)
to send the CAN message
New CAN hardware (dashes, wheels, etc.) can be added by
- Updating
SimData
to include the necessary data - Formatting the data in the correct way when
Sim_DataUpdated()
is called inSimToCanAppViewModel()
- Setting the
Id
,Len
andPayload
for eachCanData
message - Writing the
CanData
message usingcan.Write(data)
New CAN message formats can be added in numerous different ways
As an example, see SimDash.Messages
Note: Other sims may be supported if they use the same interfaces, these are the only ones that I have tested.
Sims | Tested | Possibly Supported |
---|---|---|
Assetto Corsa | X | |
Assetto Corsa Competizione | X | |
Dirt Rally | X | |
Dirt Rally 2 | X | |
Dirt 4 | X | |
F1 2016 | X | |
F1 2017 | X | |
F1 2018 | X | |
F1 2019 | X | |
F1 2020 | X | |
F1 2021 | X | |
F1 2022 | X | |
EA WRC | X |
Assetto Corsa interface thanks to mdjarv's assettocorsasharedmemory
See my fork for my additions.
Device | Tested |
---|---|
USB2CAN | X |
PCAN-USB | X |
- Currently changing CAN parameters is not included
- No receiving of CAN messages is supported as I typically use another device setup as a USB HID device to do that, but it could be useful