VS Arduino
>> >> Serial port line break only at \r\n
https://www.visualmicro.com/forums/YaBB.pl?num=1318027989

Message started by Bruno on Oct 7th, 2011 at 10:53pm

Title: Serial port line break only at \r\n
Post by Bruno on Oct 7th, 2011 at 10:53pm
Hi again =)

I've come to pester some more.

I noticed that the new shiny serial port monitor only breaks lines when it receives a \r\n (Windows).

All of my debug code uses only a trailing \n (*nix).

It would be very cool if there was an option in the settings that would auto replace the line endings when enabled.
Something like, ConvertSerialEOL ?

On receive -> if char = \n, append \r\n.

:D

Congrats on the new 10.x extension btw, it's a lot more sexy.

-- bbf


Title: Re: Serial port line break only at \r\n
Post by Visual Micro on Oct 7th, 2011 at 11:25pm
Thanks:)

That makes sense

Should it be a system wide setting for all the serial windows or a setting per window?

Title: Re: Serial port line break only at \r\n
Post by Visual Micro on Oct 7th, 2011 at 11:28pm
actually another question

how do arduino and other serial tools handle this. does \n wrap text lines? if so we should do this by default?

Title: Re: Serial port line break only at \r\n
Post by Bruno on Oct 8th, 2011 at 7:50pm
You are right, it might make sense to have it per serial windows... maybe a little checkbox at the bottom.

In arduino, the serial monitor is just a wrapper for the RXTX library. And there, a simple \n will the cursor skip to the next line. I was mostly using that, and it was one of the reasons I saw the clutter when using your serial window.

But the arduino library has a Serial.println() which sends a \r\n. Since some people will be using that, it makes sense to have it configurable.

In my own serial parsing library, implemented in C for the arduino itself, I have an auto-magic way of handling these sequences. I convert all \r\n to \n by reading, and peeking the next char.

Title: Re: Serial port line break only at \r\n
Post by Visual Micro on Oct 8th, 2011 at 8:42pm
funny, in vs if the option is on, i was thinking of find the previous char to \n and if not \r then replacing \n with \r\n

we've been watching the cpu usage with serial windows open and ensured the serial stuff is quite efficient.

this option would slow things down a fraction because at the moment incoming serial data is not scanned or retained except in the viewer textbox. Let's see if it does slow things down, if not then maybe it could be a global option?

Would you mind adding it as a request to the issue tracker on codeplex. I think it's fair to say that it is an issue because we should be doing everything that arduino does

thanks


VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.