Ive made some pretty good progress using java. Im just creating classes for each packet received. So I am doing the STA packet at the moment.
1. so, im trying to convert the replayspeed into a float value, im using the 4 bytes which i got from the array sent from LFS (check attached file to see data) and stored them into a seperate array
I dont know if the conversion is correct and this is the output i get
f= 4.6006E-41
fe=0
2. and finally can someone explain how the values can be extracted from the flags
so i receive these values
FLAG
-32
12
from lfs what does it mean(what flags does it contain)
1. so, im trying to convert the replayspeed into a float value, im using the 4 bytes which i got from the array sent from LFS (check attached file to see data) and stored them into a seperate array
import java.nio.*;
public static void main(String args[])
{
byte [] a = new byte[4];
a[0] = 0;
a[1] =0;
a[2] =-128;
a[3]=63;
ByteBuffer b= ByteBuffer.allocate(a.length);
b.put(a);
Float f = (float)b.getFloat(0);
int fe = f.intValue();
System.out.println(f);
System.out.println(fe);
}
I dont know if the conversion is correct and this is the output i get
f= 4.6006E-41
fe=0
2. and finally can someone explain how the values can be extracted from the flags
ISS_GAME 1 // in game (or MPR)
ISS_REPLAY 2 // in SPR
ISS_PAUSED 4 // paused
ISS_SHIFTU 8 // in SHIFT+U mode
ISS_SHIFTU_HIGH 16 // HIGH view
ISS_SHIFTU_FOLLOW 32 // following car
etc.
so i receive these values
FLAG
-32
12
from lfs what does it mean(what flags does it contain)