home *** CD-ROM | disk | FTP | other *** search
- *.............................................................................
- * Program Name: CTFMODEM Copyright: Magna Carta Software, Inc.
- * Date Created: 06-24-91 Language: FoxPro 2.0
- *.............................................................................
- * Description: Modem routines for 'CommTools -- Fox' examples.
- * Do NOT run this file directly. It is DOed by FOXCOMxx examples, starting
- * with FOXCOM07
- *.............................................................................
-
-
- *
- * CT_MODEM(expN portid, expC number)
- * Show a menu that allows the user to send commands to the modem.
- *
- FUNCTION ct_modem
- PARAMETERS portid, col
-
- DEFINE POPUP pop_modem FROM 01, col;
- IN SCREEN;
- SHADOW
- DEFINE BAR 1 OF pop_modem PROMPT "Return"
- DEFINE BAR 2 OF pop_modem PROMPT "Initialize"
- DEFINE BAR 3 OF pop_modem PROMPT "Dial"
- DEFINE BAR 4 OF pop_modem PROMPT "Hang Up"
-
- ON SELECTION POPUP pop_modem =_ct_modem(portid, BAR())
- ACTIVATE POPUP pop_modem
- RELEASE pop_modem
- RETURN (0)
-
-
- FUNCTION _ct_modem
- PARAMETERS portid, choice
-
- DO CASE
- CASE choice = 1
- CASE Choice = 2
- ret=status_msg(0, "Obtaining modem type information...")
- motype = modem_id(portid)
- ret=status_msg(0, "Modem Type is: " + get_modem(motype))
- =mspause(1000)
- ret=status_msg(0, "Initializing...")
- =modem_init(portid, motype)
- ret=status_msg(0, "Ready")
-
- CASE Choice = 3
- ret=status_msg(0, "Dialing: " + LTRIM(number))
- ret = modem_dial(portid, number)
- ret = status_msg(0, "Dial Return Code: " + STR(ret))
- =INKEY(0)
- IF ret < 0
- =status_msg(0, "Modem not initialized")
- =INKEY(0)
- ENDIF
- ret = status_msg(0, "Carrier speed: " + ALLTRIM(STR(get_carrier_speed(portid)));
- + ". Port speed: " + ALLTRIM(STR(get_speed(portid))))
-
- CASE Choice = 4
- =status_msg(0, "Attempting to hang up modem")
- ret = modem_hangup(portid)
- IF ret >= 0
- =status_msg(0, "Modem successfully hung up")
- ELSE
- =status_msg(0, "Error while attempting to hang up modem")
- ENDIF
- ENDCASE
- DEACTIVATE POPUP pop_modem
- RETURN (Choice)
-
-
- FUNCTION get_modem
- PARAMETERS type
- PRIVATE strtype
-
- DO CASE
- CASE type = 0
- strtype = "UNKNOWN"
- CASE type = 300
- strtype = "Hayes Compatible 300 bps"
- CASE type = 1200
- strtype = "Hayes Compatible 1200 bps"
- CASE type = 1300
- strtype = "Hayes Compatible 1200EF"
- CASE type = 2400
- strtype = "Hayes Compatible 2400 bps"
- CASE type = 9600
- strtype = "Hayes Compatible 9600 bps"
- CASE type = 14400
- strtype = "Hayes Compatible 14400 bps"
- CASE type = 961
- strtype = "TELEBIT RA12C"
- CASE type = 962
- strtype = "TELEBIT RA12E"
- CASE type = 963
- strtype = "TELEBIT RM12C"
- CASE type = 964
- strtype = "TELEBIT T18PC"
- CASE type = 965
- strtype = "TELEBIT T18SA"
- CASE type = 966
- strtype = "TELEBIT T18RMM"
- CASE type = 901
- strtype = "UDS 9600"
- CASE type = 1
- strtype = "UDS V3224"
- CASE type = 2
- strtype = "UDS V3225"
- CASE type = 144
- strtype = "USR 9600 DUAL STD"
- OTHERWISE
- strtype = "UNKNOWN"
- ENDCASE
- RETURN (strtype)
-
-