Re: ZModem communication within C Applications?



On 2006-07-19, dao@xxxxxxxxxxxxxx <dao@xxxxxxxxxxxxxx> wrote:


Hi, I have to develop a C based application that will be able to
utilize one of the many 'sz' (ZModem send) applications to transfer
data across a modem line. I have some question on this process.


'sz' sends and receives the data (from rz) over stdin and stdout, but
I've a single file descriptior to readign and writing to the modem. So
tere seems to be a disconnect here in the way both sides are operating.
I just simply won't be able to fork or popen the 'sz' executable and
expect the file automagically appear on the other side.

redirect stdout/stdin to/from the modem device.

something like this: (from memory so check each line carefully)

dup2() would seem well-suited for this


int zmodem_result=-1;

if (( childpid = fork())
{ /* child code */
dup2(modem_fd,0); // connect modem to stdin
dup2(modem_fd,1); // and stdout
execlp("rz","rz",NULL); // run rz
perror("exec() of rz failed"); // something went wrong, say what it was.
exit(-1); // give up let main task proceed.
}
else if (childpid>0)
wait( &zmodem_resiult )
else perror("fork failed");

What might be the best way to go about this process? Where to start?
Would there by chance be a ZModem package out there best suited for
this purpose?

I only know of two. the Omen one and the GNU one, the GNU one seems fine,
the Omen one was good too but I lost my copy.

for more hints, you _could_ look at the source to minicom.

Bye.
Jasen
.



Relevant Pages

  • ZModem communication within C Applications?
    ... utilize one of the many 'sz' (ZModem send) applications to transfer ... I've a single file descriptior to readign and writing to the modem. ...
    (comp.os.linux.development.apps)
  • Re: modem communication
    ... > communicate with another machine (with a modem) using low level API to ... XModem, YModem, ZModem, etc. are _protocols_ meant for exchanging files. ... even on those devices people have implemented TCP/IP stacks!) ...
    (sci.electronics.design)
  • Re: Need Help With Modem
    ... XModem and ZModem are transfer programs. ... ever done with a modem is to dial a phone number. ... I can't find where one changes any settings. ...
    (microsoft.public.windowsxp.general)
  • Re: Need Help With Modem
    ... from BCBSGA, but I don't know much of what to do with it. ... it says the modem must be XModem or ZModem. ...
    (microsoft.public.windowsxp.general)