dlccmd.h

来自「在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LE」· C头文件 代码 · 共 67 行

H
67
字号
/****************************************************************
**                                                              *
**  FILE         :  DLCCmd.H                                    *
**  COPYRIGHT    :  (c) 2001 .Xiamen Yaxon NetWork CO.LTD       *
**                                                              *
**                                                              *
**  By : CCH 2002.11.26                                         *
****************************************************************/
#ifndef DEF_DLCCMD
#define DEF_DLCCMD


/*
********************************************************************************
*                  DEFINE CONFIG PARAMETERS
********************************************************************************
*/
#define SIZE_DLCCMD                         20

#define DLC_OVERFLOW                        (20 * 3)        /* DLC_OVERFLOW = 3 seconds */
#define DLC_RESEND                          5


/*
********************************************************************************
*                  DEFINE CONTROL TYPE
********************************************************************************
*/
#define TYPE_SABM                           0x3F            /* set asynchronous balanced mode */
#define TYPE_UA                             0x73            /* unnumbered acknowledgement */
#define TYPE_DM                             0x0F            /* disconnected mode */
#define TYPE_DISC                           0x53            /* disconnect */
#define TYPE_UIH                            0xEF            /* unnumbered information with header check */
#define TYPE_UIH_RESPOND                    0xFF            /* unnumbered information with header check */
#define TYPE_UI                             0x03            /* unnumbered information */

#define TYPE_MSC                            0xE0            /* Modem Status Command */


/*
********************************************************************************
*                  DEFINE DLCCMD_STRUCT
********************************************************************************
*/
typedef struct {
    BOOLEAN needresend;                 /* command attrib */
    INT8U   dlci;                       /* dlci */
    INT8U   ctltype;                    /* control type */
    INT8U   cmdtype;                    /* command type */
    INT8U   len;                        /* command length */
    INT8U   ct_overflow;                /* overflow count */
    INT8U   ct_send;                    /* send count */
    INT8U   buffer[SIZE_DLCCMD];        /* command buffer */
    void (* informer)(INT8U dlci, INT8U reason);
} DLCCMD_STRUCT;


void FreeDLCCmd(DLCCMD_STRUCT *ptr);
DLCCMD_STRUCT *AllocDLCCmd(void);
DLCCMD_STRUCT *AllocDLCCmd_SABM(INT8U dlci, void (*informer)(INT8U, INT8U));
DLCCMD_STRUCT *AllocDLCCmd_DISC(INT8U dlci, void (*informer)(INT8U, INT8U));
DLCCMD_STRUCT *AllocDLCCmd_MSC(INT8U dlci, INT8U signal, BOOLEAN response);
void InitDLCCmd(void);
void ResetDLCCmd(void);

#endif

⌨️ 快捷键说明

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