亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ltmodem.c

?? 話帶數(shù)據(jù)中傳真解調(diào)程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 *	$Id: ltmodem.c,v 1.7 1999/12/19 21:52:09 root Exp root $
 *
 *	Lucent modem diagnostics tool.
 *
 *  Copyright (c) 1999 Richard J.M. Close
 *  Copyright (c) 1999 Pavel Machek <pavel@suse.cz>
 *  Copyright (c) 1999 Jamie Lokier
 *
 *	Can be freely distributed and used under the terms of the GNU GPL.
 */

#include "ltmodem.h"

//void show_modem(void); ??

// Include the DSP code.
#include "dsp.c"

// Main program.

int main(int argc, char **argv)
{

  char c;
  sync();	// it's for your own protection!
  setvbuf(stdout, NULL, _IONBF, 0);

  puts("ltmodem version " LTMODEM_VERSION);

  // Try to find an ISA modem.
  init_isa();
  if (!isapnp_modem)
	// No ISA modem found so try PCI.
    init_pci();

#if TRY_INTERRUPTS
  // Open the IRQ device node for reading.
  irq_dev = fopen(IRQ_DEV, "r");
  if (irq_dev) {
	printf ("Opened %s for reading.\n", IRQ_DEV);
	// Set up bb threads.
	bb_threads_stacksize(65536);
	bb_threads_shared_sighandlers(0);
	bb_threads_mutexcreate(0);
	bb_threads_mutexcreate(1);

	interrupt_enabled = 1;
	modem_enabled = 0;
	bb_threads_lock(1);
	irq_pid = bb_threads_newthread(catch_interrupts, NULL);
	printf("Spawned interrupt handler thread pid= %d\n", irq_pid);

	bb_threads_unlock(1);
  }
  else
	printf ("Failed to open %s.\n", IRQ_DEV);
  
#endif


  /* If modem is found then it sets modem_dev to device structure
     for modem, and modem =1 */
  if ( (!isapnp_modem) && !find_modem() ) {
    printf ("Sorry, no Lucent PCI modem that I know of was found.\n");
    printf ("If you have one fitted then please mail me with the details\n");
    printf ("at: richard@close.u-net.com please include an output from\n");
    printf ("cat /proc/pci and as much info. on the card as possible.\n");
    printf ("If you have an ISA modem please see README.ISA.\n");
    exit(1);
  }

  while ((c = getopt(argc, argv, "zimovtrhpd:uc" )) != -1) {
    switch(c) {
    case 'z':
      show_modem();
      setup_irq();
	  io_init();
      break;
    case 'i':
      show_modem();
      main_menu();
      break;
    case 'c':
      command_mode();
      break;
    case 't':
      show_modem();
      setup_irq();
      io_init();
      hangup();
      break;
    case 'r':
      show_modem();
      setup_irq();
      io_init();
      hangup();
      waitForCall();
      break;
    case 'u':	/* Full duplex transmit/receive */
      //      show_modem();
      setup_irq();
      io_init();
      voice_init();
      dp_offhook_cmd();
      voice_transmit(-1);
      die( "Should be unreachable\n" ); // ???
      break;
    case 'd':
      show_modem();
      setup_irq();
      io_init();
	  dp_update_modem_options();

	  // Turn speaker on, and set volume to max.
      setSpeaker(true, 3);

	  /*{ // Keep an eye on how long going offhook takes!
		unsigned short my_timer;
		my_timer = x_current_time(); */
	  dp_offhook_cmd();
		/* printf ("dp_offhook_cmd took %dmS.\n", x_elapsed_time(my_timer));
		}*/

	  // Initialise the dial state.
	  bodge_init_dial();

#if WAIT_FOR_DIALTONE
      // Wait for dial tone.
      printf( "Waiting for dialtone... ");
	  if (waitForDialTone())
		printf("got it!\n");
	  else {
		printf("no dial tone detected, is the phone plugged in?\n");
        hangup();
		break;
	  }
#endif

      // Dial how you want.
      printf( "About to dial %s: ...", optarg );
      dial(optarg);
      printf( " done.\n");
	
#if WAIT_FOR_ANSWER  
	  { 
		unsigned short local_timer;
        bool modemDetected = false;
        bool lineBusy = false;

		// Set up for call related detection.
		bodge_after_dial_init();

		dp_answer_state = 0;

		local_timer = x_current_time();

		// Set up tone detection.
		dp_detect_tones_cmd();

		// Busy tone detection will not work if this is set!
		S_data_calling_tone = false;

		// Wait until busy tone detected or answer tone detected or 10 seconds has expired.
		while (x_elapsed_time(local_timer) < 10000) {

		  if (dp_busy_tone_detected()) {
			lineBusy = true;
		  	break;
		  }
		  if (x_elapsed_time(local_timer) > 1000)
			// After 1 sec. also check for answer.
			if (dp_answer_tone_detected()) {
			  printf("Answer detected.\n");
			  modemDetected = true;
			  break;
			}
		}
		if (modemDetected)
		  // Set up modem data connection.
		  connect_to_modem();
		else if (lineBusy){
		  printf("The line is busy! hanging up...\n");
		  hangup();
		}
		else
		  printf("No answer tone, bummer!\n");
	  }
#endif
	  
#if HANGUP_AFTER_DIAL
	  // Delay before hanging up, make this long enough to hear
	  // any response from line when messing around with dialling.
	  sleep(5);

      printf( "About to hangup\n" );
	  hangup();
#endif
      break;

    case 'o':
      show_modem();
      setup_irq();
      io_init();
      big_init();
      voice_init();
      printf("Ready\n" );
      dp_offhook_cmd();
      dp_pulse_dial_cmd(3);	/* How do you prove that number PI does not exist? */
      dp_pulse_dial_cmd(1);	/* You take telephone and dial 3 1 4 1 5 9 2 6 5 4 */
      dp_pulse_dial_cmd(4);	/* and then you hear ta da da called number does */
      dp_pulse_dial_cmd(1);	/* not exist. (It works in Prague at least :-) */
      dp_pulse_dial_cmd(5);
      dp_pulse_dial_cmd(9);
      dp_pulse_dial_cmd(2);
      dp_pulse_dial_cmd(6);
      dp_pulse_dial_cmd(5);
      dp_pulse_dial_cmd(4);
      dp_DTMF_dial_cmd(1);
#if 0
      sleep(1);
      dp_synth_ring_init();
      sleep(1);
      dp_synth_ring_on();
      sleep(1);
      dp_synth_ring_off();
#endif
      sleep(1);

#if 1
      printf( "Staring tad\n" );
      dp_start_tad(0xf0);
      expect_irqs();
#endif

#if 0
      printf( "X_output(13)\n" );
      x_output(0x13);
      expect_irqs();
      x_output(0x1a);
      printf( "Should be ready?\n" );
#endif
      expect_irqs();
      printf( "Should dial 2\n" );
      dp_DTMF_dial_cmd(2);
      expect_irqs();
#if 0
      printf( "Really should dial 2\n" );
      dp_offhook_cmd();
      dial("2");
      expect_irqs();
#endif
#if 0
      expect_irqs();
      printf( "init hdsp\n" );
      dp_init_hdsp();
      expect_irqs();
      printf( "Starting speakerphone\n" );
      dp_start_hdsp();
      expect_irqs();
      printf( "Switching fdsp\n" );
      dp_switch_fdsp();
      expect_irqs();
      {
	  int i = 0;
	  for (i = 0; i<5; i++) {
	    dp_mute_fdsp(1);
	    sleep(1);
	    dp_mute_fdsp(0);
	    sleep(1);
	  }
      }
      printf( "Stop fdsp:\n" );
      dp_stop_fdsp();
      sleep(3);
      printf( "About to hangup.\n" );
      dp_onhook_cmd();
      /* go_offhook(); -- seems to do something slightly different */
      /* dp_download_fax(); */
#endif
      break;
    case 'm':
      continous_monitoring(3, 1000);
      break;
    case 'p':
      pulseDial = true;
      break;
    case 'v':
      verbose++;
      break;
    case 'h':
    default:
      printf( "Usage: ltmodem [-imovthpd]\n" );
      printf( "-i interative use.\n-m monitoring ports/registers.\n");
      printf( "-o prove PI does not exist and turn modem into microwave owen.\n");
      /* -o is really meant for debugging only, and it does strange
         things. Not a toy for people who read help. It does different
         things in every release. */
      printf( "-v increase level of verbosity.\n");
      printf( "-t basic test, display checksum etc. then hangup.\n");
      printf( "-r receive call, initialises modem then waits for incoming call.\n");
      printf( "-c enter command mode, read commands from fd#3.\n");
      printf( "-u put phone offhook, then start transmitting data from stdin\n"
	      "   and receive data from modem to stdout. You _must_ provide data on stdin\n" );
      printf( "-p enable Pulse dialling, default is Tone.\n");
      printf( "-d dial the specified number.\n");
      printf( "-h print this message!\n");
      goto exit;
    }
  }
  exit:

#if TRY_INTERRUPTS
  // Request termination.
  interrupt_enabled = 0;
  // Close device node;
  if (irq_dev)
	fclose(irq_dev);
  else {
   printf("Cannot close IRQ device as it is not open!.\n");
   printf("Have you done: 'modprobe usirq' ?.\n");
  }
  kill(irq_pid, SIGQUIT);

  // Clean up the thread.
  bb_threads_cleanup(wait(NULL));
#endif

  if (isapnp_modem)
    cleanup_isa();

  else
    cleanup_pci();


  return 0;
}

void command_mode(void)
{
  char buf[10240];
  FILE *cmd = fdopen(3, "r");

  fprintf(stderr, "PROTOCOL 0.0\n" );
  fprintf(stderr, "SWVERSION ltmodem " LTMODEM_VERSION "\n" );
  //  show_modem();
  setup_irq();
  io_init();
  voice_init();
  dp_update_modem_options();

  fprintf(stderr, "HWVERSION mars V%x.%x (rom checksum %x)\n",
		  x_chip_version, dp_version, rom_checksum );
  //fprintf(stderr, "+ Command mode ready\n" );

  while (fgets(buf, 10235, cmd) != NULL) {
    fprintf(stderr, "# Got command %s\n", buf );

    if (!strncmp(buf, "help", 4) || (buf[0] == '?')) {
      fprintf(stderr, "Available commands:
   help         Displays command summary.
   ?            Same as help.
   quit         Exit command mode back to shell.
   exit         Guess what! (yes the same as quit).
   onhook   	Go onhook.
   offhook      Go offhook.
   dial	xxx     Dial the number xxx.
   duplex       Perform duplex voice transmission.
   ringin       Wait for a call to come in.
   reset        Hang up and reset the modem.
   speaker on	Turn internal speaker on.
   speaker off	Turn internal speaker off.
" );

    } else if (!strncmp(buf, "onhook", 6)) {
      dp_onhook_cmd();
      fprintf(stderr, "+ OK\n" );

    } else if (!strncmp(buf, "offhook", 7)) {
      dp_offhook_cmd();
      fprintf(stderr, "+ OK\n" );

    } else if (!strncmp(buf, "ringin", 6)) {
      waitForCall();
      fprintf(stderr, "+ OK\n" );

    } else if (!strncmp(buf, "expect dialtone", 15)) {
	  // Make sure we are off hook.
	  if (x_status[0] != 0) {
		fprintf(stderr, "- Error: You must go offhook first!\n" );
		continue;
	  }
	  // Initialise the dial state.
	  bodge_init_dial();
      // Wait for dial tone.
	  if (waitForDialTone())
		fprintf(stderr, "+ got dialtone OK\n" );
	  else
		fprintf(stderr, "- No dial tone detected, is the phone plugged in?\n");

    } else if (!strncmp(buf, "dial", 4)) {
	  // Make sure we are off hook.
	  if (x_status[0] != 0) {
		fprintf(stderr, "- Error: You must go offhook first!\n" );
		continue;
	  }
	  // Initialise the dial state.
	  bodge_init_dial();
	  dial(buf + 5);
	  fprintf(stderr, "# ringing... " );

#if WAIT_FOR_ANSWER  
	  // Set up for call related detection.
	  bodge_after_dial_init();

	  // Wait for answer tone.
	  if (waitForAnswerTone())

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩亚洲欧美中文三级| 91视频你懂的| 亚洲狼人国产精品| 精品av久久707| 91亚洲国产成人精品一区二三| 亚洲综合激情小说| 欧美成人精品福利| 国产在线精品视频| 一区二区在线看| 3atv一区二区三区| 风流少妇一区二区| 亚洲国产日韩精品| 欧美国产精品v| 欧美精品一区二区三区高清aⅴ | 96av麻豆蜜桃一区二区| 日本 国产 欧美色综合| 日韩理论电影院| 4438x成人网最大色成网站| 99国产精品视频免费观看| 奇米在线7777在线精品| 亚洲精品国产无套在线观| 91丨porny丨国产入口| 精品在线亚洲视频| 一区二区成人在线| 国产精品乱人伦一区二区| 欧美一区二区三区四区视频| 色综合久久中文综合久久97| 久久99国内精品| 丝袜美腿一区二区三区| 亚洲国产另类av| 国产精品三级电影| 精品不卡在线视频| 91丨porny丨国产入口| 成人免费毛片app| 国产一区二区在线免费观看| 日韩av中文字幕一区二区| 国产精品成人一区二区艾草 | 国产精品久久久久久户外露出 | 久草在线在线精品观看| 日韩在线卡一卡二| 一区二区三区在线观看动漫| 中文字幕av一区二区三区高 | 成年人国产精品| 极品少妇xxxx精品少妇| 青青草一区二区三区| 国产亚洲人成网站| 久久综合久久综合九色| 日韩一区二区三区四区| 在线观看av一区| 欧美美女黄视频| 欧美日本一区二区三区四区| 欧美视频一区二区三区| 欧美日韩卡一卡二| 欧美丰满美乳xxx高潮www| 欧美日韩国产天堂| 91网站黄www| 欧美日韩亚洲丝袜制服| 欧美影院一区二区三区| 欧美综合在线视频| 日韩一区二区在线看| 91精品福利在线一区二区三区| 欧美另类变人与禽xxxxx| 色综合久久久久久久久久久| 欧美剧情片在线观看| 一区二区三区在线免费视频| 亚洲欧美日韩一区| 亚洲电影一级片| 日韩电影网1区2区| 免费观看久久久4p| 极品少妇xxxx精品少妇| 99视频一区二区| 日本韩国欧美国产| 欧美色综合网站| 欧美日韩三级一区二区| 欧美一级欧美三级| 久久免费看少妇高潮| 国产精品欧美一区喷水| 亚洲欧美日韩中文播放| 亚洲成人免费视| 亚洲国产毛片aaaaa无费看| 日本欧美加勒比视频| 九一久久久久久| 国产99久久久国产精品免费看| 91捆绑美女网站| 884aa四虎影成人精品一区| 久久综合九色综合欧美98| 国产亚洲精久久久久久| 一区二区三区.www| 日本va欧美va精品| 国产99久久久国产精品| 欧美在线啊v一区| 精品久久久久久久久久久院品网 | 国产剧情在线观看一区二区| 国产 日韩 欧美大片| 色域天天综合网| 精品国产乱码久久| 亚洲欧美综合色| 日韩电影在线观看电影| 成人性生交大片| 欧美肥胖老妇做爰| 亚洲欧洲无码一区二区三区| 日韩精品国产精品| 成人福利视频在线| 欧美美女视频在线观看| 亚洲美女视频在线| 国产一区二区免费看| 91福利国产精品| 日韩欧美一区二区三区在线| 亚洲永久免费视频| 国产精品影视天天线| 在线观看视频91| 国产日韩欧美综合在线| 日韩极品在线观看| 一本色道a无线码一区v| 欧美一区二区三区思思人| 夜夜亚洲天天久久| 国产91精品入口| 日韩久久久精品| 日韩精品免费视频人成| 99久久精品免费看国产免费软件| 欧美一区二区三区白人| 一区二区在线观看免费视频播放 | 日本不卡在线视频| 91麻豆精品在线观看| 国产日韩欧美一区二区三区综合| 日韩高清在线不卡| 91精品国产综合久久久久久| 亚洲欧美电影一区二区| 国产精品一卡二卡| 欧美videofree性高清杂交| 中文字幕一区二区日韩精品绯色| 韩国v欧美v亚洲v日本v| 99热精品一区二区| 国产欧美日韩在线| 国产精一品亚洲二区在线视频| 欧美日韩不卡在线| 亚洲美女少妇撒尿| 一本色道久久综合精品竹菊| 国产亚洲精品免费| 久久99久久99精品免视看婷婷| 色94色欧美sute亚洲线路二| 国产精品久久夜| 性感美女久久精品| 欧美高清视频www夜色资源网| 日韩不卡在线观看日韩不卡视频| 欧美亚一区二区| 日韩在线一区二区三区| 日韩一区和二区| 国产毛片精品国产一区二区三区| 久久综合久久鬼色中文字| 国产精品一二一区| 中文字幕av不卡| 91激情在线视频| 午夜精品福利一区二区三区av| 91精品国产一区二区三区| 久久精品免费观看| 国产欧美日韩在线看| 91官网在线观看| 日韩影院精彩在线| 久久久精品天堂| 99久久精品99国产精品| 亚洲成人精品在线观看| 日韩欧美中文字幕制服| 国产综合成人久久大片91| 欧美高清一级片在线观看| 一本色道a无线码一区v| 日韩有码一区二区三区| 国产亚洲欧美一级| 在线看国产一区| 久久精品国内一区二区三区| 国产亲近乱来精品视频| 色猫猫国产区一区二在线视频| 亚洲国产精品自拍| 精品国产一区二区亚洲人成毛片 | 激情丁香综合五月| 国产精品国产成人国产三级| 欧美三级日韩三级| 国产乱人伦精品一区二区在线观看 | 色综合亚洲欧洲| 久久成人免费网站| 亚洲男人的天堂在线观看| 日韩午夜激情视频| 成人app软件下载大全免费| 天天av天天翘天天综合网| 久久久蜜桃精品| 欧洲av一区二区嗯嗯嗯啊| 国产一区免费电影| 亚洲一区二区三区美女| 亚洲精品一区二区三区99| 欧美午夜电影网| 懂色av一区二区三区免费看| 亚洲国产一区二区在线播放| 欧美国产日产图区| 91精品国产综合久久福利软件| 成人黄色a**站在线观看| 免费看欧美美女黄的网站| 亚洲综合色在线| 国产精品萝li| 久久久久久97三级| 91精品视频网|