fix: reset_reason aus system/info entfernen
Das Feld lieferte ohnehin nur den festen String "unknown" - kein SDK-Aufruf lieferte je einen echten Reset-Grund. README/hardware-checklist erwähnten es nicht.
This commit is contained in:
@@ -245,7 +245,6 @@ static void handle_info(const nl_api_ctx_t *ctx, nl_api_response_t *resp)
|
|||||||
cJSON_AddNullToObject(w, "error");
|
cJSON_AddNullToObject(w, "error");
|
||||||
cJSON_AddNumberToObject(o, "uptime", in.uptime_s);
|
cJSON_AddNumberToObject(o, "uptime", in.uptime_s);
|
||||||
cJSON_AddNumberToObject(o, "free_heap", in.free_heap);
|
cJSON_AddNumberToObject(o, "free_heap", in.free_heap);
|
||||||
cJSON_AddStringToObject(o, "reset_reason", "unknown");
|
|
||||||
if (in.last_ota_error)
|
if (in.last_ota_error)
|
||||||
cJSON_AddStringToObject(o, "last_ota_error", in.last_ota_error);
|
cJSON_AddStringToObject(o, "last_ota_error", in.last_ota_error);
|
||||||
else
|
else
|
||||||
|
|||||||
+1
-1
@@ -207,7 +207,7 @@ static void test_info_is_open(void)
|
|||||||
TEST_ASSERT_TRUE(cJSON_IsNull(cJSON_GetObjectItem(w, "error")));
|
TEST_ASSERT_TRUE(cJSON_IsNull(cJSON_GetObjectItem(w, "error")));
|
||||||
TEST_ASSERT_EQUAL_INT(123, field("uptime")->valueint);
|
TEST_ASSERT_EQUAL_INT(123, field("uptime")->valueint);
|
||||||
TEST_ASSERT_EQUAL_INT(40000, field("free_heap")->valueint);
|
TEST_ASSERT_EQUAL_INT(40000, field("free_heap")->valueint);
|
||||||
TEST_ASSERT_EQUAL_STRING("unknown", cJSON_GetStringValue(field("reset_reason")));
|
TEST_ASSERT_NULL(cJSON_GetObjectItem(doc, "reset_reason"));
|
||||||
TEST_ASSERT_TRUE(cJSON_IsNull(field("last_ota_error")));
|
TEST_ASSERT_TRUE(cJSON_IsNull(field("last_ota_error")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user