www.pudn.com > IEC104_codeamaterial.rar > extiopub.h, change:2010-09-21,size:2921b


/*------------------------------------------------------------------------ 
 Module:		extio.h 
 Author:		solar 
 Project:		 
 Creation Date:  
 Description:	 
------------------------------------------------------------------------*/ 
/*------------------------------------------------------------------------ 
 $Log: $ 
------------------------------------------------------------------------*/ 
 
#ifndef _EXTIOPUB_H 
#define _EXTIOPUB_H 
 
#include "timer.h" 
 
#define EXTIO_CODE	    0x5A 
 
#define EXTIO_TYPE_ADDRBCAST     0x01 
#define EXTIO_TYPE_LOGIN         0x02 
#define EXTIO_TYPE_KILL          0x03 
#define EXTIO_TYPE_HBEAT         0x04 
#define EXTIO_TYPE_ERRCODE       0x05 
#define EXTIO_TYPE_RST           0x06 
#define EXTIO_TYPE_CFGCRC        0x07 
#define EXTIO_TYPE_CFG           0x08 
#define EXTIO_TYPE_DICFG         0x09 
#define EXTIO_TYPE_TIME          0x0A 
#define EXTIO_TYPE_DI            0x0B 
#define EXTIO_TYPE_DICOS         0x0C 
#define EXTIO_TYPE_DISOE         0x0D 
#define EXTIO_TYPE_SYX           0x0E 
#define EXTIO_TYPE_SYXCOS        0x0F 
#define EXTIO_TYPE_SYXSOE        0x10 
#define EXTIO_TYPE_YC            0x11 
#define EXTIO_TYPE_DD            0x12 
#define EXTIO_TYPE_MSG           0x13 
#define EXTIO_TYPE_CMD           0x14 
#define EXTIO_TYPE_VALUE         0x15 
#define EXTIO_TYPE_DATAREFRESH   0x16 
 
#define EXTIO_FUN_READ        0x00 
#define EXTIO_FUN_WRITE       0x01 
#define EXTIO_FUN_DEL         0x02 
#define EXTIO_FUN_DATA        0x03 
#define EXTIO_FUN_CONF        0x04 
#define EXTIO_FUN_END         0x05 
 
#define EXTIO_CTRL_MASTER     0x01 
#define EXTIO_CTRL_REQPOLL    0x02 
#define EXTIO_CTRL_RANGE      0x04 
#define EXTIO_CTRL_SECT_1     0x08 
#define EXTIO_CTRL_SECT_E     0x10 
#define EXTIO_CTRL_ALL        0x20 
 
//最大15回线 
#define EXTIO_CFGBIT_SYSCFG    0x00000001 
#define EXTIO_CFGBIT_FDSET1    0x00000002 
#define EXTIO_CFGBIT_FDSET15   0x00008000 
 
#define FRM_PRIO_LEV0  0x0 
#define FRM_PRIO_LEV1  0x1 
#define FRM_PRIO_LEV2  0x2 
#define FRM_PRIO_LEV3  0x3 
#define FRM_PRIO_LEV4  0x4 
#define FRM_PRIO_LEV5  0x5 
#define FRM_PRIO_LEV6  0x6 
#define FRM_PRIO_LEV7  0x7 
 
#define EXTIO_RC_OK                   0x00 
#define EXTIO_RC_ERR                  0x01 
#define EXTIO_RC_DEVADDR_ERR          0x02 
#define EXTIO_RC_DEVTYPE_ERR          0x03 
#define EXTIO_RC_CFGTYPE_ERR          0x04 
#define EXTIO_RC_FRMTYPE_ERR          0x05 
 
#pragma pack(1) 
 
typedef struct{ 
	BYTE byCode;	 
	BYTE byLen;    
    BYTE byAddr; 
	BYTE byCnt; 
	BYTE byType; 
	BYTE byFun; 
	BYTE byCtrl;  
}VExtIoFrmHead;	 
 
typedef struct{ 
	BYTE id; 
	DWORD offset; 
}VExtIoCfgFrm;	 
 
typedef struct{ 
	BYTE cmd; 
	char ret; 
	WORD cmdlen;       //命令总长, 非本帧长度 
	DWORD offset; 
}VExtIoCmdFrm;	 
 
#pragma pack(0) 
 
#define EXTIO_MAXFRM_LEN        128 
#define EXTIO_MAXFRMDATA_LEN   (EXTIO_MAXFRM_LEN-sizeof(VExtIoFrmHead)-1) 
 
#endif