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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fax.cpp

?? 支持XMODEM,YMODEM,FAX協議的串口通信軟件包
?? CPP
?? 第 1 頁 / 共 5 頁
字號:

    case Confirm:                           // confirm training check frame
         Display_Msg(10);                   // update the status
         rc = Send_Hmsg(FINAL,              // send the confirmation
                        FAX_FCF_CFR, 0);

         if (rc != 0)                       // q. confirmation go ok?
            {
            state = RcvError;               // a. no .. show the error
            continue;                       // .. continue processing
            }

         state = PhaseC;                    // start receiving FAX
         break;

    case PhaseC:                            // receive the FAX data
         rc = Data_Mode(RECEIVE, speed);    // start receiving the FAX

         if (rc != 0)                       // q. receive start ok?
            {
            state = RcvError;               // a. no .. show the error
            continue;                       // .. continue processing
            }

         Display_Msg(11);                   // update the status

         state = RcvPage;                   // receive a page of data

         dleflag = FALSE;                   // set no DLE seen yet

         pbi = 0;                           // reset  the page buffer index
         pagelen = 0;                       // .. and no page data yet

         fseek(faxfile, 0L, SEEK_END);      // go to end of file
         reclen = ftell(faxfile);           // .. save the position
         fwrite(&pagelen, 4, 1, faxfile);   // .. write the page's length
         break;

    case RcvPage:                           // receive 1 page of data
         rc = Get_Char(&c, 1);              // get a character

         if (rc != 0)                       // q. receive ok?
             {                              // a. no ..
             state = RcvError;              // .. declare an error
             continue;                      // .. and continue processing
             }

         pagebuf[pbi++] = c;                // save the character
         pagelen++;                         // increment bytes in page


         if (pbi == 1024)                   // q. buffer full?
             {                              // a. yes ..
             fwrite(pagebuf, 1024, 1,       // .. write out a page
                       faxfile);

             pbi = 0;                       // reset page buffer index
             }

         if (dleflag)                       // q. previous char DLE?
             {                              // a. yes ..
             dleflag = FALSE;               // .. reset the flag

             if (c == ETX)                  // q. DLE ETX sequence?
                 {                          // a. yes ..
                 state = EndPage;           // .. process end of page
                 Display_Msg(12);           // update the status
                 }
             }

         else if (c == DLE)                 // q. char a DLE?
             dleflag = TRUE;                // a. yes .. show true

         break;                             // continue processing

    case EndPage:                           // Page complete
         rc = wait_for(FAX_NO_CARR,         // we should now have no carrier
                       FAX_ERR, 5) - 1;

         if (pbi)                           // buffer contain data?
             fwrite(pagebuf, pbi, 1,        // a. yes.. write out a page
                       faxfile);

         fseek(faxfile, reclen, SEEK_SET);  // set postion to length record
         fwrite(&pagelen, 4, 1, faxfile);   // update the page's length
         fseek(faxfile, 0L, SEEK_END);      // .. return to end of file

         if (rc != 0)                       // q. correct response?
             {                              // a. no ..
             state = RcvError;              // .. declare an error
             continue;
             }

         state = PhaseD;                    // start post message procedure
         break;

    case PhaseD:                            // post message procedure
         rc = Rcv_Hmsg();                   // get the next message

         if (rc != 0)                       // q. correct response?
             {                              // a. no ..
             state = RcvError;              // .. declare an error
             continue;
             }

         i = hmsg.fax_ctl_fld;              // save the response

         rc = Send_Hmsg(FINAL,              // send the final frame
                        FAX_FCF_MCF, 0);    // .. message confirmation

         if (rc != 0)                       // q. correct response?
             {                              // a. no ..
             state = RcvError;              // .. declare an error
             continue;
             }

         switch(i)                          // based on the response..
            {
            case FAX_FCF_MPS:               // multi-page signal
                Display_Msg(13);            // update the status
                state = PhaseC;             // .. receive next page
                break;

            case FAX_FCF_EOM:               // end of message
                Display_Msg(14);            // update the status
                state = PhaseB;             // .. renegotiate & continue
                break;

            case FAX_FCF_EOP:               // end of procedure
                Display_Msg(15);            // update the status
                state = PhaseE;             // .. disconnect now
                break;

            case FAX_FCF_DCN:               // disconnect
                Display_Msg(16);            // update the status
                state = PhaseE;             // .. and hang up
                continue;

            default:
                state = RcvError;           // unknown response
                break;
            }

         break;                             // continue processing

    case PhaseE:                            // call is done .. disconnect
         cp->Write(FAX_HANGUP);             // hangup the modem
         state = ExitFax;                   // .. and exit the fax receive
         break;

    case RcvError:                          // error during receive
         Display_Msg(17);                   // update the status

         if (rc == -2)                      // q. user cancellation?
            {                               // a. yes ..
            state = UserCan;                // .. show the reason
            continue;                       // .. continue processing
            }

         else if (error)                    // q. error set?
             {                              // a. yes ..
             fs.f_ptr = fax_errors[error];  // .. set the message pointer
             (stat)(2, &fs);                // .. and display it
             }

         else if (rc == -1)                 // q. timeout?
             Display_Msg(20);               // a. yes .. show the message

         else if (rc == 1)                  // q. unexpected response?
             Display_Msg(21);               // a. yes .. tell the user

         state = ExitFax;                   // .. set new state
         break;

    case UserCan:                           // user cancelled transmission
         Display_Msg(18);                   // update the status
         state = ExitFax;                   // .. set new state
         break;

    case ExitFax:                           // exit FAX receive
         if (fileopen)                      // q. fax file open?
             fclose(faxfile);               // a. yes .. close the file

         Reset_Modem();                     // reset the modem

         loop = FALSE;                      // .. end the loop
         break;                             // .. and return to caller
    }
}



/* ********************************************************************
 *
 *  Send -- Send a Facsimile
 *
 * ******************************************************************** */

void Fax::Send(char *faxname,               // fax file name
               char *telno)                 // telephone number

{
int     rc = 0,                             // return code
        speed,                              // link speed
        nextspeed,                          // next link speed
        fileopen = FALSE,                   // receive file not open
        dis_received = FALSE,               // DIS not yet received
        i,                                  // work variable
        error = 0,                          // error number
        loop = TRUE;                        // loop until complete

FILE   *faxfile;                            // fax file

char    dis[16],                            // DIS received
        csi[21],                            // CSI received
        c,                                  // work character
        w;                                  // work register

ULONG   pagelen,                            // length of received page
        st;                                 // work for elapsed time

enum    SndStates                           // FAX send states
          {
          PhaseA,                           // phase A - make connection
          PhaseB,                           // get HDLC frames
          SetSpeed,                         // set the link speed
          SendTSI,                          // select speed, send ID & DCS
          SendTCF,                          // send the TCF
          GetConfTCF,                       // get TCF confirmation
          PhaseC,                           // send the document
          SendPage,                         // send a page of data
          PhaseD,                           // post message process
          AnotherPage,                      // another page to send
          AllSent,                          // send complete
          PhaseE,                           // disconnect
          SndError,                         // error during send
          UserCan,                          // user cancelled transmission
          ExitFax                           // exit FAX receive
          } state;

strcpy(fh.ff_id, "                    ");   // blank out the ID string
state = PhaseA;                             // start in Phase A

if ((faxfile = fopen(faxname, "rb"))        // q. send file open ok?
                    == NULL)
    {                                       // a. no ..
    error = 9;                              // .. set the error code
    state = SndError;                       // .. and declare an error
    }

fread(&fh, 128, 1, faxfile);                // read the header

if (strcmp(fh.ff_type, "G3"))               // q. G3 file?
    {                                       // a. no ..
    error = 13;                             // .. show invalid format
    state = SndError;                       // .. and declare an error
    }

fileopen = TRUE;                            // show the file is open

fread(&pagelen, 4, 1, faxfile);             // read in the first page length

while(loop)                                 // top of state machine
  switch(state)                             // perform next state
    {
    case PhaseA:                            // phase A - make connection
         Display_Msg(1);                    // update the status
         if ((rc = Init_Modem()) != 0)      // q. modem init ok?
             {
             error = 1;                     // a. no .. exit now
             state = SndError;              // .. declare the error
             continue;
             }

         Display_Msg(22);                   // update the status

         cp->Write(FAX_DIAL);               // send the dial command
         cp->Write(telno);                  // .. and the phone number
         cp->Write('\r');                   // .. and finish the command

         rc = wait_for(FAX_CONN,            // wait for a connection
                       FAX_NO_CARR, 120);

         if (--rc)                          // q. any error
             {                              // a. yes ..
             if (rc == 1)                   // q. connection fail?
                error = 10;                 // a. yes .. show connect failed

             state = SndError;              // declare an error
             continue;                      // .. go to next state
             }

         state = PhaseB;                    // get frames
         connected = TRUE;                  // ... show we are connected
         break;

    case PhaseB:                            // get HDLC frames
         if ((rc = Rcv_Hmsg()) != 0)        // q. any error getting a frame?
             if (rc < 0)                    // a. yes .. timeout or ESC?
                 {                          // a. yes ..
                 error = 3;                 // .. error receiving HDLC frame
                 state = SndError;          // .. leave with error.
                 continue;                  // .. continue process
                 }
             else                           // else .. NO CARRIER
                 {
                 cp->Write(FAX_SILENT1);    // wait for 200ms silence

                 rc = wait_for(FAX_OK,      // wait for the OK response
                               FAX_ERR,
                               10) - 1;

                 state = SetSpeed;          // .. and set the speed
                 }

         if (rc)                            // q. any error yet?
             {                              // a. yes ..
             state = SndError;              // .. declare an error
             continue;
             }

         switch(hmsg.fax_ctl_fld)           // process based on message type
          

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色八戒一区二区三区| 精品少妇一区二区三区在线视频| 91麻豆精品国产91| 亚洲国产经典视频| 蜜桃av一区二区| 91国产丝袜在线播放| 欧美国产日产图区| 另类小说视频一区二区| 91福利小视频| 亚洲人成精品久久久久久| 国产一区二区在线电影| 在线成人免费视频| 亚洲欧美日韩中文字幕一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 精品久久免费看| 亚洲成人综合在线| 91免费看`日韩一区二区| 国产色一区二区| 免费成人你懂的| 国产日本欧洲亚洲| 国产在线日韩欧美| 日韩精品一区二区三区在线播放| 亚洲成a人v欧美综合天堂下载| 91美女在线观看| 日本一区二区综合亚洲| 国产精品一区在线观看乱码| 日韩免费视频一区二区| 91行情网站电视在线观看高清版| 综合欧美亚洲日本| 99综合影院在线| 亚洲少妇最新在线视频| 成人福利视频在线看| 国产精品女同一区二区三区| 国产高清久久久| 久久精品网站免费观看| 粉嫩av一区二区三区在线播放| 久久精品亚洲精品国产欧美kt∨| 国产精品综合一区二区| 国产网站一区二区三区| 成人精品视频网站| 亚洲丝袜自拍清纯另类| 91官网在线观看| 亚洲成人午夜影院| 91精品视频网| 国产美女精品人人做人人爽| 国产精品久久久久一区| 91亚洲永久精品| 亚洲成av人片一区二区| 日韩亚洲欧美一区| 国产成人免费在线观看| 国产精品久久久久久户外露出 | 另类的小说在线视频另类成人小视频在线 | av色综合久久天堂av综合| 中文乱码免费一区二区| 在线视频欧美精品| 日欧美一区二区| 欧美xingq一区二区| 成人的网站免费观看| 成人精品鲁一区一区二区| 国产精品久久久久9999吃药| 欧美性三三影院| 精品一区二区综合| 国产精品灌醉下药二区| 欧美群妇大交群的观看方式| 国产成人av电影在线播放| 亚洲精品福利视频网站| 日韩精品在线网站| 不卡视频一二三四| 日韩在线观看一区二区| 中文字幕不卡一区| 欧美人与z0zoxxxx视频| 成人午夜视频福利| 日本美女视频一区二区| 国产精品免费免费| 欧美一区二区三区免费在线看| 99久久久国产精品免费蜜臀| 老鸭窝一区二区久久精品| 中文字幕中文字幕在线一区 | 久久久99免费| 欧美亚洲高清一区| 韩国精品一区二区| 亚洲一区二区三区四区的| 久久综合九色综合欧美就去吻| 在线一区二区三区四区| 激情五月激情综合网| 亚洲综合一区二区| 国产精品免费人成网站| 欧美videossexotv100| 欧美羞羞免费网站| 波多野结衣精品在线| 国产一本一道久久香蕉| 日本不卡高清视频| 亚洲国产毛片aaaaa无费看| 18成人在线观看| 国产欧美日韩另类一区| 久久综合99re88久久爱| 欧美精品高清视频| 欧美色网站导航| 99久久777色| 99久久精品国产导航| 大美女一区二区三区| 国产二区国产一区在线观看| 国产永久精品大片wwwapp| 久久99精品国产91久久来源| 爽爽淫人综合网网站| 午夜日韩在线观看| 视频在线观看国产精品| 污片在线观看一区二区| 亚洲午夜免费视频| 亚洲一区二区三区四区在线| 亚洲国产成人av网| 亚洲丶国产丶欧美一区二区三区| 亚洲乱码国产乱码精品精小说| 中文字幕亚洲精品在线观看| 亚洲视频一区二区在线| 亚洲欧洲www| 亚洲色图欧美激情| 一区二区三区欧美亚洲| 亚洲永久精品国产| 亚洲国产精品一区二区久久| 亚洲午夜精品在线| 午夜精品久久一牛影视| 日韩国产一二三区| 国模冰冰炮一区二区| 国产高清精品久久久久| 粉嫩久久99精品久久久久久夜 | 国产精品久久久久久久久久免费看 | 怡红院av一区二区三区| 一区二区三区不卡在线观看| 亚洲亚洲精品在线观看| 视频一区在线播放| 蜜桃久久av一区| 国产一区二区三区综合| 粉嫩蜜臀av国产精品网站| 91免费看`日韩一区二区| 欧美色图第一页| 欧美成人猛片aaaaaaa| 国产欧美一区二区三区在线看蜜臀| 欧美国产欧美综合| 一区二区三区国产精华| 日韩成人一级大片| 成人毛片视频在线观看| 色视频欧美一区二区三区| 在线播放91灌醉迷j高跟美女| 日韩亚洲电影在线| 亚洲欧美日韩国产中文在线| 日韩av一二三| 不卡一卡二卡三乱码免费网站| 欧美巨大另类极品videosbest | 处破女av一区二区| 欧美自拍丝袜亚洲| 2023国产精华国产精品| 一区在线观看视频| 免费在线成人网| 色婷婷综合激情| 久久久精品人体av艺术| 五月天欧美精品| 91在线视频免费91| 久久中文娱乐网| 丝袜诱惑制服诱惑色一区在线观看| 国产成人综合亚洲91猫咪| 欧美三级电影网| 国产精品理论片在线观看| 午夜精品在线看| 成人va在线观看| 欧美一级片免费看| 亚洲精品中文在线| 国产精品综合在线视频| 欧美日韩国产美女| 亚洲欧美自拍偷拍色图| 国产麻豆9l精品三级站| 欧美人xxxx| 亚洲午夜影视影院在线观看| 懂色av一区二区在线播放| 宅男在线国产精品| 亚洲视频一二三区| 成人永久免费视频| 精品国产乱码久久久久久夜甘婷婷| 一区二区三区不卡视频| 春色校园综合激情亚洲| 国产亚洲一本大道中文在线| 免费在线观看不卡| 91精品国产福利| 五月天激情综合网| 欧美日韩精品欧美日韩精品一综合| |精品福利一区二区三区| 粉嫩一区二区三区性色av| 精品区一区二区| 美女国产一区二区| 日韩片之四级片| 日本不卡中文字幕| 日韩欧美久久久| 蜜臀久久99精品久久久画质超高清 | 日本在线不卡一区| 日本高清视频一区二区| 亚洲精选视频免费看| 99久久国产综合精品色伊| 国产精品情趣视频| 高清成人免费视频| 国产精品麻豆视频|