On Tue, 16 Aug 2011, Derrick Washington wrote: > "Btw. if your generic protocol is set to use network byte order > (endianness MSB) you have to take that into account when unpacking the > float value." > > Huh? Are you saying that if I am using --generic=socket that FG sendings > out the data MSB first? Is there a discription on this anywhere so I can > read up on any other gotcha's? So if the protocol is set to > --generic=serial then how are the values read out?
I'm saying that if your generic protocol file specifies <binary_mode>true</binary_mode> <byte_order>network</byte_order> your receiver (or sender) code also have to use that encoding convention. The encoding used by the generic protocol is independent of the output channel you choose (file, TCP socket, UDP socket, serial port or whatever). If you are unsure about what encoding FG uses for binary data src/Network/generic.cxx is the place to find out. It is pretty much standard for the basic types as far as I know, though. Network order is MSB first (as is host order if your system is big endian but that is not so common these days). If you use host order and both your systems have the same endianness (and you only care about your use case) you don't have to worry about this. Cheers, Anders -- --------------------------------------------------------------------------- Anders Gidenstam WWW: http://www.gidenstam.org/FlightGear/ ------------------------------------------------------------------------------ uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel