Re-enable wantresponse and other fields in simradio when on the decoded path (#10934)

* Re-enable wantresponse and other fields in simradio when on the decoded path

* Make the comments less verbose
This commit is contained in:
Ian McEwen
2026-07-08 08:59:07 -05:00
committed by GitHub
co-authored by GitHub
parent b97adf5547
commit ade42830e0
+8 -1
View File
@@ -252,7 +252,14 @@ void SimRadio::startSend(meshtastic_MeshPacket *txp)
// pb_encode_to_bytes writes into decoded.payload, which aliases `encrypted` in the union, so all
// reads of p->encrypted above must be complete before this point.
p->decoded = meshtastic_Data_init_zero;
if (carryEncrypted) {
// On the encrypted path, `decoded` aliases the ciphertext we just copied into c.data;
// the remaining `Data` fields hold ciphertext bytes that would serialize as spurious
// wire fields, so clear the struct.
p->decoded = meshtastic_Data_init_zero;
}
// On the decoded path, `p->decoded` is already a valid Data from perhapsDecode(),
// so retain the existing fields (want_response, request_id, bitfield, etc.)
p->which_payload_variant = meshtastic_MeshPacket_decoded_tag;
p->decoded.payload.size =
pb_encode_to_bytes(p->decoded.payload.bytes, sizeof(p->decoded.payload.bytes), &meshtastic_Compressed_msg, &c);