Files
ETH_TCP_Demo/app/error_handler.h
2026-03-04 08:50:04 +08:00

50 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* error_handler.h
*
* Created on: 2026-03-04
* Author: RT-Thread
*
* 功能: 错误处理与恢复模块头文件
* 依赖: RT-Thread Nano, osal, transaction, state_manager
* 跨平台适配: 基于RT-Thread Nano使用标准API
*/
#ifndef ERROR_HANDLER_H
#define ERROR_HANDLER_H
#include <rtthread.h>
#include "osal.h"
#include "state_manager.h"
/**
* @brief 初始化错误处理器
* @return 0 成功非0 失败
*/
int error_handler_init(void);
/**
* @brief 处理错误
* @param error 错误代码
* @param user_data 用户数据
* @return 0 成功非0 失败
*/
int error_handler_process(error_code_t error, void *user_data);
/**
* @brief 记录错误日志
* @param error 错误代码
* @param message 错误信息
* @return 0 成功非0 失败
*/
int error_handler_log(error_code_t error, const char *message);
/**
* @brief 触发错误报警
* @param error 错误代码
* @param message 错误信息
* @return 0 成功非0 失败
*/
int error_handler_alert(error_code_t error, const char *message);
#endif /* ERROR_HANDLER_H */