|
|
|
@ -657,6 +657,11 @@ uint8_t MyMesh::onContactRequest(const ContactInfo &contact, uint32_t sender_tim |
|
|
|
// query other sensors -- target specific
|
|
|
|
sensors.querySensors(permissions, telemetry); |
|
|
|
|
|
|
|
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
|
|
|
|
} |
|
|
|
|
|
|
|
memcpy(reply, &sender_timestamp, |
|
|
|
4); // reflect sender_timestamp back in response packet (kind of like a 'tag')
|
|
|
|
|
|
|
|
@ -1640,6 +1645,11 @@ void MyMesh::handleCmdFrame(size_t len) { |
|
|
|
} else if (cmd_frame[0] == CMD_SEND_TELEMETRY_REQ && len == 4) { // 'self' telemetry request
|
|
|
|
telemetry.reset(); |
|
|
|
telemetry.addVoltage(TELEM_CHANNEL_SELF, (float)board.getBattMilliVolts() / 1000.0f); |
|
|
|
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
|
|
|
|
} |
|
|
|
|
|
|
|
// query other sensors -- target specific
|
|
|
|
sensors.querySensors(0xFF, telemetry); |
|
|
|
|
|
|
|
|