T1000e full sensors

This commit is contained in:
liquidraver committed 2026-08-21 20:28:03 +02:00
1 parent 1b12354b85
commit cb4863e4bd
10 files changed
+599 -12

No files matched your search

+14 -4
View File
@@ -1223,7 +1223,7 @@ bool CompanionMesh::vcontactHandleFrame(const uint8_t *data, size_t len)
if (tag == 0) tag = 1;
sendPacketSent(MSG_SEND_SENT_DIRECT, tag, 3000);
uint8_t rsp[8 + 4 + 11 + 11 + (12 * POWER_MAX_CHANNELS) + 8];
uint8_t rsp[8 + 4 + 11 + 15 + (12 * POWER_MAX_CHANNELS) + 8];
int i = 0;
rsp[i++] = PUSH_CODE_TELEMETRY_RESPONSE;
rsp[i++] = 0; /* reserved */
@@ -1565,6 +1565,16 @@ int CompanionMesh::appendSelfTelemetry(uint8_t *reply, uint8_t permissions)
reply[i++] = (press >> 8) & 0xFF;
reply[i++] = press & 0xFF;
}
if (env.has_luminosity) {
reply[i++] = CH_SELF;
reply[i++] = LPP_LUMINOSITY;
float lum = env.luminosity;
if (lum < 0.0f) lum = 0.0f;
if (lum > 65535.0f) lum = 65535.0f;
uint16_t lux = (uint16_t)lum;
reply[i++] = (lux >> 8) & 0xFF;
reply[i++] = lux & 0xFF;
}
}
// Power monitor telemetry (INA219/INA3221/ina2xx)
@@ -3152,9 +3162,9 @@ bool CompanionMesh::handleProtocolFrame(const uint8_t *data, size_t len)
// Response: [PUSH_CODE_TELEMETRY_RESPONSE][reserved][6-byte pubkey][telemetry_data]
// Worst-case size tracks POWER_MAX_CHANNELS so a future bump can't
// silently overflow this stack buffer. With current value 4:
// header(8) + batt(4) + gps(11) + env(temp4+hum3+press4=11)
// + power(POWER_MAX_CHANNELS * 12 = 48) + 8 byte safety pad = 90.
uint8_t rsp[8 + 4 + 11 + 11 + (12 * POWER_MAX_CHANNELS) + 8];
// header(8) + batt(4) + gps(11) + env(temp4+hum3+press4+lum4=15)
// + power(POWER_MAX_CHANNELS * 12 = 48) + 8 byte safety pad = 94.
uint8_t rsp[8 + 4 + 11 + 15 + (12 * POWER_MAX_CHANNELS) + 8];
int i = 0;
rsp[i++] = PUSH_CODE_TELEMETRY_RESPONSE;
rsp[i++] = 0; // reserved