Initial commit: my SECS2 project
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#ifndef _PROTO_SECS2_H_
|
||||
#define _PROTO_SECS2_H_
|
||||
|
||||
#include "main.h"
|
||||
#include "proto_HSMS.h"
|
||||
|
||||
#define PROTO_SECS2_S1F3 (0x0103) /*数据采集*/
|
||||
#define PROTO_SECS2_S2F49 (0x0231) /*设备状态远程控制*/
|
||||
#define PROTO_SECS2_S1F1 (0x0101) /*心跳*/
|
||||
#define PROTO_SECS2_S6F11 (0x060B) /*设备主动报警*/
|
||||
#define PROTO_SECS2_S6F12 (0x060C) /*确认报警*/
|
||||
#define PROTO_SECS2_S1F13 (0x010D) /*建立连接*/
|
||||
#define PROTO_SECS2_S2F31 (0x021F) /*时间设置*/
|
||||
|
||||
/*报警和状态哦改变是否需要响应*/
|
||||
#define PROTO_ALARM_CHANGE_RX_WAIT (1)
|
||||
#define PROTO_STATE_CHANGE_RX_WAIT (1)
|
||||
|
||||
/*数据类型*/
|
||||
#define PROTO_SECS2_DATA_TYPE_List 000/*八进制*/
|
||||
#define PROTO_SECS2_DATA_TYPE_Binary 010
|
||||
#define PROTO_SECS2_DATA_TYPE_Bool 011
|
||||
#define PROTO_SECS2_DATA_TYPE_ASCII 020
|
||||
#define PROTO_SECS2_DATA_TYPE_JIS_8 021
|
||||
#define PROTO_SECS2_DATA_TYPE_2Byte_char 022
|
||||
#define PROTO_SECS2_DATA_TYPE_8Byte_int 030
|
||||
#define PROTO_SECS2_DATA_TYPE_1Byte_int 031
|
||||
#define PROTO_SECS2_DATA_TYPE_2Byte_int 032
|
||||
#define PROTO_SECS2_DATA_TYPE_4Byte_int 034
|
||||
#define PROTO_SECS2_DATA_TYPE_8Byte_float 040
|
||||
#define PROTO_SECS2_DATA_TYPE_4Byte_float 044
|
||||
#define PROTO_SECS2_DATA_TYPE_8Byte_uint 050
|
||||
#define PROTO_SECS2_DATA_TYPE_1Byte_uint 051
|
||||
#define PROTO_SECS2_DATA_TYPE_2Byte_uint 052
|
||||
#define PROTO_SECS2_DATA_TYPE_4Byte_uint 054
|
||||
|
||||
|
||||
/*解析出来的消息数据*/
|
||||
typedef struct
|
||||
{
|
||||
void *pData; /*解析的数据首地址*/
|
||||
u8 w_bit; /*是否需要响应*/
|
||||
u8 DataType; /*数据类型*/
|
||||
u8 ByteLen; /*字节长度*/
|
||||
u8 DataNum; /*数据个数*/
|
||||
}proto_SECS2_MessageData_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 sys_count;
|
||||
void (*Rx_DataAnalysis)(proto_HSMS_Header_Data_t *,u8 *,u16);
|
||||
void (*Tx_Alarm_Task)(void);
|
||||
void (*Tx_Dev_State_Task)(void);
|
||||
}proto_SECS2_t;
|
||||
|
||||
|
||||
extern proto_SECS2_t SECS2;
|
||||
#endif
|
||||
Reference in New Issue
Block a user