Recently there has been a lot of modem related activity on the STOS mailing list, and it was pointed out that rather than calling the trap instruction, and manually printing the modem control codes to the serial port it would be nice to have an extension which does this for the STOS programmer. Hence, this small extension...
All of this is designed for Hayes compatible modems - the command strings are not correct for other modems. Also, note that with this version it will not work with echo mode enabled, so you will have to manually disable this if it is active).
The three commands are:
I take no responsibility if it screws up your system, or if it leaves your phone off the hook or anything like that, so use at your own risk!
| SPEED | Transfer rate |
|---|---|
| 0 | 19200 Baud |
| 1 | 9600 Baud |
| 2 | 4800 Baud |
| 3 | 3600 Baud |
| 4 | 2400 Baud |
| 5 | 2000 Baud |
| 6 | 1800 Baud |
| 7 | 1200 Baud |
| 8 | 600 Baud |
| 9 | 300 Baud |
| 10 | 200 Baud |
| 11 | 150 Baud |
| 12 | 134 Baud |
| 13 | 110 Baud |
| 14 | 75 Baud |
| 15 | 50 Baud |
I have no idea why you could possibly want one of the slower speeds, but the hardware supports them, so I will. Unfortunately, even if your hardware supports higher speeds than 19200 baud it is not possible to set it using the OS calls (except if MiNT is running, but STOS currently doesn't work in conjunction with MiNT)
The FLOW parameter defines the setting of flow-control. The possible values are:
| FLOW | Meaning |
|---|---|
| 0 | None |
| 1 | XON/XOF |
| 2 | RTS/CTS |
| 3 | Both |
The final parameter - dialtype - indicates what type of phone exchange you have, and also whether to answer or to dial:
| DIALTYPE | Meaning |
|---|---|
| 0 | Tone dial |
| 1 | Pulse dial |
| 2 | Answer immediately |
| Return | Meaning |
|---|---|
| 0 | No errors |
| 1 | Busy, or no modem |
| 2 | No carrier |
| 2 | No dialtone |
10 set aux 0,0,0
20 X=dial("01225331600") : rem my home phone number - dont ring with modem!
30 if X<>0 : print "Error! x=";X : end
40 open #1,"AUX"
50 rem *** use connection...
60 close #1 : hangup
email me at : jacquesa@zetnet.co.uk