convert lf -> lf/cr - Protocols
This is a discussion on convert lf -> lf/cr - Protocols ; Hi,
I'm runnig c-kermit 8.0.209 on linux box. I'm connectin to a embedded
system via serial line with following options set in my config:
set line /dev/ttyUSB0
set speed 115200
set carrier-watch off
set handshake none
set flow-control none
robust
...
-
convert lf -> lf/cr
Hi,
I'm runnig c-kermit 8.0.209 on linux box. I'm connectin to a embedded
system via serial line with following options set in my config:
set line /dev/ttyUSB0
set speed 115200
set carrier-watch off
set handshake none
set flow-control none
robust
set file type bin
set file name lit
set rec pack 1000
set send pack 1000
set window 5
log SESSION /tmp/kermlog-axissaxis
The problem is that remote device sends only lf at the end of the
string and output in kermit is always indented since cr if missing.
Is there a way to translate lf to lf/cr automaticly?
-
Re: convert lf -> lf/cr
On 2005-06-03, hkdevel@gmail.com wrote:
: I'm runnig c-kermit 8.0.209 on linux box. I'm connectin to a embedded
: system via serial line with following options set in my config:
:
: set line /dev/ttyUSB0
: set speed 115200
: set carrier-watch off
: set handshake none
: set flow-control none
: robust
: set file type bin
: set file name lit
: set rec pack 1000
: set send pack 1000
: set window 5
: log SESSION /tmp/kermlog-axissaxis
:
: The problem is that remote device sends only lf at the end of the
: string and output in kermit is always indented since cr if missing.
:
: Is there a way to translate lf to lf/cr automaticly?
:
I could have sworn there was but I can't find it in the commands or in
the code. There is a command:
set terminal cr-display { cr, crlf }
to handle bare incoming carriage returns, but none for bare incoming
linefeeds. Then looking through my notes, I realize I meant to add it quite
some time ago, when the same thing happened to me when I was typing directly
at a PostScript interpreter. So OK, I moved this item up towards the top of
the list.
In the meantime, if you're a C programmer, the modification to ckucns.c
should be pretty straightforward, it would be right here, about line 2246:
if (c == CR && tt_crd) { /* SET TERM CR-DISPLA CRLF? */
ckcputc(c); /* Yes, output CR */
if (seslog && !sessft) logchar((char)c);
c = LF; /* and insert a linefeed */
}
Just stuff a CR before passing on the LF:
if (c == LF && tt_crd) { /* SET TERM CR-DISPLA CRLF? */
ckcputc(CR); /* Yes, output CR first */
if (seslog && !sessft) logchar((char)CR);
}
bearing in mind that then you will have a hacked version in which SET TERM
CR-DISPLAY really means SET TERM LF-DISPLAY. When the next release (or daily
edit) appears, it will have the new command and you can throw your version out
and use the new one.
- Frank
-
Re: convert lf -> lf/cr
> Just stuff a CR before passing on the LF:
>
> if (c == LF && tt_crd) { /* SET TERM CR-DISPLA CRLF? */
> ckcputc(CR); /* Yes, output CR first */
> if (seslog && !sessft) logchar((char)CR);
> }
>
> bearing in mind that then you will have a hacked version in which SET TERM
> CR-DISPLAY really means SET TERM LF-DISPLAY. When the next release (or daily
> edit) appears, it will have the new command and you can throw your version out
> and use the new one.
>
Thank you for this quick&dirty hack help. It does just what I wanted!
regards,
hk