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_setBTW. if you have problems with the SerialPort class on Windows or OSX,
try Linux instead.
Mateusz