使用原始字符串字面量代替转义,提高可读性 (#861)

* 使用原始字符串字面量代替转义,提高可读性

* 使用原始字符串字面量代替转义,提高可读性

* 增加一个使用ESP-IDF Monitor作为输出显示内容的类

* 修改代码风格
This commit is contained in:
小林同志
2025-07-05 15:11:02 +08:00
committed by GitHub
parent b7c1989a34
commit 1314ccfc0f
4 changed files with 112 additions and 43 deletions

View File

@@ -0,0 +1,44 @@
#include "esplog_display.h"
#include "esp_log.h"
#define TAG "EspLogDisplay"
EspLogDisplay::EspLogDisplay()
{}
EspLogDisplay::~EspLogDisplay()
{}
void EspLogDisplay::SetStatus(const char* status)
{
ESP_LOGW(TAG, "SetStatus: %s", status);
}
void EspLogDisplay::ShowNotification(const char* notification, int duration_ms)
{
ESP_LOGW(TAG, "ShowNotification: %s", notification);
}
void EspLogDisplay::ShowNotification(const std::string &notification, int duration_ms)
{
ShowNotification(notification.c_str(), duration_ms);
}
void EspLogDisplay::SetEmotion(const char* emotion)
{
ESP_LOGW(TAG, "SetEmotion: %s", emotion);
}
void EspLogDisplay::SetIcon(const char* icon)
{
ESP_LOGW(TAG, "SetIcon: %s", icon);
}
void EspLogDisplay::SetChatMessage(const char* role, const char* content)
{
ESP_LOGW(TAG, "Role:%s", role);
ESP_LOGW(TAG, " %s", content);
}