I’ve never worked with modems that much before, and I’m stuck. I’m trying to write an app that will call a modem every so often and then do something based on whether or not the modem answers/doesn’t answer/is busy, etc. I’ve got far enough where I can get to my modem and call the remote one, but I don’t know how to “ask” the modem what it’s doing. Here’s what I’ve got so far:
Try
' Enable the timer.
Me.tmrReadCommPort.Enabled = True
' Attempt to open the port.
m_CommPort.Open(m_ModemPort, 115200, 8, Rs232.DataParity.Parity_None, Rs232.DataStopBit.StopBit_1, 4096)
' Write an user specified Command to the Port.
m_CommPort.Write(Encoding.ASCII.GetBytes("atd1234567" & Chr(13)))
' Sleep long enough for the modem to respond and the timer to fire.
System.Threading.Thread.Sleep(200)
Application.DoEvents()
Stop
m_CommPort.Close()
Catch ex As Exception
' Warn the user.
MessageBox.Show("Unable to communicate with Modem")
Finally
Me.tmrReadCommPort.Enabled = False
End Try
Where the ‘stop’ is now is where I want to poll the modem; Is it ringing? Has it answered? Is it busy? Are there AT commands to do that? Is it a property or method of the port?
Thanks in advance.
I hate having to ask, but when Google and luck fail you. . .