|Real Software Forums
|Page 1 of 1|
|Author:||Bud [ Mon Sep 26, 2011 12:05 pm ]|
|Post subject:||modem communications|
Does anyone know where I can get an example of RB code which will get me talking with a modem?
I want to have computer A call up computer B and transfer some data (usually a file). I am OK with the code required to send and receive the data but am hung up with actually getting the modem to connect, send and/or receive. I have seen many small snippets of code relating to serial comm, but all are targetted to one phase of the process and not the full process of getting the modem up and running.
Can anyone point me in the right direction? (I already have Aaron's piece on serial comm but he targets the Crystalfont and not normal modem communications).
|Author:||BrunoFrechette [ Mon Sep 26, 2011 3:31 pm ]|
|Post subject:||Re: modem communications|
I have dealt with this in the past. Basically, you issue the commands (write to serial port) and read the response (data available).
Before you start, make sure the modem is programmed with/without command echo, reply with codes or words, connect speed, etc. So you should start with some modem initialization depending on the model, make, chipset of the modem. Them issue the ATDT command to dial, then wait for CONNECT/BUSY/NO DIALTONE/... (there are several responses). The "CONNECT" word is usually the signal that you are now in data mode with the other end.
When you want to hangup, you usually write 3 break (I don't recall the ascii number) followed by a one second wait. That switches from data communication with the other end to sending commands to the local modem. Then issue ATH.
Always look for the "NO CARRIER" as it can be issued anytime and that tells you you've lost your connection.
The best way is to actually do it manually in a terminal. Whatever you type, your software must write to the serial port. Whatever is shown, your software must read, recognize and act upon.
That's off the top of my head. Hope it gets you started!
|Page 1 of 1||All times are UTC - 5 hours|
|Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group