dissecting protocol in lua
Hi,
I have a field which is 4 bytes: 8020f912 which represents latitude in radians and resolution of 2^-29. Also this is motorola format.
meaning, the data shall be taken as hex2dec(12f92080) * 2^-19 = 0.5*3067626 rad = 34deg how to i write the diessction properly?
f.Lat = ProtoField.string("data.Lat", "Lat",base.dec)
...
subtree:add_le(f.Lat,buffer(x,4), string.format("%f,buffer(x,4):uint()*2^-32) )
I guess that uint() shall be handled differently but don't know how
Is this the calculation(?):
The number provided is an example. I need generic solution for different values - note that tere is a need to change the order of the bytes