Make new protobuf value consistent

This commit is contained in:
Jonathan Bennett
2026-04-14 18:47:53 -05:00
parent 87d0850f95
commit dc3947117e
2 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -52,7 +52,7 @@ ProcessMessage DMShellModule::handleReceived(const meshtastic_MeshPacket &mp)
if (frame.op == meshtastic_RemoteShell_OpCode_ACK) {
if (session.active && frame.session_id == session.sessionId && getFrom(&mp) == session.peer && frame.last_rx_seq > 0) {
resendFramesFrom(frame.last_rx_seq);
resendFramesFrom(frame.last_rx_seq + 1);
}
return ProcessMessage::CONTINUE;
}
@@ -77,6 +77,13 @@ ProcessMessage DMShellModule::handleReceived(const meshtastic_MeshPacket &mp)
}
if (!session.active || frame.session_id != session.sessionId || getFrom(&mp) != session.peer) {
if (!session.active) {
LOG_WARN("DMShell: no active session, rejecting op %d from 0x%x", frame.op, mp.from);
} else {
LOG_WARN("DMShell: session ID mismatch (got 0x%x expected 0x%x) or peer mismatch (got 0x%x expected 0x%x), rejecting "
"op %d",
frame.session_id, session.sessionId, mp.from, session.peer, frame.op);
}
sendError("invalid_session", getFrom(&mp));
return ProcessMessage::STOP;
}
@@ -501,7 +508,7 @@ void DMShellModule::sendAck(uint32_t replayFromSeq)
.cols = 0,
.rows = 0,
.flags = 0,
.last_rx_seq = replayFromSeq,
.last_rx_seq = replayFromSeq - 1,
};
frame.payload.size = 0;
sendFrameToPeer(session.peer, frame, false);