On Sun, 2011-08-07 at 20:33 -0400, Derrick Washington wrote:
>  Hi
>  
>    I need to know if the inputs coming from FG, while using a generic
> protocol having binary mode set to true, are coming in as integers
> that need to be converted to floating point or is FG actually sending
> in a floating point word, a byte at a time?  So my code to receive FG
> data looks something like this....
>  
>  
> for ( int i = 0; i <= 3; i++ ) { dummy_var = (dummy_var << 8) |
> rs232_uart1; }                                                                
>                                                       
>                                                                               
>                                         
>   return ( (float) dummy_var);  
>  
> What I am wondering is, is the " return ( (float) dummy_var); " cast
> to a float necessary, or is the number already in floating point
> format, if so then I need to instruct my hardware to retrieve a full
> word at a time.  I've included the xml file just in case you guys have
> any questions about what data I am asking FG to transmit.

Floats are sent as floats and (depending on which version of FlightGear
you're using, doubles as doubles but they where added in a later
version).

BTW you can (and have to) specify a separate section for input and for
output in the same protocol configuration file if you want
bi-directional communication.

Erik



------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to