mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-06 18:32:49 +08:00
修复自定义名称过长可能导致系统崩溃的问题
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
static bool is_http_init;
|
||||
static bool is_handlers_registered;
|
||||
const struct httpd_wsgi_call g_app_handlers[];
|
||||
char power_info_json[1952] = {0};
|
||||
char power_info_json[2560] = {0};
|
||||
char up_time[16] = "00:00:00";
|
||||
|
||||
/*
|
||||
|
||||
@@ -530,7 +530,7 @@ void UserMqttHassAuto(char socket_id) {
|
||||
socket_id--;
|
||||
char *send_buf = NULL;
|
||||
char *topic_buf = NULL;
|
||||
send_buf = (char *) malloc(600);
|
||||
send_buf = (char *) malloc(800);
|
||||
topic_buf = (char *) malloc(64);
|
||||
if (send_buf != NULL && topic_buf != NULL) {
|
||||
sprintf(topic_buf, "homeassistant/switch/%s/socket_%d/config", str_mac, socket_id);
|
||||
@@ -691,6 +691,7 @@ void UserMqttHassAutoPower(void) {
|
||||
"\"object_id\":\"tc1_%s_sut\","
|
||||
"\"state_topic\":\"homeassistant/sensor/%s/startupTime/state\","
|
||||
"\"icon\":\"mdi:clock-time-three-outline\","
|
||||
"\"entity_category\":\"diagnostic\","
|
||||
"\"value_template\":\"{{ value_json.startupTime }}\",""\"device\":{"
|
||||
"\"identifiers\":[\"tc1_%s\"],"
|
||||
"\"name\":\"%s\","
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#define MQTT_CMD_TIMEOUT 5000 // 5s
|
||||
#define MQTT_YIELD_TMIE 5000 // 5s
|
||||
|
||||
#define MAX_MQTT_TOPIC_SIZE (256)
|
||||
#define MAX_MQTT_DATA_SIZE (1024)
|
||||
#define MAX_MQTT_TOPIC_SIZE (512)
|
||||
#define MAX_MQTT_DATA_SIZE (2048)
|
||||
#define MAX_MQTT_SEND_QUEUE_SIZE (10)
|
||||
|
||||
#define MQTT_SERVER user_config->mqtt_ip
|
||||
|
||||
Reference in New Issue
Block a user