mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 17:17:29 -05:00
P25 work in progress - adds CRC-CCITT error checking to TSBK messages and shows CRC correction state in the messages tab
This commit is contained in:
@@ -131,7 +131,6 @@ public class P25ChannelState extends ChannelState
|
||||
if( alias != null )
|
||||
{
|
||||
mSiteAlias = alias.getName();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ import message.Message;
|
||||
import alias.Alias;
|
||||
import alias.AliasList;
|
||||
import bits.BitSetBuffer;
|
||||
import crc.CRC;
|
||||
import decode.p25.message.tsbk.osp.control.IdentifierUpdate;
|
||||
import decode.p25.reference.DataUnitID;
|
||||
|
||||
@@ -28,6 +29,8 @@ public class P25Message extends Message
|
||||
protected DataUnitID mDUID;
|
||||
protected AliasList mAliasList;
|
||||
|
||||
protected CRC[] mCRC;
|
||||
|
||||
public P25Message( BitSetBuffer message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
@@ -52,7 +55,12 @@ public class P25Message extends Message
|
||||
@Override
|
||||
public String getErrorStatus()
|
||||
{
|
||||
return "UNK";
|
||||
if( mCRC == null )
|
||||
{
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
return CRC.format( mCRC );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,8 @@ package decode.p25.message.tsbk;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BitSetBuffer;
|
||||
import crc.CRC;
|
||||
import crc.CRCP25;
|
||||
import decode.p25.message.P25Message;
|
||||
import decode.p25.message.tsbk.motorola.MotorolaOpcode;
|
||||
import decode.p25.message.tsbk.vendor.VendorOpcode;
|
||||
@@ -11,6 +13,7 @@ import decode.p25.reference.Vendor;
|
||||
|
||||
public class TSBKMessage extends P25Message
|
||||
{
|
||||
public static final int MESSAGE_START = 64;
|
||||
public static final int LAST_BLOCK_FLAG = 64;
|
||||
public static final int ENCRYPTED_FLAG = 65;
|
||||
public static final int[] OPCODE = { 66,67,68,69,70,71 };
|
||||
@@ -28,13 +31,20 @@ public class TSBKMessage extends P25Message
|
||||
public static final int[] BLOCK10 = { 136,137,138,139,140,141,142,143 };
|
||||
public static final int[] BLOCK11 = { 144,145,146,147,148,149,150,151 };
|
||||
public static final int[] BLOCK12 = { 152,153,154,155,156,157,158,159 };
|
||||
|
||||
public static final int[] CRC = { 144,145,146,147,148,149,150,151,152,153,
|
||||
154,155,156,157,158,159 };
|
||||
public static final int CRC_START = 144;
|
||||
|
||||
public TSBKMessage( BitSetBuffer message, DataUnitID duid, AliasList aliasList )
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
checkCRC();
|
||||
}
|
||||
|
||||
protected void checkCRC()
|
||||
{
|
||||
mCRC = new CRC[ 1 ];
|
||||
|
||||
mCRC[ 0 ] = CRCP25.correctCCITT80( mMessage, MESSAGE_START, CRC_START );
|
||||
}
|
||||
|
||||
public boolean isLastBlock()
|
||||
|
||||
Reference in New Issue
Block a user