Initial commit: CCU621_M firmware project with BLE debug link support.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-08 17:28:36 +08:00
commit 9ceb218f80
1597 changed files with 724159 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
# gwsdk — 国网平台 SDK(预留)
**当前未参与 CCU621 编译。**
- `public_define.h``BS_GWSDK_EN = 0`
- `GD32H759.uvprojx` 未添加本目录下 `.c` 文件
- 依赖第三方头:`infra_defs.h``protocol.h` 等(PCU606 侧 SDK 包)
启用前需:
1. 将 SDK 库与头文件路径加入 Keil Include
2.`bs_gwsdk_ctrl.c``bs_gwsdk_interface.c` 加入工程
3.`gwsdk_interface.c``ccu_comm/ccu_interface.h` 改为 `plat_comm/impl/bs_local_data.h`
4. 设置 `BS_GWSDK_EN=1`,并与 `BS_IES_EN` 互斥或按产品配置二选一
File diff suppressed because it is too large Load Diff
+89
View File
@@ -0,0 +1,89 @@
#ifndef BS_GWSDK_CTRL_H
#define BS_GWSDK_CTRL_H
#ifdef __cplusplus /*C++编译环境下兼容C语言*/
extern "C" {
#endif
/*------ Exported includes(头文件) ----------------------*/
#include "main.h"
#include "publicdata/type.h"
#if (BS_GWSDK_EN)
/*------ Exported macro(宏定义) -------------------------*/
#define GWSDK_TIMERCNT_NUM (3 + 5*GUN_MAX_CNT) //计时计数 -每一个需主动上送的报文总数
/*------ Exported struct(结构体定义) --------------------*/
typedef enum{
SDK_TIMER_REQUSET = 0, //校时
SDK_TIMER_FEE_REQ, //费率请求
SDK_TIMER_DC_DEV_INFO, //直流设备属性上报
SDK_TIMER_REAL_WORK_GUN, //工作实时状态 数量跟随枪数量 - 包含工作状态和空闲状态两种
SDK_TIMER_TRADE_INFO = SDK_TIMER_REAL_WORK_GUN + GUN_MAX_CNT, //订单信息上送 数量跟随枪数量
SDK_TIMER_PROPERTY_BMS = SDK_TIMER_TRADE_INFO + GUN_MAX_CNT, //BMS 属性周期上送
SDK_TIMER_METER_INFO = SDK_TIMER_PROPERTY_BMS + GUN_MAX_CNT, //电表低值上送
SDK_TIMER_FAULT_INFO = SDK_TIMER_METER_INFO + GUN_MAX_CNT, //故障信息上报
}SDK_SEND_TIMER;
typedef struct
{
U8_T u8_bs_flag; //处于双平台架构中的哪个 用于映射控制结构体的地址
S8_T gw_connet_flag; //联网标识
U8_T u8_bs_state_type; //维护状态
U8_T u8_bs_reboot_flag; //平台重启标志 - 要求收到重启命令时,需回复后再重启
U8_T u8_bs_gun2_notup_cnt; //2枪订单未上传计时
U8_T txFlag_synTime; //是否已校时标识 0否 1是
U8_T txFlag_askFeeMode; //请求费率
U8_T txFlag_firwareInfo; //固件信息上送标志
U8_T txFlag_versInfo; //版本信息上送标志
U8_T txFlag_cfgInfoUpdate; //配置信息更新请求
U8_T txFlag_devMduInfoEvt; //设备组件信息上报
U8_T u8_Meter_ack[2]; //电表召测标志
U8_T u8_sim_id[20]; //sim卡号
U16_T u16_work_info_period; //工作实时状态 上送周期
U16_T u16_free_info_period; //空闲实时状态 上送周期
U16_T ChargeCnt; //充电序号计次
U16_T OperateCnt; //操作序号计次 生成订单流水号时使用
struct
{
U8_T u8_real_state_cnt; //充电实时状态 上送计数
U16_T u16_charge_cnt; //充电次数
U32_T u32_charge_time; //充电时间
}s_gwsdk_gun[GUN_MAX_CNT];
struct
{
U16_T u16_timerCnt; //周期发送计数
U16_T u16_timeNUM ; //计数周期值 单位秒
}s_timerCnt[GWSDK_TIMERCNT_NUM];
}S_GWSDK_CTRL_DATA;
/*------ Exported variables(变量定义) -------------------*/
/*------ Exported function prototypes (函数声明) -------*/
void v_sdk_init_data(U8_T bs_flag);
U8_T v_sdk_tcp_connect(void);
U8_T v_sdk_logo_on(void);
void v_sdk_recv_data(void);
void v_sdk_send_ctrl(void);
void v_sdk_private_crel(U8_T u8_flag);
#endif
#ifdef __cplusplus
}
#endif
#endif /* BS_GWSDK_CTRL_H */
File diff suppressed because it is too large Load Diff
+51
View File
@@ -0,0 +1,51 @@
#ifndef BS_GWSDK_INTERFACE_H
#define BS_GWSDK_INTERFACE_H
#ifdef __cplusplus /*C++编译环境下兼容C语言*/
extern "C" {
#endif
/*------ Exported includes(头文件) ----------------------*/
#include "main.h"
#if (BS_GWSDK_EN)
#include "infra_defs.h"
#include "protocol_data_def.h"
#include "interface.h"
#include "protocol.h"
/*------ Exported macro(宏定义) -------------------------*/
/*------ Exported struct(结构体定义) --------------------*/
/*------ Exported variables(变量定义) -------------------*/
/*------ Exported function prototypes (函数声明) -------*/
void gw_get_firmware_data(evs_event_firmware_info *fireware_info ); //获取固件信息
void gw_get_ver_data(evs_event_ver_info *ver_info); //获取版本信息
void gw_get_devInfo_data(evs_event_devmdu_info* devInfo_data); //获取设备组件信息
void gw_get_alarm_data(evs_event_alarm *event_alarm ,U8_T u8_gunNo); //获取故障告警信息
void gw_getPilePropertyData(evs_property_dcPile* dcProperty); //获取直流桩设备属性
void gw_get_gunlink_data(evs_event_pile_stutus_change *gunlink_state,U8_T u8_gunNo); //获取枪连接状态
void gw_get_stopResult_info(U8_T gunNo,evs_event_stopCharge* event_stopResult); //枪停止结果上送
void gw_get_startResult_info(U8_T gunNo,evs_event_startResult* event_startResult) ;//枪启动结果上送
void gw_get_DC_meter_data(evs_property_meter* meterData,U8_T u8_gunNo); //获取直流电表底值数据
void gw_get_dc_BMS_Data(evs_property_BMS* BMSData ,U8_T u8_gunNo); //获取直流桩BMS属性;
void gw_get_log_info(U8_T flag ,U8_T gunNo,evs_event_tradeInfo* tradeInfo_data);
void gw_get_Auth_Data(evs_event_startCharge* AuthData ,U8_T u8_gunNo); //获取即插即充所需数据
void gw_get_dc_nonWork(evs_property_dc_nonWork* gunData,U8_T u8_gunNo); //获取直流非充电中状态数据
void gw_get_dc_work(evs_property_dc_work* gunData,U8_T u8_gunNo); //获取直流充电中状态数据
U8_T u8_feeModle_save(evs_service_issue_feeModel *param);
U8_T u8_gwsdk_start_charge_ctrl(evs_service_startCharge *param);
U8_T u8_gwsdk_stop_chaege_ctrl(evs_service_stopCharge *param);
#endif
#ifdef __cplusplus
}
#endif
#endif /* BS_GWSDK_INTERFACE_H */