[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ymodem



Etienne,

from your previous postings I read that you use 
"high-level-I/O" like fgetc etc. Maybe it would be 
better to use the low-level functions like "read" 
"write" for this. The "f*" function set has another 
line buffer implemented in the newlib, and this 
might interfer with your data stream...

wkr,
Thomas.


> Hi Thomas,
> I have a LOT of problems getting my "console compatible" YMODEM transfer
> to work. Some file get transferred (not completely since I didn't
> implement the EOT respond code), the same file can hang in the middle of
> the transfer (RTEMS is then in a waiting loop, probably waiting for a
> semaphore to be available), and some file hang at the very beginning,
> just after the first init packet (which contains the filename and file
> length).
> 
> I suspect something with the console configuration. But I still don't
> understand every implication of the console settings you talked to me
> about.
> 
> Here's the code:
> 
>   	struct termios  old_termsettings_stdin;
>   	struct termios  old_termsettings_stdout;
>   	struct termios  new_termsettings_stdin;
>   	struct termios  new_termsettings_stdout;
>   	
>   	tcgetattr(fileno(stdin), &old_termsettings_stdin);
>   	tcgetattr(fileno(stdout), &old_termsettings_stdout);
>   	
>     memcpy(&new_termsettings_stdin, &old_termsettings_stdin,
> sizeof(struct termios));
>     new_termsettings_stdin.c_lflag &=
> ~(ISIG|ICANON|ECHO|ECHONL|ECHOK|ECHOE|ECHOPRT|ECHOCTL);
>     new_termsettings_stdin.c_oflag = 0;	
>     new_termsettings_stdin.c_cc[VMIN]  = 0;
>     new_termsettings_stdin.c_cc[VTIME] = 10; 
> 
>     memcpy(&new_termsettings_stdout, &old_termsettings_stdout,
> sizeof(struct termios));
>     new_termsettings_stdout.c_lflag &=
> ~(ISIG|ICANON|ECHO|ECHONL|ECHOK|ECHOE|ECHOPRT|ECHOCTL);
>     new_termsettings_stdout.c_oflag = 0;	
>     new_termsettings_stdout.c_cc[VMIN]  = 0;
>     new_termsettings_stdout.c_cc[VTIME] = 10;
> 
> 	tcsetattr(fileno(stdin), TCSANOW, &new_termsettings_stdin);
> 	tcsetattr(fileno(stdout), TCSANOW, &new_termsettings_stdout);
> 
> 
> Any idea what I'm doing wrong in the config?
> 
> Etienne Fortin
> Sensio
> 
> 

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm