fix:更新注释等

This commit is contained in:
2026-05-21 12:19:01 +08:00
parent fd65e9c6a2
commit 8ee0849831
54 changed files with 1145 additions and 683 deletions

View File

@@ -1,16 +1,22 @@
/**
* @file host_computer_protocol.c
* @brief 上位机通信协议处理模块
* @details 处理上位机与充电桩之间的通信协议,包括登录验证、状态查询、
* 数据上报等功能。支持JSON格式的数据交互通过UDP协议与服务器通信。
* @date 2025-01-09 14:32:15
* @version 1.0.0
* @copyright Copyright (c) 2026
******************************************************************************
* @file User\Protocol\Host Computer\host_computer_protocol.c
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief 上位机通信协议处理
******************************************************************************
*/
#include "host_computer_protocol.h"
#include "point_protocol.h"
/**
* @brief host_computer_on_login登录指令处理
* @note 处理登录指令,验证用户名和密码
* @param id任务ID
* @param json_packJSON指令指针
*/
void host_computer_on_login(uint8_t id, cJSON *json_pack)
{
(void) id;
@@ -48,7 +54,12 @@ void host_computer_on_login(uint8_t id, cJSON *json_pack)
cJSON_Delete(root);
}
// 处理获取状态查询指令
/**
* @brief host_computer_on_get_status获取状态查询指令处理
* @note 处理获取状态查询指令,返回所有桩的状态
* @param id任务ID
* @param json_packJSON指令指针
*/
void host_computer_on_get_status(uint8_t id, cJSON *json_pack)
{
(void) id;
@@ -125,6 +136,13 @@ void host_computer_on_get_status(uint8_t id, cJSON *json_pack)
cJSON_Delete(root);
printf("get_status 回复已发送 \r\n");
}
/**
* @brief host_computer_on_reboot重启指令处理
* @note 处理重启指令,重启系统
* @param id任务ID
* @param json_packJSON指令指针
*/
void host_computer_on_reboot(uint8_t id, cJSON *json)
{
(void) id;
@@ -135,8 +153,8 @@ void host_computer_on_reboot(uint8_t id, cJSON *json)
/**
* @brief 主动上报充电桩数据
* @note 模拟并上报充电桩实时数据,符合协议格式要求
* @brief host_computer_report_data上报充电桩数据指令处理
* @note 上报充电桩实时数据,符合协议格式要求
* @param stake_index 桩索引 (1~6)
* @param gun_id 枪编码 (1~N)
*/

View File

@@ -1,3 +1,13 @@
/**
******************************************************************************
* @file User\Protocol\Host Computer\host_computer_protocol.h
* @author 路淮
* @version v0.1
* @date 2026-05-21
* @brief 上位机通信协议头文件
******************************************************************************
*/
#ifndef HOST_COMPUTER_HANDLER_H
#define HOST_COMPUTER_HANDLER_H
#include "global.h"