How to talk to a modem via a com port

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to talk to a modem via a com port

Louis LaBrunda
Hi All,

Does anyone have some sample code to talk to a telephone modem through a
com port?  It is a USB modem that shows up on COM3.  I want to play with
getting the caller Id info.  Any help is appreciated, so thanks in advance.

Lou
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:[hidden email] http://www.Keystone-Software.com


Reply | Threaded
Open this post in threaded view
|

Re: How to talk to a modem via a com port

Mateusz Grotek
Dnia 29.01.2015 19:28:40, Louis LaBrunda napisaƂ(a):

> Hi All,
>
> Does anyone have some sample code to talk to a telephone modem  
> through a
> com port?  It is a USB modem that shows up on COM3.  I want to play  
> with
> getting the caller Id info.  Any help is appreciated, so thanks in  
> advance.
>
> Lou
> -----------------------------------------------------------
> Louis LaBrunda
> Keystone Software Corp.
> SkypeMe callto://PhotonDemon
> mailto:[hidden email] http://www.Keystone-Software.com
>
>
>

Hi,

There is a class called SerialPort.
You use it like that:
|port input output|
port := SerialPort new.
"Here you can set up the port, check the settings protocol of the  
SerialPort class."
port openPort: 0. "Here you can put a number, or a string like  
'/dev/ttyS0' in Linux"
output := port nextPutAll: 'ATI0',Character cr.
Transcript showln: port readString.

ATI0 is an example of the Hayes AT commands used to control modems  
(they are use for most modems, not only Hayes), see here:
http://en.wikipedia.org/wiki/Hayes_command_set

BTW. if you have problems with the SerialPort class on Windows or OSX,  
try Linux instead.

Mateusz

Reply | Threaded
Open this post in threaded view
|

How to talk to a modem via a com port

Louis LaBrunda
Hi Mateusz,

Thanks for the reply.  Late yesterday I discovered SerialPort and have it
working for the basics.

Lou


On Fri, 30 Jan 2015 11:08:31 +0100, Mateusz Grotek
<[hidden email]> wrote:

>Dnia 29.01.2015 19:28:40, Louis LaBrunda napisa?(a):
>> Hi All,
>>
>> Does anyone have some sample code to talk to a telephone modem  
>> through a
>> com port?  It is a USB modem that shows up on COM3.  I want to play  
>> with
>> getting the caller Id info.  Any help is appreciated, so thanks in  
>> advance.
>>
>> Lou
>> -----------------------------------------------------------
>> Louis LaBrunda
>> Keystone Software Corp.
>> SkypeMe callto://PhotonDemon
>> mailto:[hidden email] http://www.Keystone-Software.com
>>
>>
>>
>
>Hi,
>
>There is a class called SerialPort.
>You use it like that:
>|port input output|
>port := SerialPort new.
>"Here you can set up the port, check the settings protocol of the  
>SerialPort class."
>port openPort: 0. "Here you can put a number, or a string like  
>'/dev/ttyS0' in Linux"
>output := port nextPutAll: 'ATI0',Character cr.
>Transcript showln: port readString.
>
>ATI0 is an example of the Hayes AT commands used to control modems  
>(they are use for most modems, not only Hayes), see here:
>http://en.wikipedia.org/wiki/Hayes_command_set
>
>BTW. if you have problems with the SerialPort class on Windows or OSX,  
>try Linux instead.
>
>Mateusz
>
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:[hidden email] http://www.Keystone-Software.com