home *** CD-ROM | disk | FTP | other *** search
- !**************************************************************************
- !
- ! "RATOC REX-5568/9868 for ARA version 2.1 CCL - Nov./26/96"
- !
- ! REX-5568M..
- ! DATA/FAX Modem DATA 28800bps/ FAX 14400bps
- ! Data mode V.34/V.Fast/V.32bis/V.32/V.22bis/BELL 212A/BELL 103
- ! Fax mode V.17/V.29/V.27ter/V.21 EIA-578 Class1/EIA-592 Class2
- ! ERR MNP Class4 V.42/ DATA MNP Class5 V.42bis / MNP 10
- ! DTE Speed 115.2k/57.6k/38.4k/19.2k/9600/7200/4800/2400/1200/600/300bps
- !
- ! "localized for RATOC System inc. - Nov./20/96"
- !
- ! Written by Chell.Para
- !
- ! 'mlts' resource info for this modem:
- ! byte 1 == 01 -> modem HAS builtin reliability protocols
- ! byte 2 == 00 -> reserved by Apple
- ! byte 3 == FE -> max hex chars in varstr 7 (254 dec)
- ! byte 4 == FE -> max hex chars in varstr 8
- ! byte 5 == FE -> max hex chars in varstr 9
- !
- ! Version 2.0.1 23 / Jan./ 1996 REX-5568M Type
- ! Version 2.0.2 25 / Mar./ 1996 ダイアル待ち時間を90秒に変更
- ! Version 2.0.3 08 / Aug./ 1996 ダイアル文字列バグを修正
- ! Version 3.0.0 27 / Nov./ 1996 全体を変更・OT-PPPに対応
- !
- !**************************************************************************
- @ORIGINATE
- @ANSWER
- !
- !******************************************
- ! モデムの圧縮機能チェック
- !******************************************
- ifstr 5 1 "0"
- serreset 57600, 0, 8, 1
- jump 2
- !
- @LABEL 1
- serreset 38400, 0, 8, 1
- !
- !-----------------------------------------------------
- ! シリアルポートリセット
- !-----------------------------------------------------
- @LABEL 2
- hsreset 0 0 0 0 0 0
- settries 0
- !-----------------------------------------------------
- ! モデムからの応答テスト
- !-----------------------------------------------------
- matchclr
- matchstr 1 3 "OK¥13¥10"
- write "AT¥13"
- matchread 30
- !
- !-----------------------------------------------------
- ! モデムの初期化
- ! &F - モデム動作状態のSレジスタと各コマンドを出荷時モードに設定
- ! &D3 - ERがONからOFF に変化すると電源投入時と同じ初期設定を行う
- ! ¥Q3 - CS/RSによる双方向のフロー制御
- ! %E0 - 自動リトレーニング禁止
- ! ¥V1 - /REL接続コードを有効する
- ! ¥N7 - 自動確認モード指定
- ! ¥J0 - シリアルポートの速度調整無し
- ! S0=0 - 自動応答をしない
- ! E0 - コマンドエコー禁止
- !-----------------------------------------------------
- @LABEL 3
- !
- matchclr
- matchstr 1 4 "OK¥13¥10"
- matchstr 2 101 "ERROR¥13¥10"
- write "AT&F&D3¥¥Q3%E1¥¥V1¥¥N7¥¥J0E0&P2¥13"
- matchread 30
- inctries
- iftries 3 101
- !-----------------------------------------------------
- ! モデムリセット
- !-----------------------------------------------------
- DTRClear
- pause 5
- DTRSet
- flush
- jump 3
- !
- !******************************************
- ! Varstring 4 , MNP/LAPMエラー訂正プロトコルチェック:
- ! = 0, handled by computer (ARAP)
- ! = 1, handled by modem (PPP)
- ! = 2, MNP10 protocol (Cellular protocol)
- !******************************************
- @LABEL 4
- !
- ! MNP10を指定されれば(var 4 == 2)ラベル6
- ifstr 4 6 "2"
- ! MNP/LAPMを指定されれば(var 4 == 1)ラベル5
- ifstr 4 5 "1"
- !
- !-----------------------------------------------------
- ! MNP/LAPMを使わない場合
- !-----------------------------------------------------
- matchclr
- matchstr 1 9 "OK¥13¥10"
- write "AT¥¥N¥13"
- matchread 30
- jump 101
- !
- !-----------------------------------------------------
- ! LAPM/MNPモード
- !-----------------------------------------------------
- @LABEL 5
- !******************************************
- ! Varstring 5 , 圧縮プロトコルチェック:
- ! = 0, コンピュータ圧縮
- ! = 1, モデム圧縮
- !******************************************
- ifstr 5 9 "1"
- !-----------------------------------------------------
- ! Varstring 5 == 0, モデム圧縮の場合
- !-----------------------------------------------------
- matchclr
- matchstr 1 9 "OK¥13¥10"
- ! %C0 - データコンプレッション無し
- write "AT%C0¥13"
- matchread 30
- jump 101
- !
- !-----------------------------------------------------
- ! MNP10モード
- !-----------------------------------------------------
- @LABEL 6
- matchclr
- matchstr 1 9 "OK¥13¥10"
- ! ¥N5 - MNPモード
- ! ¥J0 - シリアルポートの速度調節無し
- ! -K1 - MNP10拡張サービスを有効にする
- write "AT¥¥N5¥¥J0-K1-C1¥13"
- matchread 30
- jump 101
- !
- !******************************************
- ! Varstring 2, スピーカーモードチェック:
- ! = 0, スピーカーオフ
- ! = 1, スピーカーオン
- !******************************************
- @LABEL 9
- ifstr 2 13 "1"
- pause 5
- matchclr
- matchstr 1 13 "OK¥13¥10"
- write "ATM0¥13"
- matchread 30
- jump 101
- !
- !*******************************************************************************
- ! モデムの初期設定後オリジネートモード・アンサーモードでの応答 ラベル13〜30
- !*******************************************************************************
- @LABEL 13
- ifANSWER 32
- !
- ! ---- オリジネートモード ----
- !******************************************
- ! Varstring 6, ダイアルモードチェック:
- ! = 0, 通常ダイアル
- ! = 1, 確認無しダイアル
- ! = 2, 手動ダイアル
- ! それ以外は ARA version 1.0
- !******************************************
- ! 通常ダイアルであれば(parm 6 == 0)ラベル19
- ifstr 6 19 "0"
- ! ビジートーン・ダイアルトーン無視であれば(parm 6 == 2)ラベル17
- ifstr 6 17 "1"
- ! 手動ダイアルであれば(parm 6 == 2)ラベル15
- ifstr 6 15 "2"
- !
- !-----------------------------------------------------
- ! ARA version 1.0へのダイアリング
- !-----------------------------------------------------
- note "^1へダイアル中" 3
- write "ATD^3^1¥13
- jump 32
- !
- !-----------------------------------------------------
- ! オペレータを介して発信
- !-----------------------------------------------------
- @LABEL 15
- note "手動ダイアル中" 3
- write "ATX1D¥13"
- jump 32
- !
- !-----------------------------------------------------
- ! ビジートーン・ダイアルトーン無視で発信
- !-----------------------------------------------------
- @LABEL 17
- note "ダイアルトーンを無視してダイアル中" 3
- matchclr
- matchstr 1 19 "OK¥13¥10"
- ! X1 - ビジートーン・ダイアルトーン無視
- write "ATX1¥13"
- matchread 30
- jump 101
- !
- @LABEL 19
- note "^1へダイアル中です" 3
- !
- !******************************************
- ! Varstrings 7, 8 and 9, contain dialstring fragments
- ! フラグメント電話番号にも対応しています。
- ! Varstring 1 : ダイアルストリングドキュメント
- ! Varstring 3 : パルス"P"/トーン"T"
- ! Varstring 7 = ダイアルストリング
- ! Varstring 8 == 無し Varstring7に接続
- ! Varstring 9 == 無し Varstring7 + 8に接続
- ! それ以外はVarstring7 + 8 + 9に接続
- !******************************************
- !
- ifstr 8 27 "¥x20"
- ifstr 9 24 "¥x20"
- !
- !-----------------------------------------------------
- ! Varstring7 + 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
-
- !-----------------------------------------------------
- ! Varstring7 + 8に電話をかける。
- !-----------------------------------------------------
- @LABEL 24
- 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
-
- !-----------------------------------------------------
- ! Varstring7に電話をかける。
- !-----------------------------------------------------
- @LABEL 27
- !
- write "ATD^3^7¥13"
-
- !******************************************
- ! ---- 接続応答 ----
- ! The following section will parse modem responces of two types:
- ! 1) PROTOCOL: xxx, COMPRESSION: xxx, CONNECT xxx
- ! 2) CONNECT xxx/ARQ/V42
- !******************************************
- @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 33 "CONNECT "
- matchstr 8 32 "CARRIER"
- matchstr 9 40 "CONNECT¥13¥10"
- matchstr 10 62 "PROTOCOL: NONE"
- matchstr 11 62 "PROTOCOL: LAPM"
- matchstr 12 62 "PROTOCOL: ALT"
- matchstr 13 62 "PROTOCOL: ALT-CELLULAR"
- matchstr 14 67 "COMPRESSION: V"
- matchstr 15 67 "COMPRESSION: NONE"
- matchstr 16 67 "COMPRESSION: CLASS"
- matchread 700
- ifANSWER 32
- jump 105
- !
- !******************************************
- ! Parse the speed of connect result codes
- ! 2400 and 4800 have two entries each
- ! to distinguish them from 24000 and 48000
- !******************************************
- @LABEL 33
- matchclr
- matchstr 1 40 "2400¥13"
- matchstr 2 40 "2400/"
- matchstr 3 41 "4800¥13"
- matchstr 4 41 "4800/"
- matchstr 5 42 "7200"
- matchstr 6 43 "9600"
- matchstr 7 44 "12000"
- matchstr 8 45 "14400"
- matchstr 9 46 "16800"
- matchstr 10 47 "19200"
- matchstr 11 48 "21600"
- matchstr 12 49 "24000"
- matchstr 13 50 "26400"
- matchstr 14 51 "28800"
- matchread 30
- jump 59
- !
- ! -- Connection rates --
- ! CommunicatingAt informs ARA of the raw modem to modem
- ! connection speed.
- !
- @LABEL 40
- note "2400 bps で接続中" 2
- CommunicatingAt 2400
- jump 60
- !
- @LABEL 41
- note "4800 bps で接続中" 2
- CommunicatingAt 4800
- jump 60
- !
- @LABEL 42
- note "7200 bps で接続中" 2
- CommunicatingAt 7200
- jump 60
- !
- @LABEL 43
- note "9600 bps で接続中" 2
- CommunicatingAt 9600
- jump 60
- !
- @LABEL 44
- note "12400 bps で接続中" 2
- CommunicatingAt 12400
- jump 60
- !
- @LABEL 45
- note "14400 bps で接続中" 2
- CommunicatingAt 14400
- jump 60
- !
- @LABEL 46
- note "16800 bps で接続中" 2
- CommunicatingAt 16800
- jump 60
- !
- @LABEL 47
- note "19200 bps で接続中" 2
- CommunicatingAt 19200
- jump 60
- !
- @LABEL 48
- note "21600 bps で接続中" 2
- CommunicatingAt 21600
- jump 60
- !
- @LABEL 49
- note "24000 bps で接続中" 2
- CommunicatingAt 24000
- jump 60
- !
- @LABEL 50
- note "26400 bps で接続中" 2
- CommunicatingAt 26400
- jump 60
- !
- @LABEL 51
- note "28800 bps で接続中" 2
- CommunicatingAt 28800
- jump 60
- !
- @LABEL 59
- note "ボーレート未確認で接続中" 2
- jump 60
-
- !******************************************
- ! Look for reliablilty and compression results
- ! at the end of the connect result.
- !******************************************
- @LABEL 60
- matchclr
- matchstr 1 63 "LAPM"
- matchstr 2 63 "REL"
- matchstr 3 63 "ARQ"
- matchstr 4 68 "COMP/"
- matchstr 5 68 "COMP¥13"
- matchstr 6 63 "V42/"
- matchstr 7 63 "V42¥13"
- matchstr 8 68 "V42BIS"
- matchstr 9 68 "V42bis"
- matchstr 10 63 "MNP¥13"
- matchstr 11 68 "MNP5"
- matchstr 12 70 "¥10"
- matchread 30
- jump 70
-
- !-----------------------------------------------------
- ! -- Modem error correction link negotiation --
- ! Userhook 2 informs ARA that a modem-to-modem error
- ! correcting protocol has been negotiated
- !-----------------------------------------------------
- @LABEL 62
- note "エラー訂正モード使用" 2
- userhook 2
- jump 32
- !
- @LABEL 63
- note "エラー訂正モード使用" 2
- userhook 2
- jump 60
-
- !-----------------------------------------------------
- ! -- Compression negotiation --
- ! Userhook 3 informs ARA that a modem-to-modem compression
- ! protocol has been negotiated
- !-----------------------------------------------------
- @LABEL 67
- note "データ圧縮モード使用" 2
- userhook 3
- jump 32
- !
- @LABEL 68
- note "データ圧縮モード使用" 2
- userhook 3
- jump 60
-
-
- !-----------------------------------------------------
- ! This modem has been setup to do CTS handshaking,
- ! and we assume that a CTS handshaking cable is being used.
- !-----------------------------------------------------
- !
- @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 "電話に応対しています。" 2
- write "ATA¥13"
- jump 32
-
- !-----------------------------------------------------
- ! ---- Hang up and reset modem ----
- !-----------------------------------------------------
- @HANGUP
- @LABEL 90
- settries 0
- HSReset 0 0 0 0 0 0
- !
- !----------------------------
- ! コマンドモードに戻す
- !----------------------------
- @LABEL 92
- matchclr
- matchstr 1 96 "OK¥13¥10"
- write "+++"
- matchread 20
- !
- @LABEL 94
- ! Force a hangup
- 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 30
- !
- !---------------------------------------
- ! DTR初期化コマンド
- !---------------------------------------
- DTRClear
- pause 5
- DTRSet
- flush
- !
- ! Try the hangup sequence three times otherwise declare and error
- inctries
- iftries 3 101
- jump 92
- !
- @LABEL 96
- ! Pause between data and command mode
- pause 50
- jump 94
- !
-
- !------------------------------
- ! 初期設定値に戻す.
- !------------------------------
- @LABEL 98
- pause 15
- matchclr
- matchstr 1 99 "OK¥13¥10"
- write "AT&F¥13"
- matchread 30
- jump 101
- !
- @LABEL 99
- exit 0
-
- !-----------------------------------------------------
- ! ---- Error messages -----
- !-----------------------------------------------------
- ! モデムが応答しない
- @LABEL 101
- exit -6019
- !
- ! ダイアルトーン未検出
- @LABEL 102
- exit -6020
- !
- ! モデムと接続できない
- @LABEL 103
- exit -6021
- !
- ! ビジートーン検出
- @LABEL 104
- exit -6022
- !
- ! 指定番号の返答がない
- @LABEL 105
- exit -6023
- !
- ! User Cancellation
- @LABEL 107
- exit -6008
-