Quote:
Originally Posted by Andrew80k
And I'll add for signed and unsigned and this is how I look at them, maybe not a technical definition:
signed and unsigned integers are integers that can be positive and negative. A signed integer of a certain size can go from a certain negative value to a certain positive value, depending on the size of the integer so -n to +n. Now an unsigned integer is only positive and can go from 0 to n. In the case above where you have unsigned and signed in the same 4-byte block, you have say the first 10 bits are signed so the value can go from -2^9 to 2^9-1. And then you have the unsigned piece that can go from 0 to 2^20 -1 since it is 20 bits.
Any help?
|
Yeah, some of that stuff is sounding vaguely familiar from reading I have done on it in the past. I just have to figure out how to calculate this stuff. It does look like Hexvis can be a little helpful. I am guessing that the "Real" field in Hexvis is for floats? I don't really understand how to convert X Y Z info into floats to compare my /loc to verify which section might be what. And converting the combined signed and unsigned stuff is even harder. I can just guess and test different structure orders, but I don't even know what size to break up the int32s into for signed and unsigned.
I wouldn't mind reading up on this stuff, but it is really hard to find a good site that explains ints and floats and unions and stuff. Searching for those things yields way too many coding posts, lol.
One thing I am not 100% sure about, but I think I have figured out is that it seems like uints send the hex starting on the left and sints send it starting on the right, though both still read the bits from right to left. What I mean by that is when looking at the hex output from packet collects, I see that some int32 fields of the packet structure are sent like 01 00 00 00, and some are send like 00 00 00 01. Though, maybe it is the floats that are sent backwards like that now that I think about it more. It seems like it is normally X Y Z coordinates or something that is sent that way (00 00 CD AB vs CD AB 00 00).