Browse Source
Merge pull request #2052 from Orum/dev
Add MCU temperature to telemetry responses from room servers.
pull/2056/head
Liam Cottle
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
0 deletions
-
examples/simple_room_server/MyMesh.cpp
|
|
|
@ -172,6 +172,12 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t |
|
|
|
} |
|
|
|
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(); |
|
|
|
memcpy(&reply_data[4], telemetry.getBuffer(), tlen); |
|
|
|
return 4 + tlen; // reply_len
|
|
|
|
|