⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ahdlc.h

📁 MCS51产单片机上实现的tcp/ip,很全的哦,需要的可以参考一下.
💻 H
字号:
#ifndef	_AHDLC_H
#define	_AHDLC_H
#include "global.h"
#include "mbuf.h"

/* Asynch HDLC receiver control block */
struct ahdlc {
	int escaped;		/* Escape char (0x7d) just seen */
	int hunt;		/* Flushing input until next flag */
	struct mbuf *inframe;	/* Current frame being reassembled */
	int maxsize;		/* Maximum packet size */
	uint16 fcs;		/* current CRC value */
	int32 rxframes;		/* Valid frames received */
	int32 aborts;		/* Aborts seen */
	int32 toobigs;		/* Frames larger than maxsize */
	int32 crcerrs;		/* Frames with CRC errors */
	int32 runts;		/* Frames shorter than 2 bytes */
};
#define	HDLC_ESC_ASYNC	0x7d	/* Escapes special chars (0x7d, 0x7e) */
#define	HDLC_FLAG	0x7e	/* Ends each frame */
#define	HDLC_ESC_COMPL	0x20	/* XORed with special chars in data */

void init_hdlc(struct ahdlc *,int);
struct mbuf *ahdlcrx(struct ahdlc *,uint8);
struct mbuf *ahdlctx(struct mbuf *);

#endif	/* _AHDLC_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -