fix:更新注释等
This commit is contained in:
@@ -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_pack:JSON指令指针
|
||||
*/
|
||||
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_pack:JSON指令指针
|
||||
*/
|
||||
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_pack:JSON指令指针
|
||||
*/
|
||||
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)
|
||||
*/
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user