mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
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:
@@ -2,6 +2,7 @@ package decode.p25.message.pdu;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BitSetBuffer;
|
||||
import crc.CRC;
|
||||
import decode.p25.message.P25Message;
|
||||
import decode.p25.reference.DataUnitID;
|
||||
import decode.p25.reference.Opcode;
|
||||
@@ -28,6 +29,10 @@ public class PDUMessage extends P25Message
|
||||
public PDUMessage( BitSetBuffer message, DataUnitID duid, AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
/* Setup a CRC array to hold the header CRC and the multi-block CRC */
|
||||
mCRC = new CRC[ 2 ];
|
||||
mCRC[ 0 ] = CRC.PASSED;
|
||||
}
|
||||
|
||||
protected String getMessageStub()
|
||||
|
||||
@@ -2,6 +2,7 @@ package decode.p25.message.tdu;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BitSetBuffer;
|
||||
import crc.CRC;
|
||||
import decode.p25.message.P25Message;
|
||||
import decode.p25.reference.DataUnitID;
|
||||
|
||||
@@ -11,5 +12,10 @@ public class TDUMessage extends P25Message
|
||||
AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
/* NID CRC is checked in the message framer, thus a constructed message
|
||||
* means it passed the CRC */
|
||||
mCRC = new CRC[ 1 ];
|
||||
mCRC[ 0 ] = CRC.PASSED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class MotorolaTSBKMessage extends TSBKMessage
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "SYS:" );
|
||||
sb.append( "NAC:" );
|
||||
sb.append( getNAC() ); /* NAC is the system id for TSBK messages */
|
||||
sb.append( " " );
|
||||
sb.append( getDUID().getLabel() );
|
||||
|
||||
Reference in New Issue
Block a user