1812 lines
49 KiB
C
1812 lines
49 KiB
C
|
|
/**
|
|||
|
|
* @file: $RCSfile: IEC60870DEF.h,v $
|
|||
|
|
* @brief: $60870<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
*
|
|||
|
|
* @version: $Revision: 1.1 $
|
|||
|
|
* @date: $Date: 2018/11/24 06:54:49 $
|
|||
|
|
* @author: $Author: lizhongming $
|
|||
|
|
* @state: $State: Exp $
|
|||
|
|
*
|
|||
|
|
* @latest: $Id: IEC60870DEF.h,v 1.1 2018/11/24 06:54:49 lizhongming Exp $
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
/******************************************************************************
|
|||
|
|
*
|
|||
|
|
* Module: $ IEC60870-5-101 Library.
|
|||
|
|
* Filename: $ IEC60870DEF.h
|
|||
|
|
* Copyright: $ Copyright(C) 2004 SNAC Ltd. All rights reserved.
|
|||
|
|
* Author: $ DGY,YXF
|
|||
|
|
* Release: $
|
|||
|
|
* Create: $ 2004/08/07
|
|||
|
|
* Modify: $ ver 0.1 - 2004/09/07
|
|||
|
|
* $
|
|||
|
|
* $
|
|||
|
|
* Language: $ C
|
|||
|
|
* Environment: $ VC6/VC7 - WIN32 - I386 (support)
|
|||
|
|
* $ GCC - LINUX - I386 (support)
|
|||
|
|
* Description: $ Base data type of the IEC60870-5-101 protocol.
|
|||
|
|
*
|
|||
|
|
******************************************************************************/
|
|||
|
|
|
|||
|
|
#ifndef _INC_IEC60870_5_101_TYPE_H
|
|||
|
|
#define _INC_IEC60870_5_101_TYPE_H
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* @defgroup S_IEC60870_5_PROTOCOL IEC60870-5 serial protocols type identification
|
|||
|
|
* @{
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#define INVALID_0 0 /**< Invalid data type */
|
|||
|
|
/* Process information in monitor direction (station-specific parameter) */
|
|||
|
|
#define M_SP_NA_1 1 /**< Single-point information */
|
|||
|
|
#define M_SP_TA_1 2 /**< Single-point information with time tag */
|
|||
|
|
#define M_DP_NA_1 3 /**< Double-point information */
|
|||
|
|
#define M_DP_TA_1 4 /**< Double-point information with time tag */
|
|||
|
|
#define M_ST_NA_1 5 /**< Step position information */
|
|||
|
|
#define M_ST_TA_1 6 /**< Step position information with time tag */
|
|||
|
|
#define M_BO_NA_1 7 /**< Bitstring of 32 bit */
|
|||
|
|
#define M_BO_TA_1 8 /**< Bitstring of 32 bit with time tag */
|
|||
|
|
#define M_ME_NA_1 9 /**< Measured value, normalised value */
|
|||
|
|
#define M_ME_TA_1 10 /**< Measured value, normalised value with time tag */
|
|||
|
|
#define M_ME_NB_1 11 /**< Measured value, scaled value */
|
|||
|
|
#define M_ME_TB_1 12 /**< Measured value, scaled value with time tag */
|
|||
|
|
#define M_ME_NC_1 13 /**< Measured value, short floating point value */
|
|||
|
|
#define M_ME_TC_1 14 /**< Measured value, short floating point value with time tag */
|
|||
|
|
#define M_IT_NA_1 15 /**< Integrated totals */
|
|||
|
|
#define M_IT_TA_1 16 /**< Integrated totals with time tag */
|
|||
|
|
#define M_EP_TA_1 17 /**< Event of protection equipment with time tag */
|
|||
|
|
#define M_EP_TB_1 18 /**< Packed start events of protection equipment with time tag */
|
|||
|
|
#define M_EP_TC_1 19 /**< Packed output circuit information of protection equipment with time tag */
|
|||
|
|
#define M_PS_NA_1 20 /**< Packed single point information with time tag */
|
|||
|
|
#define M_ME_ND_1 21 /**< Measured value, normalised value without quality descriptor */
|
|||
|
|
#define M_SP_TB_1 30 /**< Single point information with time tag CP56Time2a */
|
|||
|
|
#define M_DP_TB_1 31 /**< Double point information with time tag CP56Time2a */
|
|||
|
|
#define M_ST_TB_1 32 /**< Step position information with time tag CP56Time2a */
|
|||
|
|
#define M_BO_TB_1 33 /**< Bitstring of 32 bit with time tag CP56Time2a */
|
|||
|
|
#define M_ME_TD_1 34 /**< Measured value, normalised value with time tag CP56Time2a */
|
|||
|
|
#define M_ME_TE_1 35 /**< Measured value, scaled value with time tag CP56Time2a */
|
|||
|
|
#define M_ME_TF_1 36 /**< Measured value, short floating point value with time tag CP56Time2a */
|
|||
|
|
#define M_IT_TB_1 37 /**< Integrated totals with time tag CP56Time2a */
|
|||
|
|
#define M_EP_TD_1 38 /**< Event of protection equipment with time tag CP56Time2a */
|
|||
|
|
#define M_EP_TE_1 39 /**< Packed start events of protection equipment with time tag CP56Time2a */
|
|||
|
|
#define M_EP_TF_1 40 /**< Packed tripping events of protection equipment with time tag CP56Time2a */
|
|||
|
|
/* Process information in control direction (station-specific parameter) */
|
|||
|
|
#define C_SC_NA_1 45 /**< Single command */
|
|||
|
|
#define C_DC_NA_1 46 /**< Double command */
|
|||
|
|
#define C_RC_NA_1 47 /**< Regulating step command */
|
|||
|
|
#define C_SE_NA_1 48 /**< Set point command, normalised value */
|
|||
|
|
#define C_SE_NB_1 49 /**< Set point command, scaled value */
|
|||
|
|
#define C_SE_NC_1 50 /**< Set point command, short floating point value */
|
|||
|
|
#define C_BO_NA_1 51 /**< Bitstring of 32 bit */
|
|||
|
|
#define C_SC_TA_1 58 /**< Single command with time tag CP56Time2a */
|
|||
|
|
#define C_DC_TA_1 59 /**< Double command with time tag CP56Time2a */
|
|||
|
|
#define C_RC_TA_1 60 /**< Regulating step command with time tag CP56Time2a */
|
|||
|
|
#define C_SE_TA_1 61 /**< Set point command, normalised value with time tag CP56Time2a */
|
|||
|
|
#define C_SE_TB_1 62 /**< Set point command, scaled value with time tag CP56Time2a */
|
|||
|
|
#define C_SE_TC_1 63 /**< Set point command, short floating point value with time tag CP56Time2a */
|
|||
|
|
#define C_BO_TA_1 64 /**< Bitstring of 32 bit with time tag CP56Time2a */
|
|||
|
|
/* System information in monitor direction (station-specific parameter) */
|
|||
|
|
#define M_EI_NA_1 70 /**< End of initialisation */
|
|||
|
|
/* System information in control direction (station-specific parameter) */
|
|||
|
|
#define C_IC_NA_1 100 /**< Interrogation command <20><>ֵ<EFBFBD>ٻ<EFBFBD> */
|
|||
|
|
#define C_CI_NA_1 101 /**< Counter interrogation command */
|
|||
|
|
#define C_RD_NA_1 102 /**< Read command */
|
|||
|
|
#define C_CS_NA_1 103 /**< Clock synchronisation command */
|
|||
|
|
#define C_TS_NA_1 104 /**< Test command */
|
|||
|
|
#define C_RP_NA_1 105 /**< Reset process command */
|
|||
|
|
#define C_CD_NA_1 106 /**< Delay acquisition command */
|
|||
|
|
#define C_TS_TA_1 107 /**< Test command with time tag CP56Time2a */
|
|||
|
|
/* Parameter in control direction (station-specific parameter) */
|
|||
|
|
#define P_ME_NA_1 110 /**< Parameter of measured value, normalised value */
|
|||
|
|
#define P_ME_NB_1 111 /**< Parameter of measured value, scaled value */
|
|||
|
|
#define P_ME_NC_1 112 /**< Parameter of measured value, short floating point value */
|
|||
|
|
#define P_AC_NA_1 113 /**< Active parameter */
|
|||
|
|
/* File Transfer (station-specific parameter) */
|
|||
|
|
#define F_FR_NA_1 120 /**< File ready */
|
|||
|
|
#define F_SR_NA_1 121 /**< Section ready */
|
|||
|
|
#define F_SC_NA_1 122 /**< Call directory, select file, call file, call section */
|
|||
|
|
#define F_LS_NA_1 123 /**< Last section, last segment */
|
|||
|
|
#define F_AF_NA_1 124 /**< Ack file, ack section */
|
|||
|
|
#define F_SG_NA_1 125 /**< Segment */
|
|||
|
|
#define F_DR_TA_1 126 /**< Directory */
|
|||
|
|
|
|||
|
|
/* Special type for AGC */
|
|||
|
|
#define C_SE_ND_1 136 /**< Set multi-point command, normalised value */
|
|||
|
|
|
|||
|
|
/* EYE-LINUXϵͳ˳<CDB3><CBB3><EFBFBD><EFBFBD><EFBFBD>ⶨ<EFBFBD><E2B6A8> */
|
|||
|
|
#define M_ES_NA_1 41 /**< ˳<><CBB3>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#define C_GS_NA_1 114 /**< */
|
|||
|
|
#define C_SS_NA_1 115 /**< */
|
|||
|
|
|
|||
|
|
/* EYE-LINUXϵͳ<CFB5><CDB3><EFBFBD>ⶨ<EFBFBD><E2B6A8> */
|
|||
|
|
#define C_MT_ND_1 152 /**< Multi-point transmit command, normalised value (<28><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>ֵ) */
|
|||
|
|
#define M_EX_TA_1 153 /**< <20><>SOE<4F><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#define C_SE_EX_1 154 /**< Set Point Command,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEA3AC>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD>ֱ<EFBFBD><D6B1>ִ<EFBFBD><D6B4> */
|
|||
|
|
|
|||
|
|
|
|||
|
|
#define M_GD_NA_1 160 /**< IEC60870-5-103 GDD type monitor direction data [<5B>ַ<EFBFBD><D6B7><EFBFBD>] */
|
|||
|
|
#define C_GD_NA_1 168 /**< IEC60870-5-103 GDD type control direction data */
|
|||
|
|
|
|||
|
|
/* EYE-LINUXϵͳ<CFB5><CDB3><EFBFBD>ⶨ<EFBFBD><E2B6A8> */
|
|||
|
|
#define D_RE_DT_1 180 /**< <20><>¼<EFBFBD><C2BC><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#define D_FA_SE_1 181 /**< <20><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#define D_ACC_ACK_1 182 /**< ¼<><C2BC><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC>Ӧ */
|
|||
|
|
|
|||
|
|
#define M_IT_S1_1 185 /** Signed int 1 */
|
|||
|
|
#define M_IT_U1_1 186 /** Unsigned int 1 */
|
|||
|
|
#define M_IT_S2_1 187 /** Signed int 2 */
|
|||
|
|
#define M_IT_U2_1 188 /** Unsigned int 2 */
|
|||
|
|
#define M_IT_S4_1 189 /** Signed int 4 */
|
|||
|
|
#define M_IT_U4_1 190 /** Unsigned int 4 */
|
|||
|
|
#define M_IT_F4_1 191 /** float 4 */
|
|||
|
|
#define M_IT_F8_1 192 /** float 8 */
|
|||
|
|
|
|||
|
|
/* ------------------------------------------------------------------------------------
|
|||
|
|
* IEC60870-5-101 cause of transmission possibilities for each ASDU
|
|||
|
|
* Cause := UI6[1..6] <0..63>
|
|||
|
|
* <14..19> := reserved for further compatible definitions
|
|||
|
|
* <42..47> := reserved for further compatible definitions
|
|||
|
|
*/
|
|||
|
|
#define COT0_NOTUSED_1 0 /**< not used */
|
|||
|
|
#define COT1_PERCYC_1 1 /**< periodic, cyclic */
|
|||
|
|
#define COT2_BACK_1 2 /**< background scan */
|
|||
|
|
#define COT3_SPONT_1 3 /**< spontaneous */
|
|||
|
|
#define COT4_INIT_1 4 /**< initialised */
|
|||
|
|
#define COT5_REQ_1 5 /**< request or requested */
|
|||
|
|
#define COT6_ACT_1 6 /**< activation */
|
|||
|
|
#define COT7_ACTCON_1 7 /**< activation confirmation */
|
|||
|
|
#define COT8_DEACT_1 8 /**< deactivation */
|
|||
|
|
#define COT9_DEACTCON_1 9 /**< deactivation confirmation */
|
|||
|
|
#define COT10_ACTTERM_1 10 /**< activation termination */
|
|||
|
|
#define COT11_RETREM_1 11 /**< return information caused by a remote command */
|
|||
|
|
#define COT12_RETLOC_1 12 /**< return information caused by a local command */
|
|||
|
|
#define COT13_FILE_1 13 /**< file transfer */
|
|||
|
|
#define COT20_INROGEN_1 20 /**< interrogated by general interrogation */
|
|||
|
|
#define COT21_INRO1_1 21 /**< interrogated by group 1 interrogation */
|
|||
|
|
#define COT22_INRO2_1 22 /**< interrogated by group 2 interrogation */
|
|||
|
|
#define COT23_INRO3_1 23 /**< interrogated by group 3 interrogation */
|
|||
|
|
#define COT24_INRO4_1 24 /**< interrogated by group 4 interrogation */
|
|||
|
|
#define COT25_INRO5_1 25 /**< interrogated by group 5 interrogation */
|
|||
|
|
#define COT26_INRO6_1 26 /**< interrogated by group 6 interrogation */
|
|||
|
|
#define COT27_INRO7_1 27 /**< interrogated by group 7 interrogation */
|
|||
|
|
#define COT28_INRO8_1 28 /**< interrogated by group 8 interrogation */
|
|||
|
|
#define COT29_INRO9_1 29 /**< interrogated by group 9 interrogation */
|
|||
|
|
#define COT30_INRO10_1 30 /**< interrogated by group 10 interrogation */
|
|||
|
|
#define COT31_INRO11_1 31 /**< interrogated by group 11 interrogation */
|
|||
|
|
#define COT32_INRO12_1 32 /**< interrogated by group 12 interrogation */
|
|||
|
|
#define COT33_INRO13_1 33 /**< interrogated by group 13 interrogation */
|
|||
|
|
#define COT34_INRO14_1 34 /**< interrogated by group 14 interrogation */
|
|||
|
|
#define COT35_INRO15_1 35 /**< interrogated by group 15 interrogation */
|
|||
|
|
#define COT36_INRO16_1 36 /**< interrogated by group 16 interrogation */
|
|||
|
|
#define COT37_REQCOGEN_1 37 /**< reques ted by general counter request */
|
|||
|
|
#define COT38_REQCO1_1 38 /**< reques ted by group 1 counter request */
|
|||
|
|
#define COT39_REQCO1_1 39 /**< reques ted by group 2 counter request */
|
|||
|
|
#define COT40_REQCO1_1 40 /**< reques ted by group 3 counter request */
|
|||
|
|
#define COT41_REQCO1_1 41 /**< reques ted by group 4 counter request */
|
|||
|
|
|
|||
|
|
/**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#ifdef _OS_WIN32_
|
|||
|
|
#pragma pack(push,1)
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef struct I_STRUCT I_STRUCT;
|
|||
|
|
/** I_STRUCT */
|
|||
|
|
struct I_STRUCT {
|
|||
|
|
uint32_t flag:1; /**< I format flag = 0 */
|
|||
|
|
uint32_t SNO:15; /**< Send number */
|
|||
|
|
uint32_t RES:1; /**< Reserved = 0 */
|
|||
|
|
uint32_t RNO:15; /**< Recieve number */
|
|||
|
|
}ALIGNPACKED; /**< I format */
|
|||
|
|
|
|||
|
|
typedef struct S_STRUCT S_STRUCT;
|
|||
|
|
/** S_STRUCT */
|
|||
|
|
struct S_STRUCT {
|
|||
|
|
uint32_t flag:2; /**< S format flag = 01 */
|
|||
|
|
uint32_t RES:15; /**< Reserved = 0 */
|
|||
|
|
uint32_t RNO:15; /**< Recieve number */
|
|||
|
|
}ALIGNPACKED; /**< S format */
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct U_STRUCT U_STRUCT;
|
|||
|
|
/** U_STRUCT */
|
|||
|
|
struct U_STRUCT {
|
|||
|
|
uint32_t flag:2; /**< U format flag = 11 */
|
|||
|
|
uint32_t STARTDT:2; /**< STARTDT */
|
|||
|
|
uint32_t STOPDT:2; /**< STOPDT */
|
|||
|
|
uint32_t TESTFR:2; /**< TESTFR */
|
|||
|
|
uint32_t RES:24; /**< Reserved = 0 */
|
|||
|
|
}ALIGNPACKED; /**< U format */
|
|||
|
|
|
|||
|
|
typedef union ctrlarea_t ctrlarea_t;
|
|||
|
|
/** Control field */
|
|||
|
|
union ctrlarea_t {
|
|||
|
|
byte_t byte[4];
|
|||
|
|
I_STRUCT I;
|
|||
|
|
S_STRUCT S;
|
|||
|
|
U_STRUCT U;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct apci_t apci_t;
|
|||
|
|
/** apci_t */
|
|||
|
|
struct apci_t { /* IEC60870-5-104 special */
|
|||
|
|
byte_t startC1; /* Start character = 68H */
|
|||
|
|
byte_t length1; /* length */
|
|||
|
|
ctrlarea_t ctrl_field; /* Control field */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
/* FRAME_TYPE()/IS_I_FRAME()/IS_S_FRAME()/IS_U_FRAME()*/
|
|||
|
|
|
|||
|
|
typedef struct asdustd_t asdustd_t;
|
|||
|
|
struct asdustd_t {
|
|||
|
|
byte_t typid; /* Type identification */
|
|||
|
|
byte_t vsq; /* Variable structure qualifier */
|
|||
|
|
uint16_t cot; /* Cause of transmission */
|
|||
|
|
uint16_t addr; /* Common address of ASDUs */
|
|||
|
|
byte_t data[256]; /* Variable structure qualifier */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
// ===============================================================================
|
|||
|
|
/** Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵĺ<D6B5><C4BA><EFBFBD>
|
|||
|
|
* BL=<EFBFBD><EFBFBD><EFBFBD><EFBFBD>/δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>˴<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䱻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* SB=ȡ<EFBFBD><EFBFBD>/δ<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD>װ<EFBFBD>õ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* NT=<EFBFBD><EFBFBD>ǰֵ/<EFBFBD>ǵ<EFBFBD>ǰֵ
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD>³ɹ<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ͳ<EFBFBD>Ϊ<EFBFBD><EFBFBD>ǰֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD>²<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD>þͳ<EFBFBD>Ϊ<EFBFBD>ǵ<EFBFBD>ǰֵ<EFBFBD><EFBFBD>
|
|||
|
|
* IV=<EFBFBD><EFBFBD>Ч/<EFBFBD><EFBFBD>Ч
|
|||
|
|
* <EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD>ڲɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϢԴ<EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD>״̬(ɥʧ<EFBFBD><EFBFBD><EFBFBD>ǹ<EFBFBD><EFBFBD><EFBFBD>ˢ<EFBFBD><EFBFBD>)<EFBFBD><EFBFBD>ֵ
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD>塣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD>ʹ<EFBFBD>á<EFBFBD>
|
|||
|
|
* OV=<EFBFBD><EFBFBD><EFBFBD><EFBFBD>/δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* EI=<EFBFBD>¼<EFBFBD>״̬
|
|||
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD>ڲɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ֵΪ
|
|||
|
|
* <EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>嶯<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Щ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塣<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
* ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD>ʹ<EFBFBD>á<EFBFBD>
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
typedef struct siq_t siq_t;
|
|||
|
|
/** <20><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
|||
|
|
* SPI<EFBFBD><EFBFBD>=BS1<EFBFBD>ۣ<EFBFBD><EFBFBD>ݣ<EFBFBD>0<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD>=OFF <EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD>=ON <EFBFBD><EFBFBD>
|
|||
|
|
*/
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct siq_t {
|
|||
|
|
byte_t IV:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t RES:3;
|
|||
|
|
byte_t SPI:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct siq_t {
|
|||
|
|
byte_t SPI:1;
|
|||
|
|
byte_t RES:3;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t IV:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SIQ SIQ;
|
|||
|
|
union SIQ {
|
|||
|
|
byte_t bits;
|
|||
|
|
siq_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct diq_t diq_t;
|
|||
|
|
/** <20><>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˫<EFBFBD><CBAB><EFBFBD><EFBFBD>Ϣ
|
|||
|
|
* DPI<EFBFBD><EFBFBD>=UI2<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>2<EFBFBD>ݣ<EFBFBD>0<EFBFBD><EFBFBD>3<EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>0<EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<EFBFBD>м<EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD>
|
|||
|
|
* <EFBFBD><EFBFBD>1<EFBFBD><EFBFBD><EFBFBD><EFBFBD>=ȷ<EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>(OFF)
|
|||
|
|
* <EFBFBD><EFBFBD>2<EFBFBD><EFBFBD><EFBFBD><EFBFBD>=ȷ<EFBFBD><EFBFBD>״̬<EFBFBD><EFBFBD>(ON)
|
|||
|
|
* <EFBFBD><EFBFBD>3<EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<EFBFBD>м<EFBFBD>״̬<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD>
|
|||
|
|
*/
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct diq_t {
|
|||
|
|
byte_t IV:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t RES:2;
|
|||
|
|
byte_t DPI:2;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct diq_t {
|
|||
|
|
byte_t DPI:2;
|
|||
|
|
byte_t RES:2;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t IV:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union DIQ DIQ;
|
|||
|
|
union DIQ {
|
|||
|
|
byte_t bits;
|
|||
|
|
diq_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct qdp_t qdp_t;
|
|||
|
|
/** <20>̵籣<CCB5><E7B1A3>װ<EFBFBD><D7B0><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct qdp_t {
|
|||
|
|
byte_t IV:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t EI:1;
|
|||
|
|
byte_t RES:3;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct qdp_t {
|
|||
|
|
byte_t RES:3;
|
|||
|
|
byte_t EI:1;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t IV:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union QDP QDP;
|
|||
|
|
union QDP {
|
|||
|
|
byte_t bits;
|
|||
|
|
qdp_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct qds_t qds_t;
|
|||
|
|
/** Ʒ<><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct qds_t {
|
|||
|
|
byte_t IV:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t RES:3;
|
|||
|
|
byte_t OV:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct qds_t {
|
|||
|
|
byte_t OV:1;
|
|||
|
|
byte_t RES:3;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t IV:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union QDS QDS;
|
|||
|
|
union QDS {
|
|||
|
|
byte_t bits;
|
|||
|
|
qds_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct vti_t vti_t;
|
|||
|
|
/** <20><>˲<EFBFBD><CBB2>״ָ̬ʾ<D6B8><CABE>ֵ */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct vti_t {
|
|||
|
|
byte_t transient:1;
|
|||
|
|
byte_t value:7;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct vti_t {
|
|||
|
|
byte_t value:7;
|
|||
|
|
byte_t transient:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union VTI VTI;
|
|||
|
|
union VTI {
|
|||
|
|
byte_t bits;
|
|||
|
|
vti_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct NVA NVA;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ֵ */
|
|||
|
|
struct NVA {
|
|||
|
|
int16_t value;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
typedef union VA VA;
|
|||
|
|
union VA {
|
|||
|
|
uint16_t ui;
|
|||
|
|
int16_t i;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct sva_t sva_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD>ֵ */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct sva_t {
|
|||
|
|
uint16_t sign:1;
|
|||
|
|
uint16_t value:15;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct sva_t {
|
|||
|
|
uint16_t value:15;
|
|||
|
|
uint16_t sign:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SVA SVA;
|
|||
|
|
union SVA {
|
|||
|
|
int16_t bits;
|
|||
|
|
sva_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct ieee754dp_t ieee754dp_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IEEE STD754 R64.52<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct ieee754dp_t {
|
|||
|
|
uint64_t sign:1;
|
|||
|
|
uint64_t bexp:11;
|
|||
|
|
uint64_t mant:52;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct ieee754dp_t {
|
|||
|
|
uint64_t mant:52;
|
|||
|
|
uint64_t bexp:11;
|
|||
|
|
uint64_t sign:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union IEEE754DP IEEE754DP;
|
|||
|
|
union IEEE754DP {
|
|||
|
|
uint64_t bits;
|
|||
|
|
ieee754dp_t parts;
|
|||
|
|
double d;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct ieee754sp_t ieee754sp_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IEEE STD754 R32.23<EFBFBD≯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct ieee754sp_t {
|
|||
|
|
uint32_t sign:1;
|
|||
|
|
uint32_t bexp:8;
|
|||
|
|
uint32_t mant:23;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct ieee754sp_t {
|
|||
|
|
uint32_t mant:23;
|
|||
|
|
uint32_t bexp:8;
|
|||
|
|
uint32_t sign:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union IEEE754SP IEEE754SP;
|
|||
|
|
union IEEE754SP {
|
|||
|
|
uint32_t bits;
|
|||
|
|
ieee754sp_t parts;
|
|||
|
|
float f;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct scd_t scd_t;
|
|||
|
|
/** ״̬<D7B4><CCAC>״̬<D7B4>仯<EFBFBD><E4BBAF><EFBFBD><EFBFBD> */
|
|||
|
|
struct scd_t {
|
|||
|
|
uint16_t ST;
|
|||
|
|
uint16_t CD;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
typedef union SCD SCD;
|
|||
|
|
union SCD {
|
|||
|
|
uint32_t bits;
|
|||
|
|
scd_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct bcr_t bcr_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD>Ƽ<EFBFBD><C6BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct bcr_t {
|
|||
|
|
uint32_t counter;
|
|||
|
|
byte_t IV:1;
|
|||
|
|
byte_t CA:1;
|
|||
|
|
byte_t CY:1;
|
|||
|
|
byte_t SQ:5;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct bcr_t {
|
|||
|
|
uint32_t counter;
|
|||
|
|
byte_t SQ:5;
|
|||
|
|
byte_t CY:1;
|
|||
|
|
byte_t CA:1;
|
|||
|
|
byte_t IV:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union BCR BCR;
|
|||
|
|
union BCR {
|
|||
|
|
byte_t bits[5];
|
|||
|
|
bcr_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct sep_t sep_t;
|
|||
|
|
/** <20>̵籣<CCB5><E7B1A3>װ<EFBFBD>õĵ<C3B5><C4B5><EFBFBD><EFBFBD>¼<EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct sep_t {
|
|||
|
|
byte_t IV:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t EI:1;
|
|||
|
|
byte_t RES:1;
|
|||
|
|
byte_t ES:2;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct sep_t {
|
|||
|
|
byte_t ES:2;
|
|||
|
|
byte_t RES:1;
|
|||
|
|
byte_t EI:1;
|
|||
|
|
byte_t BL:1;
|
|||
|
|
byte_t SB:1;
|
|||
|
|
byte_t NT:1;
|
|||
|
|
byte_t IV:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SEP SEP;
|
|||
|
|
union SEP {
|
|||
|
|
byte_t bits;
|
|||
|
|
sep_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct spe_t spe_t;
|
|||
|
|
/** <20>̵籣<CCB5><E7B1A3>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct spe_t {
|
|||
|
|
byte_t RES:2;
|
|||
|
|
byte_t SRD:1;
|
|||
|
|
byte_t SIE:1;
|
|||
|
|
byte_t SL3:1;
|
|||
|
|
byte_t SL2:1;
|
|||
|
|
byte_t SL1:1;
|
|||
|
|
byte_t GS:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct spe_t {
|
|||
|
|
byte_t GS:1;
|
|||
|
|
byte_t SL1:1;
|
|||
|
|
byte_t SL2:1;
|
|||
|
|
byte_t SL3:1;
|
|||
|
|
byte_t SIE:1;
|
|||
|
|
byte_t SRD:1;
|
|||
|
|
byte_t RES:2;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SPE SPE;
|
|||
|
|
union SPE {
|
|||
|
|
byte_t bits;
|
|||
|
|
spe_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct oci_t oci_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD>װ<EFBFBD><D7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>Ϣ */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct oci_t {
|
|||
|
|
byte_t RES:4;
|
|||
|
|
byte_t CL3:1;
|
|||
|
|
byte_t CL2:1;
|
|||
|
|
byte_t CL1:1;
|
|||
|
|
byte_t GC:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct oci_t {
|
|||
|
|
byte_t GC:1;
|
|||
|
|
byte_t CL1:1;
|
|||
|
|
byte_t CL2:1;
|
|||
|
|
byte_t CL3:1;
|
|||
|
|
byte_t RES:4;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union OCI OCI;
|
|||
|
|
union OCI {
|
|||
|
|
byte_t bits;
|
|||
|
|
oci_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef union BSI BSI;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD>״̬<D7B4><CCAC>Ϣ */
|
|||
|
|
union BSI {
|
|||
|
|
uint32_t bits;
|
|||
|
|
byte_t parts[4];
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct sco_t sco_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct sco_t {
|
|||
|
|
byte_t SE:1;
|
|||
|
|
byte_t QU:5;
|
|||
|
|
byte_t RES:1;
|
|||
|
|
byte_t SCS:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct sco_t {
|
|||
|
|
byte_t SCS:1;
|
|||
|
|
byte_t RES:1;
|
|||
|
|
byte_t QU:5;
|
|||
|
|
byte_t SE:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SCO SCO;
|
|||
|
|
union SCO {
|
|||
|
|
byte_t bits;
|
|||
|
|
sco_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct dco_t dco_t;
|
|||
|
|
/** ˫<><CBAB><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct dco_t {
|
|||
|
|
byte_t SE:1;
|
|||
|
|
byte_t QU:5;
|
|||
|
|
byte_t DCS:2;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct dco_t {
|
|||
|
|
byte_t DCS:2;
|
|||
|
|
byte_t QU:5;
|
|||
|
|
byte_t SE:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union DCO DCO;
|
|||
|
|
union DCO {
|
|||
|
|
byte_t bits;
|
|||
|
|
dco_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct rco_t rco_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct rco_t {
|
|||
|
|
byte_t SE:1;
|
|||
|
|
byte_t QU:5;
|
|||
|
|
byte_t RCS:2;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct rco_t {
|
|||
|
|
byte_t RCS:2;
|
|||
|
|
byte_t QU:5;
|
|||
|
|
byte_t SE:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union RCO RCO;
|
|||
|
|
union RCO {
|
|||
|
|
byte_t bits;
|
|||
|
|
rco_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct qos_t qos_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB6><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct qos_t {
|
|||
|
|
byte_t SE:1;
|
|||
|
|
byte_t QL:7;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct qos_t {
|
|||
|
|
byte_t QL:7;
|
|||
|
|
byte_t SE:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union QOSP QOSP;
|
|||
|
|
union QOSP {
|
|||
|
|
byte_t bits;
|
|||
|
|
qos_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct coi_t coi_t;
|
|||
|
|
/** <20><>ʼ<EFBFBD><CABC>ԭ<EFBFBD><D4AD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct coi_t {
|
|||
|
|
byte_t state:1;
|
|||
|
|
byte_t cause:7;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct coi_t {
|
|||
|
|
byte_t cause:7;
|
|||
|
|
byte_t state:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union COI COI;
|
|||
|
|
union COI {
|
|||
|
|
byte_t bits;
|
|||
|
|
coi_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct QOI QOI;
|
|||
|
|
/** <20>ٻ<EFBFBD><D9BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB6><EFBFBD> */
|
|||
|
|
struct QOI {
|
|||
|
|
byte_t qoi;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct qcc_t qcc_t;
|
|||
|
|
/** <20><><EFBFBD>ܼ<EFBFBD><DCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٻ<EFBFBD><D9BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB6><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct qcc_t {
|
|||
|
|
byte_t FRZ:2;
|
|||
|
|
byte_t RQT:6;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct qcc_t {
|
|||
|
|
byte_t RQT:6;
|
|||
|
|
byte_t FRZ:2;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union QCC QCC;
|
|||
|
|
union QCC {
|
|||
|
|
byte_t bits;
|
|||
|
|
qcc_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct FBP FBP;
|
|||
|
|
/** <20>̶<EFBFBD><CCB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
struct FBP {
|
|||
|
|
uint16_t HEX;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
//#define FBP (uint16_t)(0x55aa)
|
|||
|
|
|
|||
|
|
typedef struct QRP QRP;
|
|||
|
|
/** <20><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB6><EFBFBD> */
|
|||
|
|
struct QRP {
|
|||
|
|
byte_t qrp;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct qpm_t qpm_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB6><EFBFBD> */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct qpm_t {
|
|||
|
|
byte_t POP:1;
|
|||
|
|
byte_t LPC:1;
|
|||
|
|
byte_t KPA:6;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct qpm_t {
|
|||
|
|
byte_t KPA:6;
|
|||
|
|
byte_t LPC:1;
|
|||
|
|
byte_t POP:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union QPM QPM;
|
|||
|
|
union QPM {
|
|||
|
|
byte_t bits;
|
|||
|
|
qpm_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
#define QPM_NOTUSED 0 /** not used */
|
|||
|
|
#define QPM_THRESHOLD 1 /** threshold value */
|
|||
|
|
#define QPM_SMOOTHING 2 /** smoothing factor (filter time constant) */
|
|||
|
|
#define QPM_LOWLIMIT 3 /** high limits */
|
|||
|
|
#define QPM_HIGHLIMIT 4 /** low limits */
|
|||
|
|
|
|||
|
|
typedef struct QPA QPA;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB6><EFBFBD> */
|
|||
|
|
struct QPA {
|
|||
|
|
byte_t qpa;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/* File Transfer (station-specific parameter) */
|
|||
|
|
|
|||
|
|
/* <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>壬<EFBFBD><E5A3AC><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>8λ<38><CEBB>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>Ӧ<EFBFBD>ñ<EFBFBD><C3B1><EFBFBD> */
|
|||
|
|
#define FILE_TRANSPARENT (1) /**< <><CDB8><EFBFBD>ļ<EFBFBD> */
|
|||
|
|
#define FILE_EQUIP (2) /**< <20>̵籣<CCB5><E7B1A3><EFBFBD>豸<EFBFBD><E8B1B8><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#define FILE_EVENT_SEQ (3) /**< <20>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
#define FILE_ANALOG_SEQ (4) /**< <20><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5> */
|
|||
|
|
/* <20><><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD> */
|
|||
|
|
#define FILE_TRAN_DEFAULT (0) /**< ȱʡ */
|
|||
|
|
#define FILE_TRAN_SEL (1) /**< ѡ<><D1A1><EFBFBD>ļ<EFBFBD> */
|
|||
|
|
#define FILE_TRAN_REQ (2) /**< <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD> */
|
|||
|
|
#define FILE_TRAN_INACTIVE (3) /**< ֹͣ<CDA3><D6B9><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD> */
|
|||
|
|
#define FILE_TRAN_DELETE (4) /**< ɾ<><C9BE><EFBFBD>ļ<EFBFBD> */
|
|||
|
|
//....
|
|||
|
|
#define FILE_ERR_MEM (0) /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀռ<C4BF> */
|
|||
|
|
#define FILE_ERR_CHKSUM (1) /**< У<><D0A3><EFBFBD>ʹ<EFBFBD> */
|
|||
|
|
//....
|
|||
|
|
#define FILE_ERR_FILENAME (4) /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
|
|||
|
|
/** Name Of File */
|
|||
|
|
typedef uint16_t NOF;
|
|||
|
|
|
|||
|
|
/** Name Of Session */
|
|||
|
|
typedef byte_t NOS;
|
|||
|
|
|
|||
|
|
typedef struct LOF LOF;
|
|||
|
|
/** Length Of File */
|
|||
|
|
struct LOF {
|
|||
|
|
byte_t lof[3];
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** Length Of Session */
|
|||
|
|
typedef byte_t LOS;
|
|||
|
|
|
|||
|
|
/** CHeckSum */
|
|||
|
|
typedef byte_t CHS;
|
|||
|
|
|
|||
|
|
typedef struct sof_t sof_t;
|
|||
|
|
/** State Of File */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct sof_t {
|
|||
|
|
byte_t FA:1;
|
|||
|
|
byte_t FOR:1;
|
|||
|
|
byte_t LFD:1;
|
|||
|
|
byte_t STATUS:5;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct sof_t {
|
|||
|
|
byte_t STATUS:5;
|
|||
|
|
byte_t LFD:1;
|
|||
|
|
byte_t FOR:1;
|
|||
|
|
byte_t FA:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SOF SOF;
|
|||
|
|
/** State Of File */
|
|||
|
|
union SOF {
|
|||
|
|
byte_t bits;
|
|||
|
|
sof_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct frq_t frq_t;
|
|||
|
|
/** File Ready Qualifier */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct frq_t {
|
|||
|
|
byte_t ACK:1; /**< =0 ack; =1 deny */
|
|||
|
|
byte_t FILES:7;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct frq_t {
|
|||
|
|
byte_t FILES:7;
|
|||
|
|
byte_t ACK:1; /**< =0 ack; =1 deny */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union FRQ FRQ;
|
|||
|
|
/** File Ready Qualifier */
|
|||
|
|
union FRQ {
|
|||
|
|
byte_t bits;
|
|||
|
|
frq_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct srq_t srq_t;
|
|||
|
|
/** Session Ready Qualifier */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct srq_t {
|
|||
|
|
byte_t READY:1;
|
|||
|
|
byte_t SESSION:7;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct srq_t {
|
|||
|
|
byte_t SESSION:7;
|
|||
|
|
byte_t READY:1;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SRQ SRQ;
|
|||
|
|
/** Session Ready Qualifier */
|
|||
|
|
union SRQ {
|
|||
|
|
byte_t bits;
|
|||
|
|
srq_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct scq_t scq_t;
|
|||
|
|
/** Select/Call Qualifier */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct scq_t {
|
|||
|
|
byte_t RESPONSE:4;
|
|||
|
|
byte_t REQUEST:4;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct scq_t {
|
|||
|
|
byte_t REQUEST:4;
|
|||
|
|
byte_t RESPONSE:4;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SCQ SCQ;
|
|||
|
|
/** Select/Call Qualifier */
|
|||
|
|
union SCQ {
|
|||
|
|
byte_t bits;
|
|||
|
|
scq_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** Lasted Session Qualifier */
|
|||
|
|
typedef byte_t LSQ;
|
|||
|
|
|
|||
|
|
typedef struct afq_t afq_t;
|
|||
|
|
/** Ack File/Session Qualifier */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct afq_t {
|
|||
|
|
byte_t STATUS:4;
|
|||
|
|
byte_t ACK:4;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct afq_t {
|
|||
|
|
byte_t ACK:4;
|
|||
|
|
byte_t STATUS:4;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union AFQ AFQ;
|
|||
|
|
/** Ack File/Session Qualifier */
|
|||
|
|
union AFQ {
|
|||
|
|
byte_t bits;
|
|||
|
|
afq_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** ===========================<3D><>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>================================= */
|
|||
|
|
|
|||
|
|
/** Process information in monitor direction (station-specific parameter) */
|
|||
|
|
typedef struct M_SP_NA_1_t M_SP_NA_1_t;
|
|||
|
|
/** Single-point information */
|
|||
|
|
struct M_SP_NA_1_t {
|
|||
|
|
SIQ siq;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_SP_TA_1_t M_SP_TA_1_t;
|
|||
|
|
/** Single-point information with time tag */
|
|||
|
|
struct M_SP_TA_1_t {
|
|||
|
|
SIQ siq;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_DP_NA_1_t M_DP_NA_1_t;
|
|||
|
|
/** Double-point information */
|
|||
|
|
struct M_DP_NA_1_t {
|
|||
|
|
DIQ diq;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_DP_TA_1_t M_DP_TA_1_t;
|
|||
|
|
/** Double-point information with time tag */
|
|||
|
|
struct M_DP_TA_1_t {
|
|||
|
|
DIQ diq;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ST_NA_1_t M_ST_NA_1_t;
|
|||
|
|
/** Step position information */
|
|||
|
|
struct M_ST_NA_1_t {
|
|||
|
|
VTI vti;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ST_TA_1_t M_ST_TA_1_t;
|
|||
|
|
/** Step position information with time tag */
|
|||
|
|
struct M_ST_TA_1_t {
|
|||
|
|
VTI vti;
|
|||
|
|
QDS qds;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_BO_NA_1_t M_BO_NA_1_t;
|
|||
|
|
/** Bitstring of 32 bit */
|
|||
|
|
struct M_BO_NA_1_t {
|
|||
|
|
BSI bsi;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_SA_NA_1_t M_SA_NA_1_t;
|
|||
|
|
/** String of ASCII */
|
|||
|
|
struct M_SA_NA_1_t {
|
|||
|
|
byte_t length;
|
|||
|
|
char str[1];
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_BO_TA_1_t M_BO_TA_1_t;
|
|||
|
|
/** Bitstring of 32 bit with time tag */
|
|||
|
|
struct M_BO_TA_1_t {
|
|||
|
|
BSI bsi;
|
|||
|
|
QDS qds;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_NA_1_t M_ME_NA_1_t;
|
|||
|
|
/** Measured value, normalised value */
|
|||
|
|
struct M_ME_NA_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_TA_1_t M_ME_TA_1_t;
|
|||
|
|
/** Measured value, normalised value with time tag */
|
|||
|
|
struct M_ME_TA_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
QDS qds;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_NB_1_t M_ME_NB_1_t;
|
|||
|
|
/** Measured value, scaled value */
|
|||
|
|
struct M_ME_NB_1_t {
|
|||
|
|
SVA sva;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_TB_1_t M_ME_TB_1_t;
|
|||
|
|
/** Measured value, scaled value with time tag */
|
|||
|
|
struct M_ME_TB_1_t {
|
|||
|
|
SVA sva;
|
|||
|
|
QDS qds;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_NC_1_t M_ME_NC_1_t;
|
|||
|
|
/** Measured value, short floating point value */
|
|||
|
|
struct M_ME_NC_1_t {
|
|||
|
|
IEEE754SP std;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_TC_1_t M_ME_TC_1_t;
|
|||
|
|
/** Measured value, short floating point value with time tag */
|
|||
|
|
struct M_ME_TC_1_t {
|
|||
|
|
IEEE754SP std;
|
|||
|
|
QDS qds;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_NA_1_t M_IT_NA_1_t;
|
|||
|
|
/** Integrated totals */
|
|||
|
|
struct M_IT_NA_1_t {
|
|||
|
|
BCR bcr;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_TA_1_t M_IT_TA_1_t;
|
|||
|
|
/** Integrated totals with time tag */
|
|||
|
|
struct M_IT_TA_1_t {
|
|||
|
|
BCR bcr;
|
|||
|
|
CP24Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_EP_TA_1_t M_EP_TA_1_t;
|
|||
|
|
/** Event of protection equipment with time tag */
|
|||
|
|
struct M_EP_TA_1_t {
|
|||
|
|
SEP sep;
|
|||
|
|
CP16Time2a tm16;
|
|||
|
|
CP24Time2a tm24;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_EP_TB_1_t M_EP_TB_1_t;
|
|||
|
|
/** Packed start events of protection equipment with time tag */
|
|||
|
|
struct M_EP_TB_1_t {
|
|||
|
|
SPE spe;
|
|||
|
|
QDP qdp;
|
|||
|
|
CP16Time2a tm16;
|
|||
|
|
CP24Time2a tm24;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_EP_TC_1_t M_EP_TC_1_t;
|
|||
|
|
/** Packed output circuit information of protection equipment with time tag */
|
|||
|
|
struct M_EP_TC_1_t {
|
|||
|
|
OCI oci;
|
|||
|
|
QDP qdp;
|
|||
|
|
CP16Time2a tm16;
|
|||
|
|
CP24Time2a tm24;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_PS_NA_1_t M_PS_NA_1_t;
|
|||
|
|
/** Packed single point information with time tag */
|
|||
|
|
struct M_PS_NA_1_t {
|
|||
|
|
SCD scd;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_ND_1_t M_ME_ND_1_t;
|
|||
|
|
/** Measured value, normalised value without quality descriptor */
|
|||
|
|
struct M_ME_ND_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_SP_TB_1_t M_SP_TB_1_t;
|
|||
|
|
/** Single point information with time tag CP56Time2a */
|
|||
|
|
struct M_SP_TB_1_t {
|
|||
|
|
SIQ siq;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_DP_TB_1_t M_DP_TB_1_t;
|
|||
|
|
/** Double point information with time tag CP56Time2a */
|
|||
|
|
struct M_DP_TB_1_t {
|
|||
|
|
DIQ diq;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ST_TB_1_t M_ST_TB_1_t;
|
|||
|
|
/** Step position information with time tag CP56Time2a */
|
|||
|
|
struct M_ST_TB_1_t {
|
|||
|
|
VTI vti;
|
|||
|
|
QDS qds;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_BO_TB_1_t M_BO_TB_1_t;
|
|||
|
|
/** Bitstring of 32 bit with time tag CP56Time2a */
|
|||
|
|
struct M_BO_TB_1_t {
|
|||
|
|
BSI bsi;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_TD_1_t M_ME_TD_1_t;
|
|||
|
|
/** Measured value, normalised value with time tag CP56Time2a */
|
|||
|
|
struct M_ME_TD_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
QDS qds;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_TE_1_t M_ME_TE_1_t;
|
|||
|
|
/** Measured value, scaled value with time tag CP56Time2a */
|
|||
|
|
struct M_ME_TE_1_t {
|
|||
|
|
SVA sva;
|
|||
|
|
QDS qds;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_ME_TF_1_t M_ME_TF_1_t;
|
|||
|
|
/** Measured value, short floating point value with time tag CP56Time2a */
|
|||
|
|
struct M_ME_TF_1_t {
|
|||
|
|
IEEE754SP std;
|
|||
|
|
QDS qds;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_TB_1_t M_IT_TB_1_t;
|
|||
|
|
/** Integrated totals with time tag CP56Time2a */
|
|||
|
|
struct M_IT_TB_1_t {
|
|||
|
|
BCR bcr;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_EP_TD_1_t M_EP_TD_1_t;
|
|||
|
|
/** Event of protection equipment with time tag CP56Time2a */
|
|||
|
|
struct M_EP_TD_1_t {
|
|||
|
|
SEP sep;
|
|||
|
|
CP16Time2a tm16;
|
|||
|
|
CP56Time2a tm56;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_EP_TE_1_t M_EP_TE_1_t;
|
|||
|
|
/** Packed start events of protection equipment with time tag CP56Time2a */
|
|||
|
|
struct M_EP_TE_1_t {
|
|||
|
|
SPE spe;
|
|||
|
|
QDP qdp;
|
|||
|
|
CP16Time2a tm16;
|
|||
|
|
CP56Time2a tm56;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_EP_TF_1_t M_EP_TF_1_t;
|
|||
|
|
/** Packed tripping events of protection equipment with time tag CP56Time2a */
|
|||
|
|
struct M_EP_TF_1_t {
|
|||
|
|
OCI oci;
|
|||
|
|
QDP qdp;
|
|||
|
|
CP16Time2a tm16;
|
|||
|
|
CP56Time2a tm56;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** ˳<><CBB3>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽṹ */
|
|||
|
|
typedef struct es_nva_t es_nva_t;
|
|||
|
|
struct es_nva_t {
|
|||
|
|
byte_t step;
|
|||
|
|
byte_t flag;
|
|||
|
|
byte_t no;
|
|||
|
|
byte_t pause_time;
|
|||
|
|
byte_t rsv2;
|
|||
|
|
byte_t rsv3;
|
|||
|
|
byte_t rsv4;
|
|||
|
|
byte_t rsv5;
|
|||
|
|
byte_t rsv6;
|
|||
|
|
byte_t rsv7;
|
|||
|
|
byte_t rsv8;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
typedef struct es_str_t es_str_t;
|
|||
|
|
struct es_str_t {
|
|||
|
|
byte_t strlen;
|
|||
|
|
byte_t string[255];
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
typedef struct M_ES_NA_1_t M_ES_NA_1_t;
|
|||
|
|
struct M_ES_NA_1_t {
|
|||
|
|
es_nva_t esn;
|
|||
|
|
es_str_t ess;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** Process information in control direction (station-specific parameter) */
|
|||
|
|
typedef struct C_SC_NA_1_t C_SC_NA_1_t;
|
|||
|
|
/** Single command */
|
|||
|
|
struct C_SC_NA_1_t {
|
|||
|
|
SCO sco;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_DC_NA_1_t C_DC_NA_1_t;
|
|||
|
|
/** Double command */
|
|||
|
|
struct C_DC_NA_1_t {
|
|||
|
|
DCO dco;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_RC_NA_1_t C_RC_NA_1_t;
|
|||
|
|
/** Regulating step command */
|
|||
|
|
struct C_RC_NA_1_t {
|
|||
|
|
RCO rco;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SE_NA_1_t C_SE_NA_1_t;
|
|||
|
|
/** Set point command, normalised value */
|
|||
|
|
struct C_SE_NA_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
QOSP qos;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SE_EX_1_t C_SE_EX_1_t;
|
|||
|
|
/** Set point command, normalised value ,ֱ<><D6B1>ִ<EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD>跴У
|
|||
|
|
S/E λ<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0
|
|||
|
|
*/
|
|||
|
|
struct C_SE_EX_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
QOSP qos;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SE_NB_1_t C_SE_NB_1_t;
|
|||
|
|
/** Set point command, scaled value */
|
|||
|
|
struct C_SE_NB_1_t {
|
|||
|
|
SVA sva;
|
|||
|
|
QOSP qos;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SE_NC_1_t C_SE_NC_1_t;
|
|||
|
|
/** Set point command, short floating point value */
|
|||
|
|
struct C_SE_NC_1_t {
|
|||
|
|
IEEE754SP std;
|
|||
|
|
QOSP qos;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_BO_NA_1_t C_BO_NA_1_t;
|
|||
|
|
/** Bitstring of 32 bit */
|
|||
|
|
struct C_BO_NA_1_t {
|
|||
|
|
BSI bsi;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SC_TA_1_t C_SC_TA_1_t;
|
|||
|
|
/** Single command with time tag CP56Time2a */
|
|||
|
|
struct C_SC_TA_1_t {
|
|||
|
|
SCO sco;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_DC_TA_1_t C_DC_TA_1_t;
|
|||
|
|
/** Double command with time tag CP56Time2a */
|
|||
|
|
struct C_DC_TA_1_t {
|
|||
|
|
DCO dco;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_RC_TA_1_t C_RC_TA_1_t;
|
|||
|
|
/** Regulating step command with time tag CP56Time2a */
|
|||
|
|
struct C_RC_TA_1_t {
|
|||
|
|
RCO rco;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SE_TA_1_t C_SE_TA_1_t;
|
|||
|
|
/** Set point command, normalised value with time tag CP56Time2a */
|
|||
|
|
struct C_SE_TA_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
QOSP qos;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SE_TB_1_t C_SE_TB_1_t;
|
|||
|
|
/** Set point command, scaled value with time tag CP56Time2a */
|
|||
|
|
struct C_SE_TB_1_t {
|
|||
|
|
SVA sva;
|
|||
|
|
QOSP qos;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_SE_TC_1_t C_SE_TC_1_t;
|
|||
|
|
/** Set point command, short floating point value with time tag CP56Time2a */
|
|||
|
|
struct C_SE_TC_1_t {
|
|||
|
|
IEEE754SP std;
|
|||
|
|
QOSP qos;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_BO_TA_1_t C_BO_TA_1_t;
|
|||
|
|
/** Bitstring of 32 bit with time tag CP56Time2a */
|
|||
|
|
struct C_BO_TA_1_t {
|
|||
|
|
BSI bsi;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** System information in monitor direction (station-specific parameter) */
|
|||
|
|
typedef struct M_EI_NA_1_t M_EI_NA_1_t;
|
|||
|
|
/** End of initialisation */
|
|||
|
|
struct M_EI_NA_1_t {
|
|||
|
|
COI coi;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** System information in control direction (station-specific parameter) */
|
|||
|
|
typedef struct C_IC_NA_1_t C_IC_NA_1_t;
|
|||
|
|
/** Interrogation command */
|
|||
|
|
struct C_IC_NA_1_t {
|
|||
|
|
QOI qoi;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_CI_NA_1_t C_CI_NA_1_t;
|
|||
|
|
/** Counter interrogation command */
|
|||
|
|
struct C_CI_NA_1_t {
|
|||
|
|
QCC qcc;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/* Read command = C_RD_NA_1 no structure body */
|
|||
|
|
|
|||
|
|
typedef struct C_CS_NA_1_t C_CS_NA_1_t;
|
|||
|
|
/** Clock synchronisation command */
|
|||
|
|
struct C_CS_NA_1_t {
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_TS_NA_1_t C_TS_NA_1_t;
|
|||
|
|
/** Test command */
|
|||
|
|
struct C_TS_NA_1_t {
|
|||
|
|
FBP fbp;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_RP_NA_1_t C_RP_NA_1_t;
|
|||
|
|
/** Reset process command */
|
|||
|
|
struct C_RP_NA_1_t {
|
|||
|
|
QRP qrp;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_CD_NA_1_t C_CD_NA_1_t;
|
|||
|
|
/** Delay acquisition command */
|
|||
|
|
struct C_CD_NA_1_t {
|
|||
|
|
CP16Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct C_TS_TA_1_t C_TS_TA_1_t;
|
|||
|
|
/** Test command with time tag CP56Time2a */
|
|||
|
|
struct C_TS_TA_1_t {
|
|||
|
|
FBP fbp;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** Parameter in control direction (station-specific parameter) */
|
|||
|
|
typedef struct P_ME_NA_1_t P_ME_NA_1_t;
|
|||
|
|
/** Parameter of measured value, normalised value */
|
|||
|
|
struct P_ME_NA_1_t {
|
|||
|
|
NVA nva;
|
|||
|
|
QPM qpm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct P_ME_NB_1_t P_ME_NB_1_t;
|
|||
|
|
/** Parameter of measured value, scaled value */
|
|||
|
|
struct P_ME_NB_1_t {
|
|||
|
|
SVA sva;
|
|||
|
|
QPM qpm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct P_ME_NC_1_t P_ME_NC_1_t;
|
|||
|
|
/** Parameter of measured value, short floating point value */
|
|||
|
|
struct P_ME_NC_1_t {
|
|||
|
|
IEEE754SP std;
|
|||
|
|
QPM qpm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct P_AC_NA_1_t P_AC_NA_1_t;
|
|||
|
|
/** Active parameter */
|
|||
|
|
struct P_AC_NA_1_t {
|
|||
|
|
QPA qpa;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct F_FR_NA_1_t F_FR_NA_1_t;
|
|||
|
|
/** File Transfer (station-specific parameter) */
|
|||
|
|
struct F_FR_NA_1_t {
|
|||
|
|
NOF nof;
|
|||
|
|
LOF lof;
|
|||
|
|
FRQ frq;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct F_SR_NA_1_t F_SR_NA_1_t;
|
|||
|
|
/** Section ready */
|
|||
|
|
struct F_SR_NA_1_t {
|
|||
|
|
NOF nof;
|
|||
|
|
NOS nos;
|
|||
|
|
LOF lof;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct F_SC_NA_1_t F_SC_NA_1_t;
|
|||
|
|
/** Call directory, select file, call file, call section */
|
|||
|
|
struct F_SC_NA_1_t {
|
|||
|
|
NOF nof;
|
|||
|
|
NOS nos;
|
|||
|
|
SCQ scq;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct F_LS_NA_1_t F_LS_NA_1_t;
|
|||
|
|
/** Last section, last segment */
|
|||
|
|
struct F_LS_NA_1_t {
|
|||
|
|
NOF nof;
|
|||
|
|
NOS nos;
|
|||
|
|
LSQ lsq;
|
|||
|
|
CHS chs;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct F_AF_NA_1_t F_AF_NA_1_t;
|
|||
|
|
/** Ack file, ack section */
|
|||
|
|
struct F_AF_NA_1_t {
|
|||
|
|
NOF nof;
|
|||
|
|
NOS nos;
|
|||
|
|
AFQ afq;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct F_SG_NA_1_t F_SG_NA_1_t;
|
|||
|
|
/** Segment */
|
|||
|
|
struct F_SG_NA_1_t {
|
|||
|
|
NOF nof;
|
|||
|
|
NOS nos;
|
|||
|
|
LOS los;
|
|||
|
|
byte_t seg[1];
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct F_DR_TA_1_t F_DR_TA_1_t;
|
|||
|
|
/** Directory */
|
|||
|
|
struct F_DR_TA_1_t {
|
|||
|
|
NOF nof;
|
|||
|
|
LOF lof;
|
|||
|
|
SOF nos;
|
|||
|
|
CP56Time2a tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** Special type for AGC */
|
|||
|
|
typedef struct C_SE_ND_1_t C_SE_ND_1_t;
|
|||
|
|
/** Set multi-point command, normalised value */
|
|||
|
|
struct C_SE_ND_1_t {
|
|||
|
|
uint16_t num; /** <20>趨ֵ<E8B6A8><D6B5>Ŀ */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** ===========================<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD><EFBFBD>================================= */
|
|||
|
|
typedef struct ACC_PARAM_RELTIME_t ACC_PARAM_RELTIME_t;
|
|||
|
|
struct ACC_PARAM_RELTIME_t{
|
|||
|
|
uint16_t relativetime;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct ACC_PARAM_FAN_t ACC_PARAM_FAN_t;
|
|||
|
|
struct ACC_PARAM_FAN_t{
|
|||
|
|
uint16_t fan;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct ACC_PARAM_NOF_t ACC_PARAM_NOF_t;
|
|||
|
|
struct ACC_PARAM_NOF_t{
|
|||
|
|
uint16_t nof;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct PHASE_t{
|
|||
|
|
byte_t phaseA :1; //A<><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t phaseB :1; //B<><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t phaseC :1; //C<><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t phaseI :1; //<2F>ӵع<D3B5><D8B9><EFBFBD>
|
|||
|
|
byte_t phaseO :1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t res :2; //<2F><><EFBFBD><EFBFBD>
|
|||
|
|
byte_t valid :1; //<2F><>Чλ
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct PHASE_t{
|
|||
|
|
byte_t phaseA :1; //A<><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t phaseB :1; //B<><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t phaseC :1; //C<><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t phaseI :1; //<2F>ӵع<D3B5><D8B9><EFBFBD>
|
|||
|
|
byte_t phaseO :1; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
byte_t res :2; //<2F><><EFBFBD><EFBFBD>
|
|||
|
|
byte_t valid :1; //<2F><>Чλ
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union ACC_PARAM_PHASE_t ACC_PARAM_PHASE_t;
|
|||
|
|
union ACC_PARAM_PHASE_t{
|
|||
|
|
byte_t bit;
|
|||
|
|
struct PHASE_t phase;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct ACC_PARAM_DISTANCE_t ACC_PARAM_DISTANCE_t;
|
|||
|
|
struct ACC_PARAM_DISTANCE_t{
|
|||
|
|
float distance;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct ACC_PARAM_MAXI_t ACC_PARAM_MAXI_t;
|
|||
|
|
struct ACC_PARAM_MAXI_t{
|
|||
|
|
float max_i;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct ACC_PARAM_MINI_t ACC_PARAM_MINI_t;
|
|||
|
|
struct ACC_PARAM_MINI_t{
|
|||
|
|
float min_i;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
/** ===========================EYE-LINUXϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD>ṹ================================= */
|
|||
|
|
typedef struct C_MT_ND_1_t C_MT_ND_1_t;
|
|||
|
|
/** Multi-point transmit command, normalised value */
|
|||
|
|
struct C_MT_ND_1_t {
|
|||
|
|
uint16_t num; /** <20>趨ֵ<E8B6A8><D6B5>Ŀ */
|
|||
|
|
dco_t dco; /** ѡ<><D1A1>/ִ<><D6B4> */
|
|||
|
|
byte_t desc; /** <20><>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD> */
|
|||
|
|
uint16_t start; /** <20><>ֵ<EFBFBD><D6B5>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> */
|
|||
|
|
uint16_t end; /** <20><>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct gd_t gd_t;
|
|||
|
|
struct gd_t {
|
|||
|
|
byte_t size; //<2F><><EFBFBD>ֽڱ<D6BD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD> <20><>c<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>β \0<><30>ռ<EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
|||
|
|
byte_t gid[255];
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
/** <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD> */
|
|||
|
|
/* <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>ʾ<EFBFBD><CABE>
|
|||
|
|
byte_t value[256];
|
|||
|
|
value_t val;
|
|||
|
|
|
|||
|
|
val.data = &value;
|
|||
|
|
val.typid = M_GD_NA_1;
|
|||
|
|
value[0] = strlen(str)+1 ; //val.data<74><61><EFBFBD>֣<EFBFBD><D6A3><EFBFBD><EFBFBD>ֽڱ<D6BD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1 <20><>c<EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD>Ľ<EFBFBD>β \0<><30>ռ<EFBFBD>ij<EFBFBD><C4B3><EFBFBD>
|
|||
|
|
val.size = value[0] +1; //value_t<5F><74>size Ӧ<><D3A6><EFBFBD>ǣ<EFBFBD> <20>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> + <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ֽ<EFBFBD>
|
|||
|
|
strcpy(value+1,str);
|
|||
|
|
*/
|
|||
|
|
/** Special type for eye-linux */
|
|||
|
|
typedef union M_GD_NA_1_t M_GD_NA_1_t;
|
|||
|
|
/** IEC60870-5-103 GDD structure, eye-linux special */
|
|||
|
|
union M_GD_NA_1_t {
|
|||
|
|
byte_t bits[256];
|
|||
|
|
gd_t parts;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
typedef union C_GD_NA_1_t C_GD_NA_1_t;
|
|||
|
|
/** IEC60870-5-103 GDD structure, eye-linux special */
|
|||
|
|
union C_GD_NA_1_t {
|
|||
|
|
byte_t bits[256];
|
|||
|
|
gd_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct value_t value_t;
|
|||
|
|
/** <20><><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵĻ<DDB5><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ */
|
|||
|
|
struct value_t {
|
|||
|
|
byte_t typid; /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͣ<EFBFBD>ʹ<EFBFBD><CAB9>IEC60870-5-101<30><31>ASDU TYP<59><50><EFBFBD><EFBFBD> */
|
|||
|
|
uint16_t size; /**< = sizeof(typid<69><64><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>) */
|
|||
|
|
void* data; /**< ָ<><D6B8>size<7A><65>С<EFBFBD><D0A1><EFBFBD>ڴ滺<DAB4><E6BBBA><EFBFBD><EFBFBD>(<28>洢<EFBFBD><E6B4A2>typid<69><64><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD>) */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
#define REQ_TD_2 2 //ѡ<><D1A1>¼<EFBFBD><C2BC>
|
|||
|
|
#define STA_TD_4 4 //<2F><><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>
|
|||
|
|
|
|||
|
|
#define ACC_ACK_OK 1 //<2F><>¼<EFBFBD><C2BC>(<28>б<EFBFBD>)<29><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><C2B7>ɹ<EFBFBD>
|
|||
|
|
#define ACC_ACK_FALUT 2 //<2F><>¼<EFBFBD><C2BC>(<28>б<EFBFBD>)<29><><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>ʧ<EFBFBD><CAA7>
|
|||
|
|
#define ACC_ACK_BUZY 3 //װ<><D7B0>æ<EFBFBD><C3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ<EFBFBD>·<EFBFBD>
|
|||
|
|
#define ACC_ACK_NOSUPPORT 4 //װ<>ò<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD>¼<EFBFBD><C2BC>(<28>ֶ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
|||
|
|
|
|||
|
|
typedef struct dist_record_t dist_record_t;
|
|||
|
|
/** Disurbance record */
|
|||
|
|
struct dist_record_t {
|
|||
|
|
uint16_t fan;
|
|||
|
|
byte_t sof;
|
|||
|
|
CP56Time2a glb_tm;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct dist_table_t dist_table_t;
|
|||
|
|
/** Recorded disturbance table */
|
|||
|
|
struct dist_table_t {
|
|||
|
|
uint32_t ied;
|
|||
|
|
uint16_t cpu;
|
|||
|
|
byte_t nor; /**< Number of disturbance recorded */
|
|||
|
|
dist_record_t *rec;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
typedef struct sfa_t sfa_t;
|
|||
|
|
/** Status of Fault */
|
|||
|
|
#ifdef PPC_LINUX
|
|||
|
|
struct sfa_t {
|
|||
|
|
byte_t RES:4;
|
|||
|
|
byte_t OTEV:1; /**< Other event (disturbance data recording initiated by) */
|
|||
|
|
byte_t TEST:1; /**< Type of disturbance values */
|
|||
|
|
byte_t TM:1; /**< Transmit (disturbance data) */
|
|||
|
|
byte_t TP:1; /**< Trip (Recorded fault) */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#else
|
|||
|
|
struct sfa_t {
|
|||
|
|
byte_t TP:1; /**< Trip (Recorded fault) */
|
|||
|
|
byte_t TM:1; /**< Transmit (disturbance data) */
|
|||
|
|
byte_t TEST:1; /**< Type of disturbance values */
|
|||
|
|
byte_t OTEV:1; /**< Other event (disturbance data recording initiated by) */
|
|||
|
|
byte_t RES:4;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
typedef union SFA SFA;
|
|||
|
|
/** Status of Fault */
|
|||
|
|
union SFA {
|
|||
|
|
byte_t bits;
|
|||
|
|
sfa_t parts;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct accs_t accs_t;
|
|||
|
|
/** Actual channel data */
|
|||
|
|
struct accs_t {
|
|||
|
|
byte_t tov; /**< Type of disturbance values */
|
|||
|
|
byte_t acc; /**< Actual channel */
|
|||
|
|
char name[32]; /**< channel name */
|
|||
|
|
char szPhase[8]; /**< channel Phase */
|
|||
|
|
char szUnit[8]; /**< Unit */
|
|||
|
|
IEEE754SP rpv; /**< Rated primary value */
|
|||
|
|
IEEE754SP rsv; /**< Rated secondary value */
|
|||
|
|
IEEE754SP rfa; /**< Reference factor */
|
|||
|
|
byte_t maxframe; /**< max frame number */
|
|||
|
|
uint16_t *ndv; /**< Number of disturbance value */
|
|||
|
|
uint16_t *nfe; /**< The order of firsr disturbance value*/
|
|||
|
|
int16_t **sdv; /**< Single disturbance value buffer */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct tap_t tap_t;
|
|||
|
|
/** Tag postion */
|
|||
|
|
struct tap_t {
|
|||
|
|
uint16_t tap; /**< Tag postion */
|
|||
|
|
DIQ dpi; /**< Double point information */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct tags_t tags_t;
|
|||
|
|
/** Tag postion data */
|
|||
|
|
struct tags_t {
|
|||
|
|
byte_t fun; /**< Function type */
|
|||
|
|
byte_t inf; /**< Information number */
|
|||
|
|
byte_t noe; /**< number of tag */
|
|||
|
|
char name[32]; /**< tag Name */
|
|||
|
|
tap_t *tag;/**< Tag postion buffer */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct timespan_t timespan_t;
|
|||
|
|
struct timespan_t {
|
|||
|
|
int flag; // (0=<3D>ٷǹ<D9B7><C7B9><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><CDB9><EFBFBD>¼<EFBFBD><C2BC>) <20><>1=ֻ<>ٹ<EFBFBD><D9B9><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>
|
|||
|
|
CP56Time2a lowbound; //low bound of acc time
|
|||
|
|
CP56Time2a highbound; //high bound of acc time
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_EX_TA_1_t M_EX_TA_1_t;
|
|||
|
|
#define EXT_SOE_PARAMETER (100) /**< SOE<4F><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չ */
|
|||
|
|
struct M_EX_TA_1_t {
|
|||
|
|
byte_t typid; /**< <20><>ͨSOE<4F><45><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
byte_t res_flag1; /**< <20><><EFBFBD>ñ<EFBFBD>־<EFBFBD><D6BE>Ŀǰ<C4BF><C7B0>0 */
|
|||
|
|
byte_t data_1[16]; /**< <20><>д<EFBFBD><D0B4><EFBFBD><EFBFBD>ͨSOE<4F><45><EFBFBD><EFBFBD> (Cp56+FLOAT+QOS=7+4+1=13 16 should enough) */
|
|||
|
|
byte_t ext_typid; /**< <20><>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
uint16_t len; /**< <20><>չ<EFBFBD><D5B9><EFBFBD>ֱ<EFBFBD><D6B1>ij<EFBFBD><C4B3><EFBFBD> */
|
|||
|
|
byte_t res_flag2; /**< <20><><EFBFBD><EFBFBD> */
|
|||
|
|
char data_2[256]; /**< <20><>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct EXT_SOE_PARAMETER_HEADER_t EXT_SOE_PARAMETER_HEADER_t;
|
|||
|
|
struct EXT_SOE_PARAMETER_HEADER_t {
|
|||
|
|
byte_t param_id; /**< <20><><EFBFBD><EFBFBD>ID<49><44> */
|
|||
|
|
byte_t param_type; /**< <20><><EFBFBD><EFBFBD>TYPE */
|
|||
|
|
byte_t param_len; /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
/*...<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
//<2F><>ָ<EFBFBD><D6B8>װ<EFBFBD><D7B0>¼<EFBFBD><C2BC><EFBFBD>б<EFBFBD>
|
|||
|
|
typedef struct D_RE_DT_1_t D_RE_DT_1_t;
|
|||
|
|
struct D_RE_DT_1_t {
|
|||
|
|
timespan_t timespan;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>¼<EFBFBD><C2BC>
|
|||
|
|
typedef struct D_FA_SE_1_t D_FA_SE_1_t;
|
|||
|
|
struct D_FA_SE_1_t {
|
|||
|
|
dist_record_t dist_record;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct D_ACC_ACK_1_t D_ACC_ACK_1_t;
|
|||
|
|
struct D_ACC_ACK_1_t{
|
|||
|
|
byte_t response; //<2F><>Լ<EFBFBD><D4BC>Ӧ(ACC_ACK_OK<4F><4B>)
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct M_IT_S1_1_t M_IT_S1_1_t;
|
|||
|
|
|
|||
|
|
struct M_IT_S1_1_t {
|
|||
|
|
int8_t s_int1;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_U1_1_t M_IT_U1_1_t;
|
|||
|
|
|
|||
|
|
struct M_IT_U1_1_t {
|
|||
|
|
byte_t u_int1;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct M_IT_S2_1_t M_IT_S2_1_t;
|
|||
|
|
|
|||
|
|
struct M_IT_S2_1_t {
|
|||
|
|
int16_t s_int2;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_U2_1_t M_IT_U2_1_t;
|
|||
|
|
|
|||
|
|
struct M_IT_U2_1_t {
|
|||
|
|
uint16_t u_int2;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_S4_1_t M_IT_S4_1_t;
|
|||
|
|
struct M_IT_S4_1_t {
|
|||
|
|
int32_t s_int4;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_U4_1_t M_IT_U4_1_t;
|
|||
|
|
struct M_IT_U4_1_t {
|
|||
|
|
uint32_t u_int4;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_F4_1_t M_IT_F4_1_t;
|
|||
|
|
struct M_IT_F4_1_t {
|
|||
|
|
float32_t f_4;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
typedef struct M_IT_F8_1_t M_IT_F8_1_t;
|
|||
|
|
struct M_IT_F8_1_t {
|
|||
|
|
float64_t f_8;
|
|||
|
|
QDS qds;
|
|||
|
|
}ALIGNPACKED;
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
#ifdef _OS_WIN32_
|
|||
|
|
#pragma pack(pop)
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
/** @} */
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
extern "C" {
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
/** <20><><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD>IEC60870<37><30><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>vlaue_t<5F>ṹ<EFBFBD><E1B9B9>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽת<CABD><D7AA> */
|
|||
|
|
APR_DECLARE(int) copy_iec_data(value_t *dstval,value_t *srcval,uint32_t flags);
|
|||
|
|
|
|||
|
|
/** <20><><EFBFBD><EFBFBD>ijһ<C4B3><D2BB><EFBFBD><EFBFBD>IEC60870-5-101<30><31><EFBFBD><D7BC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><E1B9B9><EFBFBD>ֽڳ<D6BD><DAB3><EFBFBD> */
|
|||
|
|
APR_DECLARE(size_t) sizeof_typid_data(byte_t typid);
|
|||
|
|
|
|||
|
|
/** <20><><EFBFBD><EFBFBD>ijһ<C4B3><D2BB><EFBFBD><EFBFBD>IEC60870-5-101<30><31><EFBFBD><D7BC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><F3BBBAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֽڳ<D6BD><DAB3><EFBFBD> */
|
|||
|
|
APR_DECLARE(size_t) sizeof_typid_buf(byte_t typid, byte_t *buf);
|
|||
|
|
|
|||
|
|
/** <20><>value_t<5F><74>ʾ<EFBFBD><CABE>ֵת<D6B5><D7AA><EFBFBD>ɱ<EFBFBD>ʾ<EFBFBD><CABE>ֵʵ<D6B5><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD> */
|
|||
|
|
APR_DECLARE(int) data_value2string(value_t *val,char *szvalue);
|
|||
|
|
|
|||
|
|
APR_DECLARE(int) data_actual_val(value_t *val,void *actval);
|
|||
|
|
/** <20>õ<EFBFBD>EX_TA_1 <20><>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>չ<EFBFBD><D5B9><EFBFBD>ֳ<EFBFBD><D6B3><EFBFBD><EFBFBD>ֽڵ<D6BD>ƫ<EFBFBD><C6AB><EFBFBD><EFBFBD> */
|
|||
|
|
APR_DECLARE(size_t) RDB_Get_EX_TA_Len_offset(byte_t *buf);
|
|||
|
|
|
|||
|
|
/** <20><>С<EFBFBD><D0A1>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IEC60870<37><30><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>vlaue_t<5F>ṹ<EFBFBD><E1B9B9>ֵ */
|
|||
|
|
APR_DECLARE(int) htolval_iec_data(value_t *dstval,value_t *srcval);
|
|||
|
|
|
|||
|
|
#ifdef __cplusplus
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
#endif /*_INC_IEC60870_5_101_TYPE_H */
|