I tried to figure out how the joystick bits are packed into a message based on the packet captures I did. I got it to work but I am tired and I must be doing something wrong. The sticks seem to be centered at 1024 and range from 364 to -364. Which doesn't make any sense.
Code:
short axis1=1024;//RightX center=1024 left =364 right =-364
short axis2=1024;//RightY down =364 up =-364
short axis3=1024;//LeftY down =364 up =-364
short axis4=1024;//LeftX left =364 right =-364
short axis5=1024;//Unknown.
long paramLong1 = ((long)axis1 & 0x7FF) | (((long)axis2 & 0x7FF) << 11) | ((0x7FF & (long)axis3) << 22) | ((0x7FF & (long)axis4) << 33) | ((long)axis5 << 44);
a[9] = ((byte)(int)(0xFF & paramLong1));
a[10] = ((byte)(int)(paramLong1 >> 8 & 0xFF));
a[11] = ((byte)(int)(paramLong1 >> 16 & 0xFF));
a[12] = ((byte)(int)(paramLong1 >> 24 & 0xFF));
a[13] = ((byte)(int)(paramLong1 >> 32 & 0xFF));
a[14] = ((byte)(int)(paramLong1 >> 40 & 0xFF));
Console.WriteLine(BitConverter.ToString(a).Replace("-",","));
Last edited: