
here is a example how the data is pulled from the game
to a vb.net application
Code: Select all
Imports LFS_External
Imports LFS_External.OutGauge
Imports LFS_External.OutGauge.Flags
Namespace LFS_External_Client
Partial Public Class Form1
Inherits Form
Private OutGauge As OutGaugeInterface
Dim Form1 As Windows.Forms.FormBorderStyle
Private Property Form As Windows.Forms.FormBorderStyle
Private Delegate Sub dlgOutGauge(ByVal og As Packets.OutGaugePack)
Public Sub New()
InitializeComponent()
End Sub
Private Sub OutGauge_Received(ByVal og As Packets.OutGaugePack)
Try
If DoInvoke() Then
Dim p As Object = og
Me.Invoke(New dlgOutGauge(AddressOf OutGauge_Received), p)
Return
End If
Catch e1 As Exception
Return
End Try
Label3.Text = og.RPM.ToString
Dim TXTgear As String
TXTgear = "7"
If (og.Gear > 7) Then
TXTgear = Convert.ToString(og.Gear)
Else
Select Case og.Gear
Case 7
TXTgear = "6"
Case 6
TXTgear = "5"
Case 5
TXTgear = "4"
Case 4
TXTgear = "3"
Case 3
TXTgear = "2"
Case 2
TXTgear = "1"
Case 1
TXTgear = "N"
Case 0
TXTgear = "R"
End Select
End If
Me.Label8.Text = TXTgear
TextBox2.Text = og.Fuel.ToString("0.00L")
TextBox3.Text = og.Throttle.ToString()
Label1.Text = og.Car.ToString()
TextBox6.Text = og.Speed.ToString("000")
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles MyBase.FormClosing
OutGauge.Close()
End Sub
Private Function DoInvoke() As Boolean
For Each c As Control In Me.Controls
If c.InvokeRequired Then
Return True
End If
Exit For
Next c
Return False
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim outgauge_reply_port As UShort = 35555
OutGauge = New OutGaugeInterface(outgauge_reply_port)
AddHandler OutGauge.OutGauge_Received, AddressOf OutGauge_Received
OutGauge.Listen()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
OutGauge.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.FormBorderStyle = FormBorderStyle.None
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.FormBorderStyle = FormBorderStyle.Fixed3D
End Sub
Private Function p() As Object
Throw New NotImplementedException
End Function
End Class
End Namespace
which interfaced this usb module http://lcdmodkit.com/module/BPU204A-1.html it uses a dll called lcd2usb.dll in lcd smartie