modem communication

hi, im in need to know some information about how to use the modem to communicate with another machine ( with a modem) using low level API to control the modem. i've heard about zmodem, xmodem, etc, but dont know the api they use to comminicate with the modem. Please can someone give me a starting point?

CMOS

Reply to
manusha
Loading thread data ...

Under Windows and Linux, modems show up as "files," that is, you open a "file" such as Com1: or /dev/ttya with fopen() and then use fread() or fwrite() to retreieve or send characters to the modem. You use I/O control functions (IOCTL) to change bit rates, stop bits, etc.

XModem, YModem, ZModem, etc. are _protocols_ meant for exchanging files. They're relatively simple (well... XModem is trivial, YModem is a little harder, and full ZModem is certainly not something you'd want to plan on only spending one evening with), and you can find the protocol definitions themselves as well as code for implementing it with a little Googling.

These days, often people just use the TCP/IP stacks built into Linux or Windows to connect to another machine, even over a dial-up connection. TCP/IP presents a "sockets" interface (API) that lets your application not have to worry about anywhere near as many details as if you use X/Y/ZModem, as well as allowing your application to function over pretty much any network (including the Internet, of course) and lots of hardware (modems, Ethernet, wireless, etc.). You take a performance hit for doing this -- file transfer speed using something like FTP will only be, say, 80% of what ZModem could get you -- but the flexibility this approach creates more than makes up for it.

Unless you're communicating with a highly resource-limited device such as an 8 bit microcontroller, I'd suggest going the TCP/IP route. (And just to prove it can be done, even on those devices people have implemented TCP/IP stacks!)

---Joel Kolstad

Reply to
Joel Kolstad

hi, thank for the reply. i always wanted to use sockets for the communications, but there are some requrements that makes using sockets difficult ( this is what i think). the scenario is =>

there will be several PC's with each having a modem and a telephone connection. No PC has the internet access. All PC's should have the ability to connect to any other PC by just dialing the corresponding telephone number. After connected, they need to communicate using the TCP/IP protocol. ( i.e i need to use Sockets in the communication.). PC's will have Windows Me/98 as the O/s.

(this is similar to what happens with hyperterminal, but i think the difference is the protocol used in the communication.)

i guess i can use PPP for this, but this will require atleast windows

2000.

please advice me on the path i should choose.

thank you CMOS

Reply to
manusha

Have a look at the "AT"commandset that comes with the modems. All communication is built from there.

Rene

--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net
Reply to
Rene Tschaggelar

They don't use an "API" to communicate with the modem. An "API" is an "Applications Program Interface", which is to communicate with the user, these days in some kind of window. The actual communication, whether xmodem, zmodem, or TCP/IP, is "in the background".

Other than that, just write an interface that transmits and receives bytes, and processes them according to your data transfer protocol. The user interface, you can do at your leisure. Back when I was trying to write that stuff, I stole somebody else's interrupt handler by using a pop-up debugger to zero in on their code. And we didn't have Windoze. :-)

Good Luck! Rich

Reply to
Rich Grise

Like, What?

Even that sorry pile of duff code wrapped in a GUI could do Sockets, PPP and at least MSCHAP - a broken-by-microsoft-design version of the chap protocol - for the dialup/connect part.

I will bet that your main problem will be how to configure the dial-in; Windows 98 was never much of a Server OS.

Another problem will be how to manage the configuration of the machines;

Static IP adresses of each host that must be entered in one dialog box for PPP to work (with a reboot at the end), fixed telephone numbers and an "hosts" file with all the other PC's since you do not have DNS. Default Gateway should be 0.0.0.0 - that should cause PPP to negotiate an adress with the other end.

"FidoNet" actually worked like what you describe. Maybe there is an implementation?

>
Reply to
Frithiof Andreas Jensen

Try using the dialin server included in windows 98 (or use the dun 1.3 0r 1.4 upgrade on win 95). When you set the server, it will answer on the first ring and establish a tcp/ip connection with the calling machine. Not the best setup, but it does work. The link below has some info to give you an idea on the setup.

formatting link

Reply to
Si Ballenger

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.