Repeater: the stats request also carries the node's sensors (humidity, pressure, external temperature, ...)

Changelog-cs: Repeater: požadavek na statistiky teď vrací i senzory uzlu (vlhkost, tlak, externí teplotu, ...)
Changelog-topic: stats-bundle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-12-04 03:52:50 +01:00
1 parent 97f52e71b8
commit 2a5c596250
7 files changed
+997 -16

No files matched your search

+13
View File
@@ -608,6 +608,19 @@ int MyMesh::handleRequest(ClientInfo *sender, uint32_t sender_timestamp, uint8_t
in.v[SB_RECV_ERRORS] = radio_driver.getPacketsRecvErrors();
in.v[SB_TX_START_FAIL] = getNumTxStartFail();
in.v[SB_TX_TIMEOUT] = getNumTxTimeout();
// The node's sensors as a telemetry request would add them, without channel 1
// (battery and MCU temperature are scalars above). Same permissions as
// REQ_TYPE_GET_TELEMETRY_DATA: a guest gets the base set (no sensors), anyone
// else everything, as with the default (all-permissions) request.
uint8_t env_buf[SB_ENV_MAX];
{
uint8_t perm_mask = ((sender->permissions & PERM_ACL_ROLE_MASK) == PERM_ACL_GUEST) ? 0x00 : 0xFF;
telemetry.reset();
sensors.querySensors(perm_mask, telemetry);
in.env_len = (uint8_t)sbLppExclude(telemetry.getBuffer(), telemetry.getSize(), TELEM_CHANNEL_SELF,
env_buf, sizeof(env_buf));
in.env = in.env_len ? env_buf : NULL;
}
if (in.admin) {
in.fair[0] = fairness_limiter.deniedGroup();
in.fair[1] = fairness_limiter.deniedSenderNormal();