mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-16 10:37:26 -05:00
P25 work in progress.
This commit is contained in:
@@ -74,8 +74,8 @@ public class TSBKMessage extends P25Message
|
||||
|
||||
Vendor vendor = getVendor();
|
||||
|
||||
sb.append( "SYS:" );
|
||||
sb.append( getNAC() ); /* NAC is the system id for TSBK messages */
|
||||
sb.append( "NAC:" );
|
||||
sb.append( getNAC() );
|
||||
sb.append( " " );
|
||||
sb.append( getDUID().getLabel() );
|
||||
|
||||
@@ -129,27 +129,4 @@ public class TSBKMessage extends P25Message
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
protected static long calculateUplink( IdentifierUpdate iden, int channel )
|
||||
{
|
||||
long downlink = calculateDownlink( iden, channel );
|
||||
|
||||
if( downlink > 0 && iden != null )
|
||||
{
|
||||
return downlink + iden.getTransmitOffset();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected static long calculateDownlink( IdentifierUpdate iden, int channel )
|
||||
{
|
||||
if( iden != null )
|
||||
{
|
||||
return iden.getBaseFrequency() +
|
||||
( channel * iden.getChannelSpacing() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,11 +47,9 @@ public class AdjacentStatusBroadcast extends TSBKMessage implements IdentifierUp
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SYSID:" + getSystemID() );
|
||||
sb.append( " SYS:" + getSystemID() );
|
||||
|
||||
sb.append( " RFSS:" + getRFSS() );
|
||||
|
||||
sb.append( " SITE:" + getSiteID() );
|
||||
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN:" + getIdentifier() + "-" + getChannel() );
|
||||
|
||||
@@ -109,6 +107,19 @@ public class AdjacentStatusBroadcast extends TSBKMessage implements IdentifierUp
|
||||
return mMessage.get( ACTIVE_NETWORK_CONNECTION_FLAG );
|
||||
}
|
||||
|
||||
public String getUniqueID()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getSystemID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getRFSS() );
|
||||
sb.append( ":" );
|
||||
sb.append( getSiteID() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
|
||||
@@ -46,7 +46,7 @@ public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierUpdate
|
||||
|
||||
sb.append( " SYSID:" + getSystemID() );
|
||||
|
||||
sb.append( " RFSS:" + getRFSS() );
|
||||
sb.append( " RFSS:" + getRFSubsystemID() );
|
||||
|
||||
sb.append( " SITE:" + getSiteID() );
|
||||
|
||||
@@ -81,7 +81,7 @@ public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierUpdate
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import decode.p25.reference.DataUnitID;
|
||||
import decode.p25.reference.Opcode;
|
||||
|
||||
public class SecondaryControlChannelBroadcast extends TSBKMessage
|
||||
implements IdentifierUpdateReceiver
|
||||
implements IdentifierUpdateReceiver, Comparable<SecondaryControlChannelBroadcast>
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SecondaryControlChannelBroadcast.class );
|
||||
@@ -50,9 +50,7 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " RFSS:" + getRFSS() );
|
||||
|
||||
sb.append( " SITE:" + getSiteID() );
|
||||
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN1:" + getIdentifier1() + "-" + getChannel1() );
|
||||
|
||||
@@ -151,15 +149,11 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
|
||||
{
|
||||
mIdentifierUpdate1 = message;
|
||||
}
|
||||
else if( identifier == getIdentifier2() )
|
||||
|
||||
if( identifier == getIdentifier2() )
|
||||
{
|
||||
mIdentifierUpdate2 = message;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException( "Unexpected identifier update "
|
||||
+ "message for identifier [" + identifier + "]" );
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
@@ -182,4 +176,29 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo( SecondaryControlChannelBroadcast other )
|
||||
{
|
||||
if( other.getSiteID().contentEquals( getSiteID() ) &&
|
||||
other.getIdentifier1() == getIdentifier1() &&
|
||||
other.getChannel1() == getChannel1() &&
|
||||
other.getChannel2() == getChannel2() &&
|
||||
other.getIdentifier2() == getIdentifier2() &&
|
||||
other.getDownlinkFrequency1() == getDownlinkFrequency1() &&
|
||||
other.getUplinkFrequency1() == getUplinkFrequency1() &&
|
||||
other.getDownlinkFrequency2() == getDownlinkFrequency2() &&
|
||||
other.getUplinkFrequency2() == getUplinkFrequency2() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if( other.getIdentifier1() < getIdentifier1() )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,7 @@ public class SecondaryControlChannelBroadcastExplicit
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " RFSS:" + getRFSS() );
|
||||
|
||||
sb.append( " SITE:" + getSiteID() );
|
||||
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " DOWNLINK:" + getIdentifier1() + "-" + getChannel1() );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SystemService
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "CONTROL CHAN:" );
|
||||
sb.append( "CONTROL CHAN[" );
|
||||
|
||||
if( isCompositeControlChannel( service ) )
|
||||
{
|
||||
@@ -58,7 +58,7 @@ public class SystemService
|
||||
sb.append( " BACKUP" );
|
||||
}
|
||||
|
||||
sb.append( " SERVICES:" );
|
||||
sb.append( " ] SERVICES[" );
|
||||
|
||||
if( providesAuthenticationServices( service ) )
|
||||
{
|
||||
@@ -79,6 +79,8 @@ public class SystemService
|
||||
{
|
||||
sb.append( " VOICE" );
|
||||
}
|
||||
|
||||
sb.append( " ]" );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user