Resolved issue in CRC-CCITT correction method. Added CRC error detection to PDU header block in the message framer, so that we're sure that the number of follow blocks is correct while we're capturing symbols/bits. Set the TDU message error correction to Pass since the CRC is calculated within the message framer and no errant NIDs (TDU) are passed.

This commit is contained in:
dennis.sheirer
2014-12-15 02:01:15 +00:00
parent 9542a74968
commit 2635b58dfc
6 changed files with 30 additions and 15 deletions

View File

@@ -37,6 +37,7 @@ public class P25MessageFramer implements Listener<Dibit>
public static final int TSBK_DECODED_END = 160;
public static final int PDU0_BEGIN = 64;
public static final int PDU0_CRC_BEGIN = 144;
public static final int PDU0_END = 260;
public static final int PDU1_BEGIN = 160;
public static final int PDU1_END = 356;
@@ -262,9 +263,19 @@ public class P25MessageFramer implements Listener<Dibit>
* unsuccessful decode due to excessive errors */
if( mHalfRate.decode( mMessage, PDU0_BEGIN, PDU0_END ) )
{
setDUID( DataUnitID.PDU1 );
CRC pduCRC = CRCP25.correctCCITT80( mMessage,
PDU0_BEGIN, PDU0_CRC_BEGIN );
mMessage.setPointer( PDU1_BEGIN );
if( pduCRC != CRC.FAILED_CRC )
{
setDUID( DataUnitID.PDU1 );
mMessage.setPointer( PDU1_BEGIN );
}
else
{
mComplete = true;
}
}
else
{