Update aa.ino
This commit is contained in:
25
aa.ino
25
aa.ino
@@ -40,10 +40,6 @@
|
|||||||
#define FILE_BUFFER_SIZE 131072 // 128KB (PSRAM)
|
#define FILE_BUFFER_SIZE 131072 // 128KB (PSRAM)
|
||||||
#define SERIAL_CSV_BUFFER_SIZE 65536 // 64KB (PSRAM)
|
#define SERIAL_CSV_BUFFER_SIZE 65536 // 64KB (PSRAM)
|
||||||
|
|
||||||
// webUpdateTask에서 전송
|
|
||||||
doc["psramFree"] = ESP.getFreePsram(); // ← 추가
|
|
||||||
doc["serialQueueUsed"] = uxQueueMessagesWaiting(serialQueue); // ← 추가
|
|
||||||
doc["serialQueueSize"] = SERIAL_QUEUE_SIZE; // ← 추가
|
|
||||||
|
|
||||||
// 기타 상수
|
// 기타 상수
|
||||||
#define MAX_FILENAME_LEN 64
|
#define MAX_FILENAME_LEN 64
|
||||||
@@ -1572,6 +1568,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, size_t length)
|
|||||||
void webUpdateTask(void *parameter) {
|
void webUpdateTask(void *parameter) {
|
||||||
const TickType_t xDelay = pdMS_TO_TICKS(100);
|
const TickType_t xDelay = pdMS_TO_TICKS(100);
|
||||||
|
|
||||||
|
|
||||||
Serial.println("✓ Web Update Task 시작 (Priority 8)");
|
Serial.println("✓ Web Update Task 시작 (Priority 8)");
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -1598,7 +1595,27 @@ void webUpdateTask(void *parameter) {
|
|||||||
doc["rtcAvail"] = timeSyncStatus.rtcAvailable;
|
doc["rtcAvail"] = timeSyncStatus.rtcAvailable;
|
||||||
doc["voltage"] = powerStatus.voltage;
|
doc["voltage"] = powerStatus.voltage;
|
||||||
doc["mcpMode"] = (int)currentMcpMode;
|
doc["mcpMode"] = (int)currentMcpMode;
|
||||||
|
// webUpdateTask에서 전송
|
||||||
|
doc["psramFree"] = ESP.getFreePsram(); // ← 추가
|
||||||
|
doc["serialQueueUsed"] = uxQueueMessagesWaiting(serialQueue); // ← 추가
|
||||||
|
doc["serialQueueSize"] = SERIAL_QUEUE_SIZE; // ← 추가
|
||||||
|
// webUpdateTask에서 전송
|
||||||
|
doc["type"] = "update";
|
||||||
|
JsonArray messages = doc.createNestedArray("messages");
|
||||||
|
|
||||||
|
for (int i = 0; i < RECENT_MSG_COUNT; i++) {
|
||||||
|
if (recentData[i].count > 0) {
|
||||||
|
JsonObject msgObj = messages.createNestedObject();
|
||||||
|
msgObj["id"] = recentData[i].msg.id; // ← 숫자
|
||||||
|
msgObj["dlc"] = recentData[i].msg.dlc;
|
||||||
|
msgObj["count"] = recentData[i].count; // ← 필수!
|
||||||
|
|
||||||
|
JsonArray dataArray = msgObj.createNestedArray("data");
|
||||||
|
for (int j = 0; j < recentData[i].msg.dlc; j++) {
|
||||||
|
dataArray.add(recentData[i].msg.data[j]); // ← 배열
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (loggingEnabled && currentFilename[0] != '\0') {
|
if (loggingEnabled && currentFilename[0] != '\0') {
|
||||||
doc["currentFile"] = String(currentFilename);
|
doc["currentFile"] = String(currentFilename);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user