mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #2052 from Orum/dev
Add MCU temperature to telemetry responses from room servers.
This commit is contained in:
commit
a22c4b6270
1 changed files with 6 additions and 0 deletions
|
|
@ -172,6 +172,12 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
|
||||||
}
|
}
|
||||||
sensors.querySensors(perm_mask, telemetry);
|
sensors.querySensors(perm_mask, telemetry);
|
||||||
|
|
||||||
|
// This default temperature will be overridden by external sensors (if any)
|
||||||
|
float temperature = board.getMCUTemperature();
|
||||||
|
if(!isnan(temperature)) { // Supported boards with built-in temperature sensor. ESP32-C3 may return NAN
|
||||||
|
telemetry.addTemperature(TELEM_CHANNEL_SELF, temperature); // Built-in MCU Temperature
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t tlen = telemetry.getSize();
|
uint8_t tlen = telemetry.getSize();
|
||||||
memcpy(&reply_data[4], telemetry.getBuffer(), tlen);
|
memcpy(&reply_data[4], telemetry.getBuffer(), tlen);
|
||||||
return 4 + tlen; // reply_len
|
return 4 + tlen; // reply_len
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue