ggwave : update tests

This commit is contained in:
Georgi Gerganov
2022-07-12 23:52:33 +03:00
parent 324b012949
commit a29fb485e1
4 changed files with 11 additions and 4 deletions

View File

@@ -1672,11 +1672,13 @@ void GGWave::decode_variable() {
if ((rsLength.Decode(m_dataEncoded.data(), m_rx.data.data()) == 0) && (m_rx.data[0] > 0 && m_rx.data[0] <= 140)) {
knownLength = true;
decodedLength = m_rx.data[0];
//printf("decoded length = %d, recvDuration_frames = %d\n", decodedLength, m_rx.recvDuration_frames);
const int nTotalBytesExpected = m_encodedDataOffset + decodedLength + ::getECCBytesForLength(decodedLength);
const int nTotalFramesExpected = 2*m_nMarkerFrames + ((nTotalBytesExpected + protocol.bytesPerTx - 1)/protocol.bytesPerTx)*protocol.framesPerTx;
if (m_rx.recvDuration_frames > nTotalFramesExpected ||
m_rx.recvDuration_frames < nTotalFramesExpected - 2*m_nMarkerFrames) {
//printf(" - invalid number of frames: %d (expected %d)\n", m_rx.recvDuration_frames, nTotalFramesExpected);
knownLength = false;
break;
}