If (Packet.Flags And OG_SHIFTLIGHT) > 0 Then
LEDShiftLigth.Visible = True
Else
LEDShiftLigth.Visible = False
End If
If (Packet.Flags And OG_FULLBEAM) > 0 Then
Headlights.Visible = True
Else
Headlights.Visible = False
End If
If (Packet.Flags And OG_SIGNAL_L) > 0 Then
LeftSignalLight.Visible = True
Else
LeftSignalLight.Visible = False
End If
If (Packet.Flags And OG_SIGNAL_R) > 0 Then
RightSignalLight.Visible = True
Else
RightSignalLight.Visible = False
End If
'Each update sends the following UDP packet :
Private Type OutGaugePacket
Time(0 To 3) As Byte 'time in milliseconds (to check order)
Car(0 To 3) As Byte 'Car name
Flags(0 To 1) As Byte 'Combination of OG_FLAGS, see below
Gear As Byte 'Reverse:0, Neutral:1, First:2...
SpareB As Byte 'Spare
Speed As Single 'M/S
Rpm As Single 'RPM
Turbo As Single 'BAR
EngTemp As Single 'C
Fuel As Single '0 to 1
OilPress As Single 'BAR
Spare1 As Single 'Spare
Spare2 As Single 'Spare
Spare3 As Single 'Spare
Throttle As Single '0 to 1
Brake As Single '0 to 1
Clutch As Single '0 to 1
Display1(0 To 15) As Byte 'Usually Fuel
Display2(0 To 15) As Byte 'Usually Settings
ID As Long '(optional ID - if specified in cfg.txt)
End Type
Private Const OG_SHIFTLIGHT As Long = 1
Private Const OG_FULLBEAM As Long = 2
Private Const OG_HANDBRAKE As Long = 4
Private Const OG_PITSPEED As Long = 8
Private Const OG_TC As Long = 16
Private Const OG_HEADLIGHTS As Long = 32
Private Const OG_SIGNAL_L As Long = 64
Private Const OG_SIGNAL_R As Long = 128
Private Const OG_REDLINE As Long = 256
Private Const OG_OILWARN As Long = 512
Private Const OG_1 As Long = 1024
Private Const OG_2 As Long = 2048
Private Const OG_3 As Long = 4096
Private Const OG_4 As Long = 8192
Private Const OG_KM As Long = 16384
Private Const OG_BAR As Long = 32768