Quoting "Y. Zhuang" <[EMAIL PROTECTED]>:

Thanks very much for help. So "@qHBB" and "@qHbB" actually mean the
format that we should unpack this string, right? What is the
differences between "@qHBB" and "@qHbB" then? and "@BBBBBB"?

Thank you


Yes. Basically, to summarize the python doc I linked, if you have binary data stored in a string you want to decode, each character in the python format string corresponds to one or more of the bytes in it (with the exception of the @ at the beginning. @ tells the byte order and alignment to use -- the system default in this case). Then q would be a long long, H an unsigned short, and B being an unsigned char. Also, @BBBBBB can be written as @6B, and you can construct the formatting strings dynamically if needed (if transmitting a variable length packet).

The difference between qHbB and qHBB is that the lowercase b in the middle is signed and the capital B is unsigned. (i.e. is the number stored in two's-complement.) Of course, what that means for the code is up to the coder.

--Mason




_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to