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

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

?? zmodem.c

?? vxworks不支持ZMODEM協議
?? C
?? 第 1 頁 / 共 4 頁
字號:

/*****************************************************************
Filename: zmodem.c
Description: 
****************************************************************/

#include <vxWorks.h>
#include <ioLib.h>
#include <tyLib.h>
#include <stdio.h>
#include <tickLib.h>
#include "zmodem.h"


/*--------------------------------------------------------------------------*/
/* Contro Text define                                                       */
/*--------------------------------------------------------------------------*/
static const int ZPAD       =     '*';                /* 052 Pad character begins frames   */
static const int ZDLE       =     030;                /* ^X Zmodem escape- `ala BISYNC DLE */
static const int ZDLEE      =     ZDLE^0100  ;        /* Escaped ZDLE as transmitted       */
static const int ZBIN       =     'A';                /* Binary frame indicator            */
static const int ZHEX       =     'B';                /* HEX frame indicator               */
static const int ZBIN32     =     'C';                /* Binary frame with 32 bit FCS      */

/*--------------------------------------------------------------------------*/
/* Frame types (see array "frametypes" in zmodem.c)                         */
/*--------------------------------------------------------------------------*/
static const int ZRQINIT    =   0;            /* Request receive init              */
static const int ZRINIT     =   1;            /* Receive init                      */
static const int ZSINIT     =   2;            /* Send init sequence (optional)     */
static const int ZACK       =   3;            /* ACK to above                      */
static const int ZFILE      =   4;            /* File name from sender             */
static const int ZSKIP      =   5;            /* To sender: skip this file         */
static const int ZNAK       =   6;            /* Last packet was garbled           */
static const int ZABORT     =   7;            /* Abort batch transfers             */
static const int ZFIN       =   8;            /* Finish session                    */
static const int ZRPOS      =   9;            /* Resume transmit at this position  */
static const int ZDATA      =   10;           /* Data packet(s) follow             */
static const int ZEOF       =   11;           /* End of file                       */
static const int ZFERR      =   12;           /* Fatal Read/Write error Detected   *//*not use*/
static const int ZCRC       =   13;           /* Request for file CRC and response */
static const int ZCHALLENGE =   14;           /* Receiver's Challenge              */
static const int ZCOMPL     =   15;           /* Request is complete               */
static const int ZCAN       =   16;           /* Other end canned with CAN*5       */
static const int ZFREECNT   =   17;           /* Request for free bytes on disk    */
static const int ZCOMMAND   =   18;           /* Command from sending program      */
static const int ZSTDERR    =   19;           /* Send following to stderr          */

/*--------------------------------------------------------------------------*/
/* ZDLE sequences    frameend type in subpacket                             */
/*--------------------------------------------------------------------------*/
static const int ZCRCE      =     'h';            /* CRC next/frame ends/hdr follows   */
static const int ZCRCG      =     'i';            /* CRC next/frame continues nonstop  */
static const int ZCRCQ      =     'j';            /* CRC next/frame continues/want ZACK*/
static const int ZCRCW      =     'k';            /* CRC next/ZACK expected/end of frame*/
static const int ZRUB0      =     'l';            /* Translate to rubout 0177          */
static const int ZRUB1      =     'm';            /* Translate to rubout 0377          */

/*--------------------------------------------------------------------------*/
/* zGetZDL return values (internal)                                        */
/* -1 is general error, -2 is timeout                                       */
/*--------------------------------------------------------------------------*/
static const int GOTOR      =     0400;            /* Octal alert! Octal alert!         */
static const int GOTCRCE    =     (ZCRCE|GOTOR);   /* ZDLE-ZCRCE received               */
static const int GOTCRCG    =     (ZCRCG|GOTOR);   /* ZDLE-ZCRCG received               */
static const int GOTCRCQ    =     (ZCRCQ|GOTOR);   /* ZDLE-ZCRCQ received               */
static const int GOTCRCW    =     (ZCRCW|GOTOR);   /* ZDLE-ZCRCW received               */
static const int GOTCAN     =     (GOTOR|030) ;    /* CAN*5 seen                        */

/*--------------------------------------------------------------------------*/
/* Byte positions within header array                                       */
/*--------------------------------------------------------------------------*/
static const int ZF0        =     3;         /* First flags byte                  */
static const int ZF1        =     2; 
static const int ZF2        =     1; 
static const int ZF3        =     0; 
static const int ZP0        =     0;         /* Low order 8 bits of position      */
static const int ZP1        =     1; 
static const int ZP2        =     2; 
static const int ZP3        =     3;         /* High order 8 bits of file pos     */

/*--------------------------------------------------------------------------*/
/* Bit Masks for ZRINIT flags byte ZF0                                      */
/*--------------------------------------------------------------------------*/
static const int CANFDX     =     01;        /* Can send and receive true FDX     */
static const int CANOVIO    =     02;        /* Can receive data during disk I/O  */
static const int CANBRK     =     04;        /* Can send a break signal           *//*  not use  */
static const int CANCRY     =     010;       /* Can decrypt                       *//*  not use  */
static const int CANLZW     =     020;       /* Can uncompress                    *//*  not use  */
static const int CANFC32    =     040;       /* Can use 32 bit Frame Check        *//*  not use  */


/*--------------------------------------------------------------------------*/
/* PARAMETERS FOR ZFILE FRAME...                                            */
/*--------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------*/
/* Conversion options one of these in ZF0                                   */
/*--------------------------------------------------------------------------*/
static const int ZCBIN      =     1;         /* Binary transfer - no conversion   */
static const int ZCNL       =     2;         /* Convert NL to local EOLN          *//*  not use  */
static const int ZCRESUM    =     3;         /* Resume interrupted file transfer  *//*  not use  */

/*--------------------------------------------------------------------------*/
/* Management options, one of these in ZF1                                  */
/*--------------------------------------------------------------------------*/
static const int ZMNEW      =     1;         /* Transfer iff source newer/longer  *//*  not use  */
static const int ZMCRC      =     2;         /* Transfer if different CRC/length  *//*  not use  */
static const int ZMAPND     =     3;         /* Append contents to existing file  *//*  not use  */
static const int ZMCLOB     =     4;         /* Replace existing file             *//*  not use  */
static const int ZMSPARS    =     5;         /* Encoding for sparse file          *//*  not use  */
static const int ZMDIFF     =     6;         /* Transfer if dates/lengths differ  *//*  not use  */
static const int ZMPROT     =     7;         /* Protect destination file          *//*  not use  */
                                          
/*--------------------------------------------------------------------------*/
/* Transport options, one of these in ZF2                                   */
/*--------------------------------------------------------------------------*/
static const int ZTLZW      =     1;         /* Lempel-Ziv compression            *//*  not use  */
static const int ZTCRYPT    =     2;         /* Encryption                        *//*  not use  */
static const int ZTRLE      =     3;         /* Run Length encoding               *//*  not use  */

/*--------------------------------------------------------------------------*/
/* Parameters for ZCOMMAND frame ZF0 (otherwise 0)                          */
/*--------------------------------------------------------------------------*/
static const int ZCACK1     =     1 ;             /* Acknowledge, then do command      *//*  not use  */

/*--------------------------------------------------------------------------*/
/* Miscellaneous definitions                                                */
/*--------------------------------------------------------------------------*/
static const int ZZOK       =     0;              
static const int ZZERROR    =     -1;           
static const int ZZTIMEOUT  =     -2;           
static const int ZZRCDO     =     -3;           
static const int ZZFUBAR    =     -4;           
                                                  
static const int XON        =     'Q'&037;      
static const int XOFF       =     'S'&037;      
static const int CPMEOF     =     'Z'&037;          /* not used */                                     /*  not use  */
                                                  
static const int RXBINARY   =     false;            /* Force binary mode uploads?        *//*  not use  */
static const int RXASCII    =     false;            /* Force ASCII mode uploads?         *//*  not use  */
static const int LZCONV     =     0;                /* Default ZMODEM conversion mode    */
static const int LZMANAG    =     0;                /* Default ZMODEM file mode          */
static const int LZTRANS    =     0;                /* Default ZMODEM transport mode     */
static const int PATHLEN    =     128;              /* Max legal MS-DOS path size?       *//*  not use  */
static const int KSIZE      =     1024;             /* Max packet size (non-WaZOO)       *//*  not use  */
static const int WAZOOMAX   =     8192;             /* Max packet bit size (WaZOO) 128bytes */
static const int SECSPERDAY =     (24L*60L*60L);    /* Number of seconds in one day      *//*  not use  */




/*--------------------------------------------------------------------------*/
/* ASCII MNEMONICS                                                          */
/*--------------------------------------------------------------------------*/
static const int NUL = 0x00;
static const int SOH = 0x01;
static const int STX = 0x02;
static const int ETX = 0x03;
static const int EOT = 0x04;
static const int ENQ = 0x05;
static const int ACK = 0x06;
static const int BEL = 0x07;
static const int BS  = 0x08;
static const int HT  = 0x09;
static const int LF  = 0x0a;
static const int VT  = 0x0b;
static const int FF  = 0x0c;
static const int CR  = 0x0d;
static const int SO  = 0x0e;
static const int SI  = 0x0f;
static const int DLE = 0x10;
static const int DC1 = 0x11;
static const int DC2 = 0x12;
static const int DC3 = 0x13;
static const int DC4 = 0x14;
static const int NAK = 0x15;
static const int SYN = 0x16;
static const int ETB = 0x17;
static const int CAN = 0x18;
static const int EM  = 0x19;
static const int SUB = 0x1a;
static const int ESC = 0x1b;
static const int FS  = 0x1c;
static const int GS  = 0x1d;
static const int RS  = 0x1e;
static const int US  = 0x1f;

static const int ZATTNLEN   =  32 ;        /* Max length of attention string  */
static const int WAZOOMAX   =  8192  ;     /* Max packet size (WaZOO)         */


static char  gpcAttn[ZATTNLEN+1];           /* String rx sends to tx on err            */
static char  gcZconv;                       /* ZMODEM file conversion request          */
static char  gpcRecBuf[64];                 /* Pointer to receive buffer               */
static int   giRxType;                      /* Type of header received                 */
static char  gcRxframeType;                 /* ZBIN ZBIN32,ZHEX type of frame received */
static char  gcTryZhdrType;                 /* Hdr type to send for Last rx close      */
static int   giRxCount;                     /* Count of data bytes received            */
static char  gpcRxhdr[4];                   /* Received header                         */
static char  gpcTxhdr[4];                   /* Transmitted header                      */
static int   giRxpos;                       /* Received file position                  */
static int   giRecBytes;                    /* bytes of data received                  */
static int   giFilesize;
static char  gpcFilename[ 32 ];
static bool  gbTimeOut         = false;
static int   giTaskIdZmodemRev = ERROR;
static int   giComFd           = ERROR;
staitc int   giFdRevFile       = ERROR; 
int zmodemRcvInit( void )
{
    if( giComFd == ERROR )
    {
        if( ( giComFd = open( "/tyCo/4", O_RDWR , 0 ) ) == ERROR )
        {
            printf("[ comRcvFileInit ] : Creat Com failure.\n" );
            zmodemRcvDInit( );
            return( 0 );
        }

        if( ioctl( giComFd, FIOBAUDRATE, 115200 ) == ERROR )
        {
            printf(" [ comRcvFileInit ]: set the BAUD ERROR.\n");
            zmodemRcvDInit( );
            return( 0 );
        }
    }

    if( giTaskIdZmodemRev == ERROR )
    {
        giTaskIdZmodemRev = taskSpawn( "zmodemRcv", 120, 0x100, 0x20000,( FUNCPTR )zGetZmodem,
                                             0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
        if( giTaskIdZmodemRev == ERROR )
        {
            printf(" [ comRcvFileInit ]: Create task ERROR.\n");
            zmodemRcvDInit( );
            return( 0 );
        }
    }
    return( 1 );
}


int zmodemRcvDInit( void )
{
    if( giTaskIdZmodemRev != ERROR )
    {
        if( taskDelete( giTaskIdZmodemRev ) == ERROR )
        {
            printf("[ zmodemRcvDInit ]: Delete taskRev Error.\n");
        }
        giTaskIdZmodemRev = ERROR;
    }

    if( giComFd != ERROR )
    {
        if( close( giComFd ) == ERROR )
        {
            printf("[ zmodemRcvDInit ]: close Com Error.\n");
        }
        giComFd = ERROR;
    }

    if( fdList != ERROR )
    {
        close( fdList );
    }

    return( 1 );
}


static int zSendChar( unsigned char cData )
{
	if( giComFd != ERROR )
	{
	    if( write( giComFd, &cData, 1 ) == 1 )
	    {
	        return( 1 );
	    }
	}
    else
    {
    	return ( 0 );
    }
}


static int zTestOneByte( void )
{
	return( ioctl( giComFd, FIONREAD, 0 ) );
}


static void zClearByte( void )
{
	ioctl( giComFd, FIOFLUSH, 0 );
}


static int zGetOneByte( void )
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久麻豆| 91麻豆精品久久久久蜜臀| 国产视频一区二区在线观看| 老司机精品视频在线| 日韩欧美中文字幕一区| 看电视剧不卡顿的网站| 欧美mv和日韩mv国产网站| 极品少妇xxxx精品少妇偷拍| 久久先锋影音av鲁色资源| 国产精品影音先锋| 亚洲人成精品久久久久| 欧美性xxxxx极品少妇| 亚洲国产日韩精品| 精品久久人人做人人爽| 岛国一区二区在线观看| 日韩一区在线看| 欧美日韩精品免费| 精品一区二区三区香蕉蜜桃| 精品国产伦一区二区三区观看方式 | 欧美日本国产一区| 日韩av一区二区在线影视| 精品国产亚洲在线| 91香蕉国产在线观看软件| 婷婷国产在线综合| 欧美高清在线视频| 欧美日韩国产成人在线91| 国产专区综合网| 亚洲猫色日本管| 91精品国产综合久久精品麻豆| 麻豆一区二区三区| 亚洲三级在线观看| 欧美tk丨vk视频| 91麻豆蜜桃一区二区三区| 日本三级亚洲精品| 国产精品久久午夜| 日韩一级黄色片| 91丨porny丨最新| 久久99久久精品欧美| 亚洲视频一区在线观看| 欧美xxxxx牲另类人与| 99精品视频免费在线观看| 麻豆精品一区二区av白丝在线| 亚洲欧美一区二区视频| 久久综合成人精品亚洲另类欧美 | 久久久国际精品| 欧美影视一区二区三区| 粉嫩av一区二区三区| 免费久久99精品国产| 一区二区在线观看免费| 久久嫩草精品久久久精品| 欧美丰满嫩嫩电影| 色吊一区二区三区| 成人国产在线观看| 精品亚洲成av人在线观看| 亚洲一区二区三区激情| 成人免费小视频| 久久久久一区二区三区四区| 69av一区二区三区| 欧美日韩亚洲综合在线 | 美日韩一级片在线观看| 一区二区久久久久久| 国产精品成人免费在线| 久久久不卡网国产精品二区| 日韩精品一区二区三区视频播放 | 蜜桃av一区二区| 日韩中文字幕av电影| 亚洲一区二区精品视频| 亚洲黄色av一区| 亚洲女女做受ⅹxx高潮| 国产精品久久久久久久久图文区| 久久久99精品免费观看不卡| 日韩欧美高清一区| 欧美videos中文字幕| 日韩一区二区三区在线视频| 欧美日韩在线直播| 欧美片网站yy| 欧美日韩三级视频| 欧美精选午夜久久久乱码6080| 色婷婷综合中文久久一本| 91麻豆国产福利精品| 色综合久久中文字幕| 色视频欧美一区二区三区| 在线视频综合导航| 欧美在线制服丝袜| 欧美亚洲一区二区在线| 欧美日韩一区二区电影| 欧美裸体bbwbbwbbw| 欧美精品v日韩精品v韩国精品v| 欧美精品777| 欧美一级二级三级乱码| 日韩一区二区免费在线电影| 欧美一区二区久久久| 精品久久一区二区| 国产欧美精品一区| 亚洲色图在线播放| 亚洲成人在线免费| 久久精品99国产精品| 国产自产视频一区二区三区| 懂色av中文字幕一区二区三区| 波多野洁衣一区| 欧美性大战xxxxx久久久| 91精品国产综合久久久久久久久久| 欧美群妇大交群的观看方式| 日韩一区二区三区av| 国产精品视频在线看| 一区二区欧美精品| 美日韩黄色大片| 成人av电影在线网| 欧美日韩中文字幕一区二区| 欧美精品成人一区二区三区四区| 26uuu欧美| 人人超碰91尤物精品国产| 国产麻豆欧美日韩一区| 色吧成人激情小说| 欧美电视剧免费观看| 中文字幕成人网| 日韩精品一卡二卡三卡四卡无卡| 国产乱码一区二区三区| 91成人免费电影| 亚洲精品一区二区三区影院| 国产精品国产三级国产三级人妇 | 日韩一区二区三免费高清| 国产欧美视频一区二区三区| 亚洲风情在线资源站| 国产成人免费网站| 欧美疯狂性受xxxxx喷水图片| 中文字幕第一区二区| 日本亚洲一区二区| 99精品在线观看视频| 日韩午夜在线播放| 亚洲国产一区二区在线播放| 国产一区二区伦理片| 欧洲激情一区二区| 久久久久久久久岛国免费| 午夜久久久影院| 色综合久久中文字幕综合网| 久久毛片高清国产| 免费精品视频在线| 国产精品国产自产拍在线| 免费观看一级特黄欧美大片| 色噜噜久久综合| 国产精品亲子伦对白| 另类综合日韩欧美亚洲| 色爱区综合激月婷婷| 国产精品乱码一区二三区小蝌蚪| 免费观看30秒视频久久| 欧美日韩一区二区三区高清| 自拍偷拍亚洲激情| 成人午夜av电影| 精品日韩欧美在线| 天堂在线一区二区| 在线观看国产日韩| 亚洲精品欧美二区三区中文字幕| 成人一级黄色片| ww亚洲ww在线观看国产| 免费精品99久久国产综合精品| 精品视频123区在线观看| 亚洲美女在线国产| 99久久久免费精品国产一区二区| 久久久高清一区二区三区| 韩国三级电影一区二区| 91精品国产一区二区| 亚洲aaa精品| 欧美精品123区| 午夜国产不卡在线观看视频| 欧亚一区二区三区| 亚洲一区二区三区四区在线免费观看 | 最新日韩av在线| 成人福利视频在线| 中文字幕欧美日本乱码一线二线| 国产呦精品一区二区三区网站| 日韩一区二区精品在线观看| 日韩国产精品久久久久久亚洲| 欧美日韩在线三区| 日韩在线a电影| 欧美日韩国产成人在线免费| 午夜电影久久久| 91精品国产欧美一区二区18| 青青草国产精品97视觉盛宴| 欧美一级精品大片| 国产精品18久久久| 中文字幕一区在线观看视频| 99re这里都是精品| 一区二区三区四区亚洲| 欧美三级电影网| 青青青伊人色综合久久| 欧美一区二区女人| 国产91在线|亚洲| 18成人在线观看| 欧美日韩一区小说| 久久国产夜色精品鲁鲁99| 久久亚区不卡日本| 色一区在线观看| 免费日韩伦理电影| 国产欧美一区二区三区网站| 91影院在线免费观看| 性感美女久久精品| 久久亚洲私人国产精品va媚药| 成人午夜av影视| 天堂va蜜桃一区二区三区 |