home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-05-03 | 58.3 KB | 1,757 lines |
- ////////////////////////////////////////////////////////////////////////
- // //
- // TLX_HST Service Script, Release 1.1 //
- // //
- // For Telix SALT version 3.11 //
- // //
- // (c) Andrzej Taramina, 1989 //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- int CONT_OK = 0; // Global function return codes
- int GET_OUT = 99;
- int TIME_OUT = 98;
-
- int BOX_COLOUR = 62; // display colours
- int TXT_COLOUR = 48;
-
- str VERSION[3] = "1.1"; // Version Number
-
- main()
- {
- str menu[1] = "M";
- str rom_level[4] = "";
- str func[2];
- int save_scr;
- int t1, t2, t3, t4, t5;
- int stat;
- int ret_code = 0;
- int ran_fn;
- int time_handle;
- int old_baud, old_datab, old_parity, old_stopb;
-
- save_scr = vsavearea(0,0,79,24);
- clear_scr();
- if (carrier())
- {
- clear_scr();
- prints("This Script MUST be run OFFLINE (in terminal mode)");
- prints("Script terminated due to above error.");
- delay(40);
- vrstrarea(save_scr);
- return(-1);
- }
-
- t1 = track("961",0);
- t2 = track("963",0);
- t3 = track("964",0);
- t4 = track("1440",0);
- t5 = track("OK",0);
-
- flushbuf();
- cputs("ATI0^M");
- time_handle = timer_start(20);
- while (1)
- {
- terminal();
- stat = track_hit(0);
- if (stat == t1)
- {
- rom_level = "961";
- break;
- }
- else if (stat == t2)
- {
- rom_level = "963";
- break;
- }
- else if (stat == t3)
- {
- rom_level = "964";
- break;
- }
- else if (stat == t4)
- {
- rom_level = "1440";
- break;
- }
- else if (stat == t5)
- break;
- else if (time_up(time_handle))
- break;
- }
-
- track_free(0);
- timer_free(time_handle);
- if (rom_level == "")
- {
- clear_scr();
- prints("Sorry, your modem is not a USRobotics Courier HST or");
- prints("the ROM level is higher than 1440 or lower than 961.");
- prints("HST Service Script terminated due to above error.");
- delay (40);
- vrstrarea(save_scr);
- return(-1);
- }
-
- cputs("AT&B0^M");
- old_baud = get_baud(); // save old connect parms
- old_parity = get_parity();
- old_datab = get_datab();
- old_stopb = get_stopb();
- set_cparams(2400,0,8,1);
- _local_echo = 1;
-
- while (ret_code == CONT_OK)
- {
- if (menu == "M")
- main_menu(rom_level);
- else
- adv_menu(rom_level);
- ran_fn = 1;
- flushbuf();
- gotoxy(56,18);
- gets(func,2);
- if (menu == "M")
- {
- if (func == "1") ret_code = get_level();
- else if (func == "2") ret_code = chk_sum();
- else if (func == "3") ret_code = ram_test();
- else if (func == "4") ret_code = current_set();
- else if (func == "5") ret_code = nram_set();
- else if (func == "6") ret_code = set_clock();
- else if (func == "7") ret_code = disp_phone();
- else if (func == "8") ret_code = basic_help();
- else if (func == "9") ret_code = ext_help();
- else if (func == "10") ret_code = dial_help();
- else if (func == "11") ret_code = set_sregs();
- else if (func == "12") ret_code = switch_help();
- else if (func == "13") ret_code = interface_test();
- else if (func == "14") ret_code = analog_loop();
- else if (func == "15") ret_code = freq_test();
- else if (func == "16") ret_code = data_mode();
- else if (func == "17") ret_code = set_to_nram();
- else if (func == "18") ret_code = write_nram();
- else if (func == "19") ret_code = dial_phone();
- else if (func == "20") ret_code = link_diag();
- else if (func == "21") ret_code = set_s13reg();
- else if (func == "TX") ret_code = telix_def(rom_level);
- else if (func == "tx") ret_code = telix_def(rom_level);
- else if (func == "PC") ret_code = pcboard_def(rom_level);
- else if (func == "pc") ret_code = pcboard_def(rom_level);
- else if ((func == "AD" or func == "ad") and
- (rom_level >= "964" or rom_level == "1440"))
- {
- menu = "A";
- ran_fn = 0;
- continue;
- }
- else if (func == "99") break;
- else
- {
- tone(400,50);
- ran_fn = 0;
- }
- }
-
- if (menu == "A")
- {
- if (func == "50") ret_code = disable_comp();
- else if (func == "51") ret_code = auto_comp();
- else if (func == "52") ret_code = enable_comp();
- else if (func == "53") ret_code = set_s15reg();
- else if (func == "54") ret_code = set_rate();
- else if (func == "55") ret_code = modem_inq();
- else if (func == "98")
- {
- menu = "M";
- ran_fn = 0;
- }
- else if (func == "99") break;
- else
- {
- tone(400,50);
- ran_fn = 0;
- }
- }
- if (ran_fn and ret_code == CONT_OK)
- {
- gotoxy(18,23);
- printsc("Press (Enter) to return to function menu......");
- flushbuf();
- gotoxy(0,0);
- inkeyw();
- }
- }
-
-
- if (ret_code == TIME_OUT)
- {
- clear_scr();
- prints("WAITFOR timeout: expected response not received after 20 seconds");
- prints("Script terminated....");
- delay(30);
- }
-
- clear_scr();
- gotoxy(0,0);
- prints("USR TLX_HST SERVICE SCRIPT - EXIT");
- prints(" ");
- prints("Thanks for using TLX_HST and TELIX. Have a nice day.");
- delay(10);
- set_cparams(old_baud,old_parity,old_datab,old_stopb);
- _local_echo = 1;
- vrstrarea(save_scr);
- return(0);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display Main Menu //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- main_menu(str rom_level)
- {
- clear_scr();
- pstraxy(" ┌────────────────────────────────────────────┐ ",3,00,30);
- pstraxy("╒═════════════╡ USR COURIER HST - TXL_HST MAIN MENU v ╞═════════════╕",3,01,30);
- pstraxy(VERSION,58,1,30);
- pstraxy("│ └────────────────────────────────────────────┘ │",3,02,30);
- pstraxy("│ 1. Display HST ROM Level 13. Check Modem-PC Interface │",3,03,30);
- pstraxy("│ 2. Display HST Memory Checksum 14. Self-Test: Analog Loopback │",3,04,30);
- pstraxy("│ 3. HST RAM Test 15. Self-Test: Answer Frequency │",3,05,30);
- pstraxy("│ 4. Display HST RAM Settings 16. Self-Test: Reset Data Mode │",3,06,30);
- pstraxy("│ 5. Display HST NRAM Settings 17. Reset Modem to NRAM Default │",3,07,30);
- pstraxy("│ 6. Display/Set Internal TOD Clock 18. Copy RAM Settings to NRAM │",3,08,30);
- pstraxy("│ 7. Display/Store Internal Phone #s 19. Dial a number & exit │",3,09,30);
- pstraxy("│ 8. Display Basic Command Help 20. Link Diagnostics display │",3,10,30);
- pstraxy("│ 9. Display Extended Command Help 21. S13 register settings │",3,11,30);
- pstraxy("│ 10. Display Dial Command Help │",3,12,30);
- pstraxy("│ 11. Display S-Reg Help/Set S-Reg TX. Set Telix 3.11 defaults │",3,13,30);
- pstraxy("│ 12. Display Modem Switch Help PC. Set PCboard 14.x defaults │",3,14,30);
- pstraxy("│ 99. Exit │",3,15,30);
- pstraxy("╞════════════════════════════════════════════════════════════════════════╡",3,16,30);
- pstraxy("│ │",3,17,30);
- pstraxy("│ Type desired function code and (Enter): __ │",3,18,30);
- pstraxy("│ ┌──────────┐ ┌─────────────────────┐ │",3,19,30);
- pstraxy("╘═╡ AJT 1989 ╞═══════════════════════════════════╡ HST ROM Level: ╞═╛",3,20,30);
- pstraxy(" └──────────┘ └─────────────────────┘ ",3,21,30);
- pstraxy(rom_level,69,20,30);
- if (rom_level >= "964" or rom_level == "1440")
- pstraxy("AD. Advanced Functions",44,12,30);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display Advanced Functions Menu //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- adv_menu(str rom_level)
- {
- clear_scr();
- pstraxy(" ┌────────────────────────────────────────────┐ ",3,00,30);
- pstraxy("╒═════════════╡ USR COURIER HST - TLX_HST ADVANCED FN'S ╞═════════════╕",3,01,30);
- pstraxy("│ └────────────────────────────────────────────┘ │",3,02,30);
- pstraxy("│ 50. Disable data compression │",3,03,30);
- pstraxy("│ 51. Auto enable/disable compression │",3,04,30);
- pstraxy("│ 52. Enable data compression │",3,05,30);
- pstraxy("│ 53. S15 register settings │",3,06,30);
- pstraxy("│ 54. Set modem-to-modem link rate │",3,07,30);
- pstraxy("│ 55. Modem configuration inquiry │",3,08,30);
- pstraxy("│ │",3,09,30);
- pstraxy("│ 98. Return to Main Menu │",3,10,30);
- pstraxy("│ 99. EXIT │",3,11,30);
- pstraxy("│ │",3,12,30);
- pstraxy("│ │",3,13,30);
- pstraxy("│ │",3,14,30);
- pstraxy("│ │",3,15,30);
- pstraxy("╞════════════════════════════════════════════════════════════════════════╡",3,16,30);
- pstraxy("│ │",3,17,30);
- pstraxy("│ Type desired function code and (Enter): __ │",3,18,30);
- pstraxy("│ ┌──────────┐ ┌─────────────────────┐ │",3,19,30);
- pstraxy("╘═╡ AJT 1989 ╞═══════════════════════════════════╡ HST ROM Level: ╞═╛",3,20,30);
- pstraxy(" └──────────┘ └─────────────────────┘ ",3,21,30);
- pstraxy(rom_level,69,20,30);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to dial a number and exit //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- dial_phone()
- {
- str prefix[4];
- str number[25];
-
- while (1)
- {
- clear_scr();
- prints("(T) for tone, (P) for pulse dialing and (Enter)...");
- gotoxy(0,2);
- gets(prefix,1);
- if (prefix == "t" or prefix == "T")
- {
- prefix = "ATDT";
- break;
- }
- if (prefix == "p" or prefix == "P")
- {
- prefix = "ATDP";
- break;
- }
- tone(450,50);
- }
-
- gotoxy(0,5);
- prints("Type desired telephone number and (Enter)");
- gotoxy(0,7);
- gets(number,25);
- gotoxy(0,9);
- hangup();
- prints("Exiting TLX_HST and dialling......");
- cputs(prefix);
- cputs(number);
- cputs("^M");
- return(GET_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST ROM level //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- get_level()
- {
- clear_scr();
- prints("USR HST ROM LEVEL DISPLAY -- ATI0");
- cputs("ATI0^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST memory check_sum //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- chk_sum()
- {
- clear_scr();
- prints("USR HST MEMORY CHECKSUM (ROM) DISPLAY -- ATI1");
- cputs("ATI1^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to perform HST RAM test //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- ram_test()
- {
- clear_scr();
- prints("USR HST RAM MEMORY TEST -- ATI2");
- cputs("ATI2^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST RAM settings //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- current_set()
- {
- clear_scr();
- prints("USR HST CURRENT MODEM SETTINGS -- ATI4");
- cputs("ATI4^M");
- if (not waitfor("HOOK",10)) return(TIME_OUT);
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST Non-volatile RAM settings //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- nram_set()
- {
- clear_scr();
- prints("USR HST NON-VOLATILE RAM SETTINGS -- ATI5");
- cputs("ATI5^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST link diagnostics //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- link_diag()
- {
- clear_scr();
- prints("USR HST LINK DIAGNOSTICS DISPLAY -- ATI6");
- cputs("ATI6^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display/set internal HST TOD clock //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- set_clock()
- {
- str input[1];
- int ret_val;
-
- ret_val = CONT_OK;
- clear_scr();
- prints("USR HST INTERNAL CLOCK DISPLAY -- ATI3");
- prints("Current modem clock value is:");
- cputs("ATI3^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- prints(" ");
- prints("Do you wish to set the modem clock (Y/N) ");
- gets(input,1);
- if (input != "Y" and input != "y")
- return(CONT_OK);
- clear_scr();
- prints("USR HST INTERNAL CLOCK SETTING");
- gotoxy(0,2);
- prints("OPTION 1: Synchronize to system clock");
- prints("OPTION 2: Specify your own clock value");
-
- while (1)
- {
- gotoxy(0,5);
- printsc("Type 1 or 2 and (Enter): ");
- gets(input,1);
- if (input == "1")
- {
- ret_val = sys_clock();
- break;
- }
- else if (input == "2")
- {
- ret_val = usr_clock();
- break;
- }
- else tone(450,50);
- }
-
- gotoxy(0,11);
- prints("Modem Internal clock value is now:");
- cputs("ATI3^M");
- if (waitfor("OK",10))
- return(ret_val);
- else
- return(TIME_OUT);
- }
-
- sys_clock()
- {
- str time_str[8];
-
- clear_scr();
- prints("SYNCHRONIZING MODEM CLOCK TO SYSTEM CLOCK");
- gotoxy(0,2);
- printsc("Current system clock is ");
- time(curtime(),time_str);
- prints(time_str);
- cputs("ATK1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- prints("^MSetting...");
- cputs("ATI3=");
- cputs(time_str);
- cputs("K1^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- usr_clock()
- {
- str time_str[8];
-
- clear_scr();
- prints("MANUAL SETTING OF USR HST INTERNAL CLOCK");
- gotoxy(0,2);
- prints("WARNING: The script does not validate the clock value;");
- prints(" an incorrect clock value will return an error.");
- gotoxy(0,6);
- printsc("Type a clock value in HH:MM:SS format and (Enter): ");
- gets(time_str,8);
- cputs("ATK1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- prints("^MSetting...");
- cputs("ATI3=");
- cputs(time_str);
- cputs("K1^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to set HST S-Registers //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- set_sregs()
- {
- str reg_num[2];
- str reg_val[3];
-
- clear_scr();
- prints("SET HST S-REGISTER(S)");
- cputs("ATS$^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- while (1)
- {
- gotoxy(0,17);
- prints("Enter register you want to set (0-12,16-17,19-28,38) <Enter>=None: ");
- gotoxy(67,17);
- gets_lead0(reg_num,2);
- if (reg_num == "")
- return(CONT_OK);
- if (reg_num >= "00" and reg_num <= "12" and num_str(reg_num))
- break;
- if (reg_num == "16" or reg_num == "17" and num_str(reg_num))
- break;
- if (reg_num >= "19" and reg_num <= "28" and num_str(reg_num))
- break;
- if (reg_num == "38")
- break;
- tone(400,50);
- }
-
- clear_scr();
- printsc("Current value of register S");
- printsc(reg_num);
- prints(":");
- cputs("ATS");
- cputs(reg_num);
- cputs("?^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
-
- while (1)
- {
- gotoxy(0,7);
- printsc("Type new S");
- printsc(reg_num,);
- prints(" register value or (Enter) to leave as is: ");
- gets_lead0(reg_val,3);
- if (reg_val == "")
- return(CONT_OK);
- if (reg_val >= "0" and reg_val <="255" and num_str(reg_val))
- break;
- tone(400,50);
- }
-
- cputs("ATS");
- cputs(reg_num);
- cputs("=");
- cputs(reg_val);
- cputs("^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- gotoxy(0,14);
- printsc("New S");
- printsc(reg_num);
- prints(" register value returned by modem is:");
- cputs("ATS");
- cputs(reg_num);
- cputs("?^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to reset HST to NRAM defaults //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- set_to_nram()
- {
- str input[1];
- clear_scr();
- prints("Resetting to NRAM defaults may erase changes made to the modem");
- prints("operational parameters or S-Registers if these changes were not");
- prints("copied to NRAM.");
- prints("Do you wish to continue (Y/N): ");
- gotoxy(30,3);
- gets(input,1);
- if (input != "y" and input != "Y")
- return(CONT_OK);
- cputs("ATZ^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST Basic command help //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- basic_help()
- {
- clear_scr();
- cputs("AT$^M");
- if (not waitfor("Hook",10)) return(TIME_OUT);
- if (not waitfor("Hook",10)) return(TIME_OUT);
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST Basic Command help //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- ext_help()
- {
- clear_scr();
- cputs("AT&$^M");
- if (waitfor("OK",30))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST Dialling Command help //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- dial_help()
- {
- clear_scr();
- cputs("ATD$^M");
- if (not waitfor("Hook",30)) return(TIME_OUT);
- if (waitfor("OK",30))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST S-register help //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- sreg_help()
- {
- clear_scr();
- cputs("ATS$^M");
- if (waitfor("OK",30))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display HST Switch settings help //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- switch_help()
- {
- clear_scr();
- prints("HST DIP SWITCH HELP SCREEN");
- prints(" ");
- prints(" ▄ ▄ ");
- prints(" ┌──────┐┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐");
- prints(" UP│██████││ │█│ │█│ │ │█│ │ │█│ FACTORY");
- prints(" DN│ ││█│ │█│ │█│█│ │█│█│ │ SETTINGS");
- prints(" └──────┘└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘");
- prints(" ▀ ▀ 1 2 3 4 5 6 7 8 9 10");
- prints(" ");
- prints(" Sw# Description Sw# Description ");
- prints(" ------------------------------------------------------------------------");
- prints(" 1...Data Terminal Ready Override 6...Carrier Detect Override ");
- prints(" UP=DTR Normal DN=DTR always ON UP=Pin 8 DN=Always ON ");
- prints(" 2...Verbal/Numeric Result Codes 7...Single/Multiple Phone ");
- prints(" UP=Verbal DN=Numeric UP=Single DN=Multiple ");
- prints(" 3...Result Code Display 8...Command Set Recognition ");
- prints(" UP=No Display DN=Display UP=Dumb Mode DN=Smart Mode ");
- prints(" 4...Command Mode Local Echo 9...Normal Mode Escape Code op.");
- prints(" UP=Echo DN=No Echo UP=Hang Up DN=Keep Connect");
- prints(" 5...Auto Answer 10...Power-on Software Defaults ");
- prints(" UP=AA 1st ring DN=No AA UP=Use NRAM DN=Use ROM ");
- prints(" ");
- prints(" Quad Switch: Send/Receive UP=Pin2 Xmit/Pin3 Rcv DN=Pin2 Rcv/Pin3 Xmit");
- return(CONT_OK);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to write to NRAM //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- write_nram()
- {
- str input[1];
-
- clear_scr();
- prints("WRITING CHANGES TO NRAM MAY CHANGE YOUR POWER-UP MODEM DEFAULTS.");
- gotoxy(1,3);
- printsc("Do you wish to continue (Y/N): ");
-
- while (1)
- {
- gotoxy(31,3);
- gets(input,1);
- if (input == "y" or input == "Y")
- break;
- if (input == "n" or input == "N")
- return(CONT_OK);
- tone(400,50);
- }
-
- cputs("AT&W^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- return(nram_set());
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to perform PC to Modem interface test //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- interface_test()
- {
- clear_scr();
- prints("PC/MODEM INTERFACE TEST: If the Modem/PC Interface is functional,");
- prints("the modem will respond with 'OK'...");
- delay_scr(50);
- cputs("AT^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to perform Analog Loopback/Dial Frequency test //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- analog_loop()
- {
- clear_scr();
- prints("ANALOG LOOPBACK SELF-TEST AND DIAL FREQUENCY TEST: The HST will");
- prints("modulate and demodulate its own internal test pattern and return");
- prints("the pattern to the scree. The first step, upon success, will");
- prints("display 'CONNECT 2400'. The second step will display 'NO CARRIER'.");
- cputs("AT&M0S16=5D^M");
- if (not waitfor("CONNECT 2400",20)) return(TIME_OUT);
- prints(" ");
- prints("-- Step 1 OK");
- delay_scr(30);
- cputs("X");
- if (not waitfor("NO CARRIER",20)) return(TIME_OUT);
- prints(" ");
- prints("-- Step 2 OK");
- cputs("AT&M4S16=0^M");
- if (waitfor("OK",20))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to perform Analog Loopback/Answer Frequency test //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- freq_test()
- {
- clear_scr();
- prints("ANALOG LOOPBACK SELF-TEST AND ANSWER FREQUENCY TEST: The HST will");
- prints("modulate and demodulate its own internal test pattern and return");
- prints("the pattern to the scree. The first step, upon success, will");
- prints("display 'CONNECT 2400'. The second step will display 'NO CARRIER'.");
- cputs("AT&M0S16=5A^M");
- if (not waitfor("CONNECT 2400",20)) return(TIME_OUT);
- prints(" ");
- prints("-- Step 1 OK");
- delay_scr(30);
- cputs("X");
- if (not waitfor("NO CARRIER",20)) return(TIME_OUT);
- prints(" ");
- prints("-- Step 2 OK");
- cputs("AT&M4S16=0^M");
- if (waitfor("OK",20))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to reset HST data modes & error control //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- data_mode()
- {
- clear_scr();
- prints("RESET STANDARD HST DATA MODE. This function will reset the HST");
- prints("modem error control and data mode defaults for normal operation.");
- prints(" ");
- cputs("AT&M4S16=0^M");
- if (waitfor("OK",20))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to set PCBoard defaults //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- pcboard_def(str rom_level)
- {
- str input[1];
-
- clear_scr();
- flushbuf();
- prints("MODEM SWITCH SETTINGS FOR PCBOARD 14.X HOST OPERATIONS");
- prints(" ");
- prints(" ▄ ▄ ");
- prints(" ┌──────┐┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐");
- prints(" UP│██████││█│█│ │ │ │█│█│ │█│█│");
- prints(" DN│ ││ │ │█│█│█│ │ │█│ │ │");
- prints(" └──────┘└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘");
- prints(" ▀ ▀ 1 2 3 4 5 6 7 8 9 10");
- prints(" ");
- prints("NOTE: Switch 7 setting may be changed if you are running");
- prints(" a multi-phone operation");
- prints(" ");
- prints("NOTE: Do NOT change the modem's switch settings at this time.");
- prints(" Once the script has erminated and all internal parameters");
- prints(" have been set and written to non-volatile RAM (NRAM),");
- prints(" terminate Telix via the ALT-X command, power off the");
- prints(" HST modem, set the switches to match the diagram above,");
- prints(" and power the modem back on. The new switch settings");
- prints(" will then go into effect.");
- prints(" ");
- printsc("Press <Enter> to continue with other modem parameters");
- gets(input,1);
- clear_scr();
- prints("This function will set all modem operational parameters and");
- prints("S-Registers to their optimum values for 19200 bps operation");
- prints("when using PCBoard 14.x software. The settings implemented");
- prints("via this option are consistent with the HST settings used by");
- prints("Clark Development's PCBMODEM program.");
- return(set_def(rom_level,1));
- }
-
- telix_def(str rom_level)
- {
- str input[1];
-
- flushbuf();
- clear_scr();
- prints("MODEM SWITCH SETTINGS FOR TELIX 3.11 ORIGINATE OPERATIONS");
- prints(" ");
- prints(" ▄ ▄ ");
- prints(" ┌──────┐┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐");
- prints(" UP│██████││█│█│ │ │ │█│█│ │ │█│");
- prints(" DN│ ││ │ │█│█│█│ │ │█│█│ │");
- prints(" └──────┘└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘");
- prints(" ▀ ▀ 1 2 3 4 5 6 7 8 9 10");
- prints(" ");
- prints("NOTE: Do NOT change the modem's switch settings at this time.");
- prints(" Once the script has erminated and all internal parameters");
- prints(" have been set and written to non-volatile RAM (NRAM),");
- prints(" terminate Telix via the ALT-X command, power off the");
- prints(" HST modem, set the switches to match the diagram above,");
- prints(" and power the modem back on. The new switch settings");
- prints(" will then go into effect.");
- prints(" ");
- printsc("Press <Enter> to continue with other modem parameters");
- gets(input,1);
- clear_scr();
- prints("This function will set all modem operational parameters and");
- prints("S-Registers to their optimum values for 19200 bps operation");
- prints("when using Telix 3.11 in originate mode.");
- return(set_def(rom_level,0));
- }
-
- set_def(str rom_level, int do_pcbdef)
- {
- str input[1];
- int xpos, ypos;
-
- prints(" ");
- prints("You May chose the 'FAST' method which will set all parameters");
- prints("at once without any accompanying display, or the 'SLOW' method");
- prints("which walks you throught the process one parameter at a time.");
- prints("The SLOW method may take a couple minutes to complete.");
- prints(" ");
- printsc("Type 'F' for FAST method, 'S' for SLOW, <Enter>=cancel: ");
- xpos = getx();
- ypos = gety();
- while (1)
- {
- gotoxy(xpos,ypos);
- gets(input,1);
- if (input == "")
- return(CONT_OK);
- else if (input == "f" or input == "F")
- {
- if (do_pcbdef)
- return(fast_set_pcb(rom_level));
- else
- return(fast_set_telix(rom_level));
- }
- else if (input == "s" or input == "S")
- return(slow_set(rom_level,do_pcbdef));
- else
- tone(400,50);
- }
- }
-
- slow_set(str rom_level, int do_pcbdef)
- {
- clear_scr();
- prints("SET TRANSMITTER ENABLED : ATC1");
- cputs("ATC1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("SET COMMAND MODE ECHO OFF: ATE0");
- cputs("ATE0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("SET LOCAL ECHO OFF AFTER CONNECT: ATF1");
- cputs("ATF1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- if (do_pcbdef)
- {
- prints("DISABLE SPEAKER: ATM0");
- cputs("ATM0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- }
- else
- {
- prints("SET SPEAKER ON UNTIL CARRIER ESTABLISHED: ATM1");
- cputs("ATM1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- }
- clear_scr();
- prints("SET QUIET MODE OFF-RESULT CODES DISPLAYED: ATQ0");
- cputs("ATQ0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("SET RESULTS TO VERBAL MODE: ATV1");
- cputs("ATV1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("SET EXTENDED RESULT CODE OPTION: ATX6");
- cputs("ATX6^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("SET U.S. ANSWER SEQUENCE DEFAULT: ATB1");
- cputs("ATB1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-ENABLE ARQ RESULT CODE: AT&A1");
- cputs("AT&A1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-FIX DTE RATE: AT&B1");
- cputs("AT&B1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-XMIT DATA CTS HARDWARE FLOW CONTROL: AT&H1");
- cputs("AT&H1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-RCV DATA FLOW CONTROL DISABLED: AT&I0");
- cputs("AT&I0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- if (rom_level >= "964" or rom_level == "1440")
- {
- clear_scr();
- prints("EXTENDED FUNCTION (964)-DISABLE DATA COMPRESSION: AT&K0");
- cputs("AT&K0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- }
- clear_scr();
- prints("EXTENDED FUNCTION-ERROR CONTROL MODE NORMAL/ARQ: AT&M4");
- cputs("AT&M4^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-DATA RATE SET TO NORMAL LINK OPERATIONS: AT&N0");
- cputs("AT&N0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-SET PULSE DIAL MAKE/BREAK RATIO TO U.S.: AT&P0");
- cputs("AT&P0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-RCV DATA FLOW CONTROL->PASS ON RTS HIGH: AT&R2");
- cputs("AT&R2^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-MODEM CONTROLS DATA SET READY LINE: AT&S1");
- cputs("AT&S1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("EXTENDED FUNCTION-SEND DESTRUCTIVE, EXPEDITED BREAKS: AT&Y1");
- cputs("AT&Y1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- DISABLE AUTO ANSWER: ATS0=0");
- cputs("ATS0=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER-RESET INCOMING RING COUNT TO ZERO: ATS1=0");
- cputs("ATS1=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- if (do_pcbdef)
- {
- prints("S-REGISTER- SET ASCII ESCAPE CODE DEFAULT TO X'FF': ATS2=255");
- cputs("ATS2=255^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- }
- else
- {
- prints("S-REGISTER- SET ASCII ESCAPE CODE DEFAULT TO '+': ATS2=43");
- cputs("ATS2=43^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- }
- clear_scr();
- prints("S-REGISTER- SET ASCII CARRIAGE RETURN TO 13: ATS3=13");
- cputs("ATS3=13^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET ASCII LINE FEED TO 10: ATS4=10");
- cputs("ATS4=10^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET ASCII BACKSPACE TO 8: ATS5=8");
- cputs("ATS5=8^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET #SECONDS MODEM WAITS BEFORE DIALING T0 2: ATS6=2");
- cputs("ATS6=2^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET #SECONDS MODEM WAITS FOR CARRIER TO 30: ATS7=30");
- cputs("ATS7=30^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET DURATION OF PAUSE (,) TO 2/10TH SECOND: ATS8=2");
- cputs("ATS8=2^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- REQUIRED DURATION OF REMOTE CARRIER 6/10TH SEC: ATS9=6");
- cputs("ATS9=6^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- HANG UP 5 SEC AFTER LOSS OF CARRIER: ATS10=50");
- cputs("ATS10=50^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- TOUCH-TONE DURATION AND SPACING IS 70 MILLISECS: ATS11=70");
- cputs("ATS11=70^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- ESCAPE CODE SEQUENCE GUARD TIME IS 50 MICSSECS: ATS12=50");
- cputs("ATS12=50^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET BIT-MAPPED REGISTER TO ZERO: ATS13=0");
- cputs("ATS13=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET SELF-TEST REGISTER TO DATA MODE (NO TEST): ATS16=0");
- cputs("ATS16=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET ARQ LINK DISCONNECT REASON REGISTER TO ZERO: ATS17=0");
- cputs("ATS17=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- if (do_pcbdef)
- {
- prints("S-REGISTER- SET INACTIVITY TIMER TO FIVE MINUTE AUTO HANGUP: ATS19=5");
- cputs("ATS19=5^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- }
- else
- {
- prints("S-REGISTER- SET INACTIVITY TIMER TO ZERO (NO AUTO HANGUP): ATS19=0");
- cputs("ATS19=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- }
- clear_scr();
- prints("S-REGISTER- SET NO CARRIER REASON CODE REGISTER TO ZERO: ATS20=0");
- cputs("ATS20=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET LENGTH OF BREAKS TO 100 MILLISECONDS: ATS21=10");
- cputs("ATS21=10^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET ASCII VALUE OF XON TO 17: ATS22=17");
- cputs("ATS22=17^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- clear_scr();
- prints("S-REGISTER- SET ASCII VALUE OF XOFF TO 19: ATS23=19");
- cputs("ATS23=19^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- return(write_parms());
- }
-
- fast_set_telix(str rom_level)
- {
- clear_scr();
- prints("SENDING TELIX SETUP PARAMETERS TO HST MODEM.......");
- prints(" ");
- cputs("AT C1 E0 F1 M1 Q0 V1 X6 B1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT &A1 &B1 &G0 &H1 &I0 ^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- if (rom_level >= "964" or rom_level == "1440")
- cputs("AT &K0");
- else
- cputs("AT");
- cputs(" &M4 &N0 &P0 &R2 &S1 &Y1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S0=0 S1=0 S2=43 S3=13 ^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S4=10 S5=8 S6=2 S7=60 S8=2 ^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S9=6 S10=7 S11=70 S12=50 ^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S13=0 S16=0 S17=0 ^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S19=0 S20=0 S21=10 S22=17 S23=19^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- return(write_parms());
- }
-
- fast_set_pcb(str rom_level)
- {
- clear_scr();
- prints("SENDING PCBOARD SETUP PARAMETERS TO HST MODEM.......");
- prints(" ");
- cputs("AT C1 E0 F1 M0 Q0 V1 X6 B1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT &A1 &B1 &G0 &H1 &I0 &M4 ^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- if (rom_level >= "964" or rom_level == "1440")
- cputs("AT &K0");
- else
- cputs("AT");
- cputs(" &N0 &P0 &R2 &S1 &Y1^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S0=0 S1=1 S2=255 S3=13^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S4=10 S5=8 S6=2 S7=30 S8=2^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S9=6 S10=7 S11=70 S12=50^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S13=0 S16=0 S17=0^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- cputs("AT S19=5 S20=0 S21=10 S22=17 S23=19^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- delay_scr(20);
- return(write_parms());
- }
-
- write_parms()
- {
- str input[1];
-
- clear_scr();
- prints("ALL DEFAULTS HAVE BEEN SET....");
- prints(" ");
- prints("Y to write defaults to NRAM");
- prints("N to cancel");
- gotoxy(1,5);
- printsc("Type Y/N and (Enter) ");
- while (1)
- {
- gotoxy(22,5);
- gets(input,1);
- if (input == "n" or input == "N")
- return(CONT_OK);
- else if (input == "y" or input == "Y")
- break;
- else
- tone(400,50);
- }
-
- cputs("AT&W^M");
- if (not waitfor("OK",10)) return(TIME_OUT);
- clear_scr();
- prints("If you changed switch settings 2,3,4,5 OR 9, a hardware reset");
- prints("must be performed for the new switch settings to go into effect.");
- prints("(hardware reset can be done now or later via power-off/power-on).");
- prints(" ");
- printsc("Do you wish a hardware reset to be performed now (Y/N): ");
-
- while (1)
- {
- gotoxy(56,4);
- gets(input,1);
- if (input == "n" or input == "N")
- return(CONT_OK);
- else if (input == "y" or input == "Y")
- break;
- else
- tone(400,50);
- }
-
- clear_scr();
- prints("RESETTING HARDWARE TO NRAM AND NEW SWITCH SETTINGS");
- cputs("ATZ^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to disable MNP level 5 data compression //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- disable_comp()
- {
- clear_scr();
- printsc("DISABLE MNP LEVEL 5 DATA COMPRESSION - AT&K0");
- cputs("AT&K0^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to auto enable/disable MNP level 5 data compression //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- auto_comp()
- {
- clear_scr();
- printsc("AUTO ENABLE/DISABLE MNP LEVEL 5 DATA COMPRESSION - AT&K1");
- cputs("AT&K1^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to enable MNP level 5 data compression //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- enable_comp()
- {
- clear_scr();
- printsc("FORCE ENABLE MNP LEVEL 5 DATA COMPRESSION - AT&K2");
- cputs("AT&K2^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function displays Modem Configuration Inquiry screen //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- modem_inq()
- {
- clear_scr();
- printsc("MODEM CONFIGURATION INQUIRY SCREEN - ATI7");
- printsc(" ");
- cputs("ATI7^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function sets the S13 register //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- set_s13reg()
- {
- str input[1];
- str new_value[3];
-
- clear_scr();
- prints("ROM LEVEL 964+ - S-REGISTER 13 SETTINGS");
- prints("S-register 13 controls certain little used features of the HST Modem");
- prints("Each bit in the register controls a modem feature or function,");
- prints("as shown below. The corresponding bit value precedes each feature");
- prints("description. To select a feature, add its bit value to the total");
- prints("and store the total in the register. The max S13 value is 223,");
- prints("(1+2+4+8+16+64+128)");
- prints(" ");
- prints("Bit value 1: Reset on dropping of DTR");
- prints("Bit value 2: Auto-answer in originate mode");
- prints("Bit value 4: Disable result code pause");
- prints("Bit value 8: DS0 on DTR low-to-high");
- prints("Bit Value 16: DS0 on power-up & ATZ");
- prints("Bit Value 32: reserved");
- prints("Bit Value 64: Disable MNP level 3");
- prints("Bit Value 128: Watchdog hardware reset");
- prints(" ");
- prints("NOTE: Please refer to your HST manual for aditional information");
- prints(" on the above features and S13-register settings");
- prints(" ");
- printsc("Do you wish to change the value of S-register 13 (Y/N)? ");
- gets(input,1);
- if (input != "y" and input != "Y")
- return(CONT_OK);
- gotoxy(0,21);
- prints("New total bit value for S-register 15 (0-223) or <Enter> to cancel: ");
- while (1)
- {
- gotoxy(68,21);
- gets_lead0(new_value,3);
- if (new_value == "")
- return(CONT_OK);
- else if (new_value >= "0" and new_value <= "223" and num_str(new_value))
- break;
- tone(400,50);
- }
- clear_scr();
- printsc("SETTING NEW S-REGISTER 13 VALUE - ATS13=");
- prints(new_value);
- cputs("ATS13=");
- cputs(new_value);
- cputs("^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function sets the S15 register //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- set_s15reg()
- {
- str input[1];
- str new_value[3];
-
- clear_scr();
- prints("ROM LEVEL 964+ - S-REGISTER 15 SETTINGS");
- prints("S-register 15 controls many of the level 964 ROM features. Each bit");
- prints("in the register controls a modem feature or function, as shown below");
- prints("The corresponding bit value precedes each feature description.");
- prints("To select a feature, add its bit value to the total and store the");
- prints("the total in the register. The max S15 value is 255 (128+64+16+8+2+1).");
- prints(" ");
- prints("Bit value 1: disable extra high-frequency equalization");
- prints("Bit value 2: disable 7200/4800bps online fallback");
- prints("Bit value 4: force 300bps back channel");
- prints("Bit value 8: use 128-byte buffer in non-MNP operation");
- prints("Bit Value 16: disable MNP Level 4");
- prints("Bit Value 32: set DEL as backspace key");
- prints("Bit Value 64: Unusual MNP incompatibility");
- prints("Bit Value 128: Interbridge network compatibility");
- prints(" ");
- prints("NOTE: Please refer to your HST manual for aditional information");
- prints(" on the above features and S15-register settings");
- prints(" ");
- printsc("Do you wish to change the value of S-register 15 (Y/N)? ");
- gets(input,1);
- if (input != "y" and input != "Y")
- return(CONT_OK);
- gotoxy(0,21);
- prints("New total bit value for S-register 15 (0-255) or <Enter> to cancel: ");
- while (1)
- {
- gotoxy(68,21);
- gets_lead0(new_value,3);
- if (new_value == "")
- return(CONT_OK);
- else if (new_value >= "0" and new_value <= "255" and num_str(new_value))
- break;
- tone(400,50);
- }
- clear_scr();
- printsc("SETTING NEW S-REGISTER 15 VALUE - ATS15=");
- prints(new_value);
- cputs("ATS15=");
- cputs(new_value);
- cputs("^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to list/set Modem link rate settings //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- set_rate()
- {
- str input[1];
- str new_rate[4];
-
- clear_scr();
- prints("MODEM LINK RATE SETTINGS - AT&Nx");
- prints(" ");
- prints("This command allows you to set the modem LINK rate (the data rate ");
- prints("on the modem-modem connection) to a FIXED value between 300bps and");
- prints("14,400bps. Normally, the default (&N0) allows the modem to adapt its");
- prints("rate to that of the receiving modem. Forcing a fixed link rate ");
- prints("will cause your modem to disconnect if the other modem is not set ");
- prints("at the same rate. Unless you have a need for this feature, use of ");
- prints("the default value is recommended.");
- prints(" ");
- prints("Do you want to change the modem's link rate setting (Y/N): ");
- gotoxy(59,10);
- gets(input,1);
- if (input != "y" and input != "Y")
- return(CONT_OK);
- clear_scr();
- prints("CHANGE LINK RATE SETTING - AT&Nx");
- prints(" ");
- prints("0=set link rate to DEFAULT - AUTO SPEED DETECT");
- prints("1=set link rate to 300bps");
- prints("2=set link rate to 1200bps");
- prints("3=set link rate to 2400bps");
- prints("4=set link rate to 4800bps");
- prints("5=set link rate to 7200bps");
- prints("6=set link rate to 9600bps");
- prints("7=set link rate to 12K bps");
- prints("8=set link rate to 14.4K bps");
- gotoxy(0,12);
- prints("Enter new link rate value (0-8) or <Enter> to cancel: ");
- while (1)
- {
- gotoxy(53,10);
- gets(input,1);
- if (input == "")
- return(CONT_OK);
- else if (input == "0")
- {
- new_rate = "Auto";
- break;
- }
- else if (input == "1")
- {
- new_rate = "300";
- break;
- }
- else if (input == "2")
- {
- new_rate = "1200";
- break;
- }
- else if (input == "3")
- {
- new_rate = "2400";
- break;
- }
- else if (input == "4")
- {
- new_rate = "4800";
- break;
- }
- else if (input == "5")
- {
- new_rate = "7200";
- break;
- }
- else if (input == "6")
- {
- new_rate = "9600";
- break;
- }
- else if (input == "7")
- {
- new_rate = "12000";
- break;
- }
- else if (input == "8")
- {
- new_rate = "14400";
- break;
- }
- tone(400,50);
- }
-
- clear_scr();
- printsc("SETTING NEW LINK RATE TO ");
- printsc(new_rate);
- printsc(" bps: AT&N");
- prints(input);
- cputs("AT&N");
- cputs(input);
- cputs("^M");
- if (waitfor("OK",10))
- return(CONT_OK);
- else
- return(TIME_OUT);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to display/set RAM-stored phone numbers //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- disp_phone()
- {
- str num0[36];
- str num1[36];
- str num2[36];
- str num3[36];
- str change_num[1];
- str new_num[36];
-
- while (1)
- {
- num0 = "";
- num1 = "";
- num2 = "";
- num3 = "";
- clear_scr();
- printsc("RAM-STORED NUMBERS (BLANK INDICATES NO NUMBER STORED)");
- gotoxy(0,2);
- flushbuf();
- cputs("AT&Z0?^M");
- get_num(num0);
- flushbuf();
- cputs("AT&Z1?^M");
- get_num(num1);
- flushbuf();
- cputs("AT&Z2?^M");
- get_num(num2);
- flushbuf();
- cputs("AT&Z3?^M");
- get_num(num3);
-
- printsc("NUMBER 0: ");
- prints(num0);
- printsc("NUMBER 1: ");
- prints(num1);
- printsc("NUMBER 2: ");
- prints(num2);
- printsc("NUMBER 3: ");
- prints(num3);
-
- gotoxy(0,10);
- printsc("Number to change (0-3) or (Enter) to leave unchanged: ");
- while (1)
- {
- gotoxy(54,10);
- gets(change_num,1);
- if (change_num == "")
- return(CONT_OK);
- else if (change_num >= "0" and change_num <= "3")
- break;
- tone(400,50);
- }
-
- gotoxy(0,12);
- printsc("Enter new number (36 pos.max.) ____________________________________");
- gotoxy(31,12);
- gets(new_num,36);
- cputs("AT&Z");
- cputs(change_num);
- cputs("=");
- cputs(new_num);
- cputs("^M");
- gotoxy(0,16);
- printsc("New number has been stored in RAM at position ");
- prints(change_num);
- delay_scr(20);
- }
- }
-
- get_num(str number)
- {
- int i, chr;
- str temp[5];
-
- chr = cgetct(100);
- if (chr != 13)
- prints("ERROR: Expecting CR");
- chr = cgetct(100);
- if (chr != 10)
- prints("ERROR: Expecting LF");
-
- for (i = 0; i < 36; ++i)
- {
- chr = cgetct(100);
- if (chr == 13 or chr == -1)
- {
- delay(10);
- return();
- }
- else
- setchr(number,i,chr);
- }
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to get input number with leading zeros //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- gets_lead0(str result,int digits)
- {
-
- gets(result,digits);
- if (result == "")
- return(0);
- while (strlen(result) < digits)
- inschrs("0",result,0,1);
-
- }
-
- ////////////////////////////////////////////////////////////////////////
- // //
- // Function to test if a string is all numeric //
- // //
- ////////////////////////////////////////////////////////////////////////
-
- num_str(str teststr)
- {
- int i;
-
- for (i=0; i < strlen(teststr); ++i)
- if (not isdigit(subchr(teststr,i)))
- return(0);
- return(1);
- }