Initial commit: CCU621_M firmware project with BLE debug link support.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
/**
|
||||
* @file bs_ies_ctrl.h
|
||||
* @brief 积成 IES 平台协议控制层
|
||||
*
|
||||
* 定义 IES 协议私有数据结构、周期上送计时器及任务回调声明。
|
||||
* 协议版本由 BS_IES_TYPE 选择(默认积成 3.7)。
|
||||
*/
|
||||
#ifndef BS_IES_CTRL_H
|
||||
#define BS_IES_CTRL_H
|
||||
|
||||
#ifdef __cplusplus /*C++编译环境下兼容C语言*/
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*------ Exported includes(头文件) ----------------------*/
|
||||
#include "main.h"
|
||||
#if (BS_IES_EN)
|
||||
/*------ Exported macro(宏定义) -------------------------*/
|
||||
#define IES_TIMERCNT_NUM (4 + 3*GUN_MAX_CNT) //计时计数
|
||||
#define IES_ACK_STRUCT_NUM 5 //应答结构体数量
|
||||
|
||||
/*************************************
|
||||
* 宏名称: BS_IES_TYPE
|
||||
* 宏说明: 积成平台协议版本
|
||||
* 设置说明:未定义:报错
|
||||
* 1 山高平台 3.8 2积成 3.7 3积成 3.5
|
||||
*
|
||||
**************************************/
|
||||
#define BS_IES_TYPE 2
|
||||
|
||||
|
||||
/*------ Exported struct(结构体定义) --------------------*/
|
||||
typedef enum{
|
||||
IES_TIMER_Register = 0, //登录帧 0
|
||||
IES_TIMER_Heartbeat, //心跳 1
|
||||
IES_TIMER_FEE_REQ, //费率请求 2
|
||||
IES_TIMER_FAULT_GUN, //充电故障告警上送3
|
||||
IES_TIMER_REAL_WORK_GUN, //工作实时状态 数量跟随枪数量 - 包含工作状态和空闲状态两种 4
|
||||
//IES_TIMER_FAULT_GUN = IES_TIMER_REAL_WORK_GUN+GUN_MAX_CNT, //充电故障告警上送, 4+20 24
|
||||
IES_TIMER_MeterValues_GUN = IES_TIMER_REAL_WORK_GUN+GUN_MAX_CNT, //表底值上送, 25+20 45
|
||||
IES_TIMER_TRADE_INFO = IES_TIMER_MeterValues_GUN+GUN_MAX_CNT, //订单信息上送 数量跟随枪数量 46+20 66
|
||||
}IES_SEND_TIMER;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
U8_T id; //平台位置 平台1还是平台2
|
||||
U8_T u8_register_out_cnt; //登录帧超时计数
|
||||
U8_T u8_heart_outTime_cnt; //心跳超时计时
|
||||
U8_T u8_register_flag; //是否已注册/是否联网.0否1是
|
||||
|
||||
U8_T txFlag_askFeeMode; //请求费率
|
||||
U8_T u8_time_flag; //校时标志
|
||||
U8_T u8_heart_outTime; //心跳超时计时--
|
||||
|
||||
U16_T u16_msgSerialNumber; //帧序号
|
||||
U16_T u16_work_info_period; //工作实时状态 上送周期
|
||||
U16_T u16_free_info_period; //空闲实时状态 上送周期
|
||||
|
||||
struct
|
||||
{
|
||||
U8_T u8_MeterValues_type; //数据上送标志 0无动作 1空闲数据上送 2充电中数据上送 3交易开始数据上送 4交易停止数据上送
|
||||
U8_T u8_charge_req; //充电请求标志 0 不请求充电 1 请求充电
|
||||
}s_ctrl_flag[GUN_MAX_CNT]; //数据控制标志
|
||||
|
||||
struct
|
||||
{
|
||||
U8_T u8_real_state_cnt; //充电实时状态 上送计数
|
||||
U16_T u16_charge_cnt; //充电次数
|
||||
U32_T u32_charge_time; //充电时间
|
||||
}s_ies_gun[GUN_MAX_CNT];
|
||||
|
||||
struct
|
||||
{
|
||||
U16_T u16_timerCnt; //周期发送计数
|
||||
U16_T u16_timeNUM ; //计数周期值
|
||||
}s_timerCnt[IES_TIMERCNT_NUM];
|
||||
|
||||
}S_BS_IES_CTRL_DATA;
|
||||
/*------ Exported variables(变量定义) -------------------*/
|
||||
|
||||
/*------ Exported function prototypes (函数声明) -------*/
|
||||
void v_ies_init_data(U8_T bs_flag);
|
||||
U8_T v_ies_tcp_connect(void);
|
||||
U8_T v_ies_logo_on(void);
|
||||
void v_ies_recv_data(void);
|
||||
void v_ies_send_ctrl(void);
|
||||
void v_ies_private_logic(U8_T bs_flag);
|
||||
void v_ies_recv_unpack(U8_T id, U8_T *recvBuf,U16_T u16_len);
|
||||
void v_ies_send(U8_T *u8_sendBuf, U32_T sendLen);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* BS_IES_CTRL_H */
|
||||
Reference in New Issue
Block a user