>>> Is it FlightGear not parsing correctly the string input? Maybe attaching to 
>>> it any \n it receives as a part of the string?
>>
>> Yes. That code could use some cleanup.
>> First, it calls the simgear io channel function readline() which
>> simply uses \n as delimiter, not knowing about the line separator
>> specified in the protocol file. Then, the \n is left in the buffer and
>> thus processed with the last chunk.
>
> Just committed a quick fix which:
> 1) warns if given line separator doesn't end with a newline, and adds it
> 2) warns if any input data doesn't end with the expected line separator
> 3) strips the line separator from the input
>
> Ideally, we'd have to pass down the line separator to simgear, but
> that's for another time.
> Report if I have broken something.

Thank you Csaba,
  I don't think I will report anything untill I can run a precompiled 
binary, I really never compiled FGFS and I don't think I will this time 
either (compiling this stuff is really far from my experience).
Just tell me please if, when and where I can find a precompiled binary.

Anyway, I appreciate the news, at least I know what's going on and can 
write my code acordingly.
Now in order to avoid this bug I will use a workaround. I will comment 
extensively my code where this workaround has been used, so that in the 
future, when the bug will be wiped out off any FGFS binary, everyone 
(not just me) can erase it quickly and painlessly.

Btw, it's the first time I ever programmed something that use a serial 
connection, I was wondering, who can I ask for suggestions. I just 
started reading stuff about it, and since I'm not using a physical 
serial connection (the Arduino board is connected to the PC with a usb 
cable, and the driver makes it appear to the system as a /dev/ttyACM0, 
it's a virtual serial port) much of the physical related aspects are non 
working. I'm reading about buffers, hardware control flow, synchronous 
and asynchronus data flow, there's a lot there and sometimes I can't 
discern what's related to my scenario and what's not. I have quite a few 
perplexity about all this stuff, and everything doc I find generally 
deals with physical serials.
I could really use some help or at least some guide in order to avoid 
misunderstandings on my side.

E.g. there's something not working quite right at this time regarding my 
serial data flow synchronization. I managed setting fgfs's serial input 
and Arduino's output at 30hz, that works relatively nice, but things get 
weird when FGFS expects data at 30Hz and Arduino sends it at different 
frequencies (variable in time, not fixed), it looks like FGFS sometimes 
reads it all with huge delay, some other freezes. I'd like to know more 
in order to get things done in a more elegant way. It's just a detail 
but I'm trying to figure out the whole panorama before committing to 
more complex interactions.


------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to