Skip to content

Commit

Permalink
Changed sendTableRow parameter value to string
Browse files Browse the repository at this point in the history
  • Loading branch information
wib100 committed Jan 2, 2023
1 parent 40c7070 commit d2e4a7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion include/pages.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
void sendResponseHeader(AsyncResponseStream *response, const char *title);
void sendResponseTrailer(AsyncResponseStream *response);
void sendButton(AsyncResponseStream *response, const char *title, const char *action, const char *css = "");
void sendTableRow(AsyncResponseStream *response, const char *name, uint32_t value);
void sendTableRow(AsyncResponseStream *response, const char *name, String value);
void sendDebugForm(AsyncResponseStream *response, String slaveId, String reg, String function, String count);
const String ErrorName(Modbus::Error code);
#endif /* PAGES_H */
18 changes: 9 additions & 9 deletions src/pages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ void setupPages(AsyncWebServer *server, ModbusClientRTU *rtu, ModbusBridgeWiFi *
auto *response = request->beginResponseStream("text/html");
sendResponseHeader(response, "Status");
response->print("<table>");
sendTableRow(response, "RTU Messages", rtu->getMessageCount());
sendTableRow(response, "RTU Pending Messages", rtu->pendingRequests());
sendTableRow(response, "RTU Errors", rtu->getErrorCount());
sendTableRow(response, "Bridge Message", bridge->getMessageCount());
sendTableRow(response, "Bridge Clients", bridge->activeClients());
sendTableRow(response, "Bridge Errors", bridge->getErrorCount());
sendTableRow(response, "RTU Messages", String(rtu->getMessageCount()));
sendTableRow(response, "RTU Pending Messages", String(rtu->pendingRequests()));
sendTableRow(response, "RTU Errors", String(rtu->getErrorCount()));
sendTableRow(response, "Bridge Message", String(bridge->getMessageCount()));
sendTableRow(response, "Bridge Clients", String(bridge->activeClients()));
sendTableRow(response, "Bridge Errors", String(bridge->getErrorCount()));
response->print("</table><p></p>");
sendButton(response, "Back", "/");
sendResponseTrailer(response);
Expand Down Expand Up @@ -469,12 +469,12 @@ void sendButton(AsyncResponseStream *response, const char *title, const char *ac
"<p></p>", action, css, title);
}

void sendTableRow(AsyncResponseStream *response, const char *name, uint32_t value){
void sendTableRow(AsyncResponseStream *response, const char *name, String value){
response->printf(
"<tr>"
"<td>%s:</td>"
"<td>%d</td>"
"</tr>", name, value);
"<td>%s</td>"
"</tr>", name, value.c_str());
}

void sendDebugForm(AsyncResponseStream *response, String slaveId, String reg, String function, String count){
Expand Down

0 comments on commit d2e4a7d

Please sign in to comment.