I am trying to Get a Byte[] from a offset, from FSUIPC. FSUIPC gets and sets information in Flight Simulator X. The offset:
private Offset<byte[]> RadioNav1Set = new Offset<byte[]>(0x311E, 4); //not sure about the 4
The documentation:
NAV1 standby frequency, 4 digits in BCD format. A frequency of 113.45 is represented by 0x1345. The leading 1 is assumed.
So I need to get the 4 digits behind the x. I have tried these 2, both with no luck, the value is 115.70
and the result for test1=112
and for test2=5488
byte[] test1 = RadioNav1Set.Value;
short test2 = BitConverter.ToInt16(RadioNav1Set.Value,0);
txtSetCourse.Text = Convert.ToString(test1[0] + " " + test2);
test1 only changes when changing .70
from 115.70
and test2 changes with random increments.
Thanks in advance!