Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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