Skip to content

Commit

Permalink
Add device info info page (#2789)
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Grabmeier <[email protected]>
  • Loading branch information
flooxo authored Jan 8, 2024
1 parent eb7f2b3 commit 252c399
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
15 changes: 15 additions & 0 deletions code/main/server_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ esp_err_t info_get_handler(httpd_req_t *req)
httpd_resp_sendstr(req, zw.c_str());
return ESP_OK;
}
else if (_task.compare("ChipCores") == 0)
{
httpd_resp_sendstr(req, GetChipCoreCount().c_str());
return ESP_OK;
}
else if (_task.compare("ChipRevision") == 0)
{
httpd_resp_sendstr(req, GetChipRevision().c_str());
return ESP_OK;
}
else if (_task.compare("ChipFeatures") == 0)
{
httpd_resp_sendstr(req, GetChipfeatures().c_str());
return ESP_OK;
}
else
{
char formatted[256];
Expand Down
70 changes: 70 additions & 0 deletions sd-card/html/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,34 @@ <h3>Build Info</h3>
</tr>
</table>

<table>
<colgroup>
<col span="1" style="width: 35%;">
<col span="1" style="width: 65%;">
</colgroup>
<tr>
<h3>Device Info</h3>
</tr>
<tr>
<td>Chip Cores:</td>
<td>
<output id="chip-cores"></output>
</td>
</tr>
<tr>
<td>Chip Revision:</td>
<td>
<output id="chip-revision"></output>
</td>
</tr>
<tr>
<td>Chip Features:</td>
<td>
<output id="chip-features"></output>
</td>
</tr>
</table>


<table>
<colgroup>
Expand Down Expand Up @@ -475,6 +503,45 @@ <h3>Copyright</h3>
xhttp.send();
}

function loadChipCores()
{
url = getDomainname() + '/info?type=ChipCores';
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("chip-cores").value = xhttp.response;
}
}
xhttp.open("GET", url, true);
xhttp.send();
}

function loadChipRevision()
{
url = getDomainname() + '/info?type=ChipRevision';
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("chip-revision").value = xhttp.response;
}
}
xhttp.open("GET", url, true);
xhttp.send();
}

function loadChipFeatures()
{
url = getDomainname() + '/info?type=ChipFeatures';
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("chip-features").value = xhttp.response;
}
}
xhttp.open("GET", url, true);
xhttp.send();
}

function init()
{
loadMemoryInfo();
Expand All @@ -493,6 +560,9 @@ <h3>Copyright</h3>
loadSDCardPartitionSize();
loadSDCardFreePartitionSpace();
loadSDCardPartitionAllocationSize();
loadChipCores();
loadChipRevision();
loadChipFeatures();
}

init();
Expand Down

0 comments on commit 252c399

Please sign in to comment.