! Generic 230400 1X (OFF) Modem Driver for most phones based on Qualcomm's chipset ! Author: Kris Kreutzman, modified by david.salerno@verizonwireless.com 9/8/2002 ! Eliminated as much as possible what does not apply to 1X phones, hangup via DTR not +++ ! Copyright: © 1991-1996 Apple Computer, Inc. All Rights Reserved. ! revision history: v2.1 as shipped with the ARA 2.1 ! ! Toned down to 115200 for the Sierra Wireless 555 by snoeren@cs.ucsd.edu ! @ORIGINATE @ANSWER ! ifstr 5 1 "0" serreset 115200, 0, 8, 1 jump 2 ! @LABEL 1 serreset 115200, 0, 8, 1 ! @LABEL 2 hsreset 0 0 0 0 0 0 settries 0 ! @LABEL 3 matchclr matchstr 1 4 "OK\13\10" matchstr 2 101 "ERROR\13\10" !write "AT&F&C2$QCMDR=2\13" write "ATZ\13" matchread 30 inctries iftries 3 101 ! ! Reset the Modem on setup failure ! DTRClear pause 55 DTRSet flush jump 3 ! @LABEL 4 ! Modem ready, wait for a call or originate a call ! @LABEL 13 ifANSWER 32 ! ---- Originating a call ---- assume only normal dialing ! @LABEL 19 ! Display the full dialstring contained in Varstring 1 note "Dialing ^1" 3 ! Varstrings 7, 8 and 9, contain dialstring fragments ! Long phone numbers may need to be split into smaller groups ! for the modem to use ! Varstring 3: "p" for pulse & "t" for tone dialing ! Varstring 8 == blank (dialstring in varstring 7) ! Varstring 9 == blank (dialstring in varstrings 7 & 8) ! Otherwise (dialstring in varstrings 7, 8 & 9) ! \^ is added to the dialstring to force the modem to generate a data tone ifstr 8 27 " " ifstr 9 24 " " ! Write dialstring in varstrings 7, 8 & 9 matchclr matchstr 1 21 "OK\13\10" write "ATD^3^7;\13" matchread 400 jump 101 ! @LABEL 21 matchclr matchstr 1 22 "OK\13\10" write "ATD^3^8;\13" matchread 400 jump 101 ! @LABEL 22 write "ATD^3^9\13" jump 32 ! @LABEL 24 ! Write dialstring in varstrings 7 & 8 matchclr matchstr 1 25 "OK\13\10" write "ATD^3^7;\13" matchread 400 jump 101 ! @LABEL 25 write "ATD^3^8\13" jump 32 ! @LABEL 27 ! Write dialstring in varstring 7 write "ATD^3^7\13" ! @LABEL 32 matchclr matchstr 1 81 "RING\13\10" matchstr 2 102 "NO DIALTONE\13\10" matchstr 3 103 "NO CARRIER" matchstr 4 103 "ERROR\13\10" matchstr 5 104 "BUSY\13\10" matchstr 6 105 "NO ANSWER\13\10" matchstr 7 58 "CONNECT " matchstr 8 32 "CARRIER" matchstr 9 58 "CONNECT\13\10" matchread 700 ifANSWER 32 jump 101 ! @LABEL 58 note "Communicating at 115200 bps." 2 CommunicatingAt 115200 jump 70 ! @LABEL 70 ! Turn on CTS handshaking. HSReset 0 1 0 0 0 0 ! ifANSWER 71 pause 30 @LABEL 71 exit 0 ! ---- Answer calls ---- ! A RING result from the modem and in ANSWERING mode ! claims the serial port and answering the phone @LABEL 81 ifORIGINATE 32 userhook 1 note "Answering phone..." 2 write "ATA\13" jump 32 ! ---- Hang up and reset modem ---- @HANGUP @LABEL 90 settries 0 DTRClear pause 55 HSReset 0 0 0 0 0 0 ! @LABEL 94 matchclr matchstr 1 98 "NO CARRIER\13\10" matchstr 2 98 "OK\13\10" matchstr 3 98 "ERROR\13\10" matchstr 4 98 "0\13\10" write "ATH\13" matchread 40 ! Try the hangup sequence four times otherwise declare and error inctries iftries 4 101 jump 94 ! @LABEL 98 ! Recall the factory settings pause 15 matchclr matchstr 1 99 "OK\13\10" write "ATZ\13" matchread 30 jump 101 ! @LABEL 99 exit 0 ! ! ---- Error messages ----- ! ! Modem Not Responding @LABEL 101 exit -6019 ! ! No Dial Tone @LABEL 102 exit -6020 ! ! No Carrier or Error @LABEL 103 exit -6021 ! ! Busy @LABEL 104 exit -6022 ! ! No Answer @LABEL 105 exit -6023 ! ! User Cancellation @LABEL 107 exit -6008