Resolves #173 - logging/management of P25 TDMA channels. There is no Phase II decoder support yet.

This commit is contained in:
Denny
2017-02-12 10:20:45 -05:00
parent a0c32f6fe0
commit 6916d95cdf
53 changed files with 5780 additions and 4601 deletions

View File

@@ -1,40 +1,51 @@
/*******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package module.decode.p25.message.tsbk.osp.control;
import alias.AliasList;
import bits.BinaryMessage;
import module.decode.p25.message.IAdjacentSite;
import module.decode.p25.message.IBandIdentifier;
import module.decode.p25.message.IdentifierReceiver;
import module.decode.p25.message.tsbk.TSBKMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
public class AdjacentStatusBroadcast extends TSBKMessage
implements IdentifierReceiver, IAdjacentSite
public class AdjacentStatusBroadcast extends TSBKMessage implements IdentifierReceiver, IAdjacentSite
{
public static final int[] LOCATION_REGISTRATION_AREA = { 80,81,82,83,84,85,
86,87 };
public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87};
public static final int CONVENTIONAL_CHANNEL_FLAG = 88;
public static final int SITE_FAILURE_CONDITION_FLAG = 89;
public static final int VALID_FLAG = 90;
public static final int ACTIVE_NETWORK_CONNECTION_FLAG = 91;
public static final int[] SYSTEM_ID = { 92,93,94,95,96,97,98,99,100,101,
102,103 };
public static final int[] RFSS_ID = { 104,105,106,107,108,109,110,111 };
public static final int[] SITE_ID = { 112,113,114,115,116,117,118,119 };
public static final int[] IDENTIFIER = { 120,121,122,123 };
public static final int[] CHANNEL = { 124,125,126,127,128,129,130,131,132,
133,134,135 };
public static final int[] SYSTEM_SERVICE_CLASS = { 136,137,138,139,140,141,
142,143 };
public static final int[] SYSTEM_ID = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103};
public static final int[] RFSS_ID = {104, 105, 106, 107, 108, 109, 110, 111};
public static final int[] SITE_ID = {112, 113, 114, 115, 116, 117, 118, 119};
public static final int[] IDENTIFIER = {120, 121, 122, 123};
public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135};
public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143};
private IBandIdentifier mIdentifierUpdate;
public AdjacentStatusBroadcast( BinaryMessage message,
DataUnitID duid,
AliasList aliasList )
public AdjacentStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList)
{
super( message, duid, aliasList );
super(message, duid, aliasList);
}
@Override
@@ -42,154 +53,164 @@ public class AdjacentStatusBroadcast extends TSBKMessage
{
return Opcode.ADJACENT_STATUS_BROADCAST.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " LRA:" + getLRA() );
sb.append( " SYS:" + getSystemID() );
sb.append(getMessageStub());
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
sb.append( " CHAN:" + getIdentifier() + "-" + getChannel() );
sb.append(" LRA:" + getLRA());
sb.append( " DN:" + getDownlinkFrequency() );
sb.append(" SYS:" + getSystemID());
sb.append( " UP:" + getUplinkFrequency() );
if( isConventionalChannel() )
sb.append(" SITE:" + getRFSS() + "-" + getSiteID());
sb.append(" CHAN:" + getIdentifier() + "-" + getChannel());
sb.append(" DN:" + getDownlinkFrequency());
sb.append(" UP:" + getUplinkFrequency());
if(isConventionalChannel())
{
sb.append( " CONVENTIONAL" );
sb.append(" CONVENTIONAL");
}
if( isSiteFailureCondition() )
if(isSiteFailureCondition())
{
sb.append( " FAILURE-CONDITION" );
sb.append(" FAILURE-CONDITION");
}
if( isValidSiteInformation() )
if(isValidSiteInformation())
{
sb.append( " VALID-INFO" );
sb.append(" VALID-INFO");
}
if( hasActiveNetworkConnection() )
if(hasActiveNetworkConnection())
{
sb.append( " ACTIVE-NETWORK-CONN" );
sb.append(" ACTIVE-NETWORK-CONN");
}
sb.append( getSystemServiceClass() );
sb.append(getSystemServiceClass());
return sb.toString();
}
@Override
public String getDownlinkChannel()
{
return getIdentifier() + "-" + getChannel();
}
@Override
public String getUplinkChannel()
{
return getIdentifier() + "-" + getChannel();
}
public String getLRA()
public String getDownlinkChannel()
{
return mMessage.getHex( LOCATION_REGISTRATION_AREA, 2 );
return getIdentifier() + "-" + getChannel();
}
@Override
public String getUplinkChannel()
{
return getIdentifier() + "-" + getChannel();
}
public String getLRA()
{
return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2);
}
public boolean isConventionalChannel()
{
return mMessage.get( CONVENTIONAL_CHANNEL_FLAG );
return mMessage.get(CONVENTIONAL_CHANNEL_FLAG);
}
public boolean isSiteFailureCondition()
{
return mMessage.get( SITE_FAILURE_CONDITION_FLAG );
return mMessage.get(SITE_FAILURE_CONDITION_FLAG);
}
public boolean isValidSiteInformation()
{
return mMessage.get( VALID_FLAG );
return mMessage.get(VALID_FLAG);
}
public boolean hasActiveNetworkConnection()
{
return mMessage.get( ACTIVE_NETWORK_CONNECTION_FLAG );
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();
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 );
return mMessage.getHex(SYSTEM_ID, 3);
}
public String getRFSS()
{
return mMessage.getHex( RFSS_ID, 2 );
return mMessage.getHex(RFSS_ID, 2);
}
public String getSiteID()
{
return mMessage.getHex( SITE_ID, 2 );
return mMessage.getHex(SITE_ID, 2);
}
public int getChannel()
{
return mMessage.getInt( CHANNEL );
return mMessage.getInt(CHANNEL);
}
public int getIdentifier()
{
return mMessage.getInt( IDENTIFIER );
return mMessage.getInt(IDENTIFIER);
}
public String getSystemServiceClass()
{
return SystemService.toString( mMessage.getInt( SYSTEM_SERVICE_CLASS ) );
return SystemService.toString(mMessage.getInt(SYSTEM_SERVICE_CLASS));
}
public long getDownlinkFrequency()
{
return calculateDownlink( mIdentifierUpdate, getChannel() );
if(mIdentifierUpdate != null)
{
return mIdentifierUpdate.getDownlinkFrequency(getChannel());
}
return 0;
}
public long getUplinkFrequency()
{
return calculateUplink( mIdentifierUpdate, getChannel() );
}
if(mIdentifierUpdate != null)
{
return mIdentifierUpdate.getUplinkFrequency(getChannel());
}
@Override
public void setIdentifierMessage( int identifier, IBandIdentifier message )
{
/* we're only expecting 1 identifier, so use whatever is received */
mIdentifierUpdate = message;
return 0;
}
@Override
public void setIdentifierMessage(int identifier, IBandIdentifier message)
{
/* we're only expecting 1 identifier, so use whatever is received */
mIdentifierUpdate = message;
}
public int[] getIdentifiers()
{
int[] idens = new int[1];
idens[0] = getIdentifier();
return idens;
}
public int[] getIdentifiers()
{
int[] idens = new int[ 1 ];
idens[ 0 ] = getIdentifier();
return idens;
}
}

View File

@@ -1,3 +1,21 @@
/*******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package module.decode.p25.message.tsbk.osp.control;
import module.decode.p25.message.IBandIdentifier;
@@ -6,8 +24,7 @@ import module.decode.p25.reference.DataUnitID;
import alias.AliasList;
import bits.BinaryMessage;
public abstract class IdentifierUpdate extends TSBKMessage
implements IBandIdentifier
public abstract class IdentifierUpdate extends TSBKMessage implements IBandIdentifier
{
public static final int[] IDENTIFIER = { 80,81,82,83 };
@@ -45,4 +62,22 @@ public abstract class IdentifierUpdate extends TSBKMessage
@Override
public abstract long getTransmitOffset();
@Override
public long getDownlinkFrequency(int channelNumber)
{
return getBaseFrequency() + ( channelNumber * getChannelSpacing() );
}
@Override
public long getUplinkFrequency(int channelNumber)
{
return getDownlinkFrequency(channelNumber) + getTransmitOffset();
}
@Override
public boolean isTDMA()
{
return false;
}
}

View File

@@ -80,7 +80,26 @@ public class IdentifierUpdateTDMA extends IdentifierUpdate
return -offset;
}
}
@Override
public long getDownlinkFrequency(int channelNumber)
{
if(isTDMA())
{
return getBaseFrequency() + ( (channelNumber / getChannelType().getSlotsPerCarrier()) * getChannelSpacing() );
}
else
{
return super.getDownlinkFrequency(channelNumber);
}
}
@Override
public boolean isTDMA()
{
return getChannelType().getAccessType() == AccessType.TDMA;
}
public enum ChannelType
{
TYPE_0( AccessType.FDMA, 12500, 1, Vocoder.HALF_RATE ),

View File

@@ -1,35 +1,46 @@
/*******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package module.decode.p25.message.tsbk.osp.control;
import alias.AliasList;
import bits.BinaryMessage;
import module.decode.p25.message.IBandIdentifier;
import module.decode.p25.message.IdentifierReceiver;
import module.decode.p25.message.tsbk.TSBKMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import module.decode.p25.reference.P25NetworkCallsign;
import alias.AliasList;
import bits.BinaryMessage;
public class NetworkStatusBroadcast extends TSBKMessage implements IdentifierReceiver
{
public static final int[] LOCATION_REGISTRATION_AREA = { 80,81,82,83,84,85,
86,87 };
public static final int[] WACN = { 88,89,90,91,92,93,94,95,96,97,98,99,100,
101,102,103,104,105,106,107 };
public static final int[] SYSTEM_ID = { 108,109,110,111,112,113,114,115,116,
117,118,119 };
public static final int[] IDENTIFIER = { 120,121,122,123 };
public static final int[] CHANNEL = { 124,125,126,127,128,129,130,131,132,
133,134,135 };
public static final int[] SYSTEM_SERVICE_CLASS = { 136,137,138,139,140,141,
142,143 };
public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87};
public static final int[] WACN = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107};
public static final int[] SYSTEM_ID = {108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119};
public static final int[] IDENTIFIER = {120, 121, 122, 123};
public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135};
public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143};
private IBandIdentifier mIdentifierUpdate;
public NetworkStatusBroadcast( BinaryMessage message,
DataUnitID duid,
AliasList aliasList )
public NetworkStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList)
{
super( message, duid, aliasList );
super(message, duid, aliasList);
}
@Override
@@ -37,90 +48,100 @@ public class NetworkStatusBroadcast extends TSBKMessage implements IdentifierRec
{
return Opcode.NETWORK_STATUS_BROADCAST.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " LRA:" + getLocationRegistrationArea() );
sb.append( " WACN:" + getWACN() );
sb.append( " SYS:" + getSystemID() );
sb.append( " CTRL CHAN:" + getIdentifier() + "-" + getChannel() );
sb.append( " DN:" + getDownlinkFrequency() );
sb.append( " UP:" + getUplinkFrequency() );
sb.append( " SYS SVC CLASS:" +
SystemService.toString( getSystemServiceClass() ) );
sb.append(getMessageStub());
sb.append(" LRA:" + getLocationRegistrationArea());
sb.append(" WACN:" + getWACN());
sb.append(" SYS:" + getSystemID());
sb.append(" CTRL CHAN:" + getIdentifier() + "-" + getChannel());
sb.append(" DN:" + getDownlinkFrequency());
sb.append(" UP:" + getUplinkFrequency());
sb.append(" SYS SVC CLASS:" +
SystemService.toString(getSystemServiceClass()));
return sb.toString();
}
public String getLocationRegistrationArea()
{
return mMessage.getHex( LOCATION_REGISTRATION_AREA, 2 );
return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2);
}
public String getWACN()
{
return mMessage.getHex( WACN, 5 );
}
public String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );
return mMessage.getHex(WACN, 5);
}
public String getSystemID()
{
return mMessage.getHex(SYSTEM_ID, 3);
}
public String getNetworkCallsign()
{
return P25NetworkCallsign.getCallsign(mMessage.getInt(WACN),
mMessage.getInt(SYSTEM_ID));
}
public String getNetworkCallsign()
{
return P25NetworkCallsign.getCallsign( mMessage.getInt( WACN ),
mMessage.getInt( SYSTEM_ID ) );
}
public int getIdentifier()
{
return mMessage.getInt( IDENTIFIER );
return mMessage.getInt(IDENTIFIER);
}
public int getChannel()
{
return mMessage.getInt( CHANNEL );
return mMessage.getInt(CHANNEL);
}
public int getSystemServiceClass()
{
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
}
public long getDownlinkFrequency()
{
return calculateDownlink( mIdentifierUpdate, getChannel() );
}
public long getUplinkFrequency()
{
return calculateUplink( mIdentifierUpdate, getChannel() );
if(mIdentifierUpdate != null)
{
return mIdentifierUpdate.getDownlinkFrequency(getChannel());
}
return 0;
}
@Override
public void setIdentifierMessage( int identifier, IBandIdentifier message )
public long getUplinkFrequency()
{
/* we're only expecting 1 identifier, so use whatever is received */
mIdentifierUpdate = message;
if(mIdentifierUpdate != null)
{
return mIdentifierUpdate.getUplinkFrequency(getChannel());
}
return 0;
}
@Override
public void setIdentifierMessage(int identifier, IBandIdentifier message)
{
/* we're only expecting 1 identifier, so use whatever is received */
mIdentifierUpdate = message;
}
public int[] getIdentifiers()
{
int[] idens = new int[1];
idens[0] = getIdentifier();
return idens;
}
public int[] getIdentifiers()
{
int[] idens = new int[ 1 ];
idens[ 0 ] = getIdentifier();
return idens;
}
}

View File

@@ -1,35 +1,47 @@
/*******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package module.decode.p25.message.tsbk.osp.control;
import alias.AliasList;
import bits.BinaryMessage;
import module.decode.p25.message.IBandIdentifier;
import module.decode.p25.message.IdentifierReceiver;
import module.decode.p25.message.tsbk.TSBKMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import alias.AliasList;
import bits.BinaryMessage;
public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierReceiver
{
public static final int[] LOCATION_REGISTRATION_AREA = { 80,81,82,83,84,85,
86,87 };
public static final int[] LOCATION_REGISTRATION_AREA = {80, 81, 82, 83, 84, 85, 86, 87};
public static final int ACTIVE_NETWORK_CONNECTION_FLAG = 91;
public static final int[] SYSTEM_ID = { 92,93,94,95,96,97,98,99,100,101,
102,103 };
public static final int[] RFSS_ID = { 104,105,106,107,108,109,110,111 };
public static final int[] SITE_ID = { 112,113,114,115,116,117,118,119 };
public static final int[] IDENTIFIER = { 120,121,122,123 };
public static final int[] CHANNEL = { 124,125,126,127,128,129,130,131,132,
133,134,135 };
public static final int[] SYSTEM_SERVICE_CLASS = { 136,137,138,139,140,141,
142,143 };
public static final int[] SYSTEM_ID = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103};
public static final int[] RFSS_ID = {104, 105, 106, 107, 108, 109, 110, 111};
public static final int[] SITE_ID = {112, 113, 114, 115, 116, 117, 118, 119};
public static final int[] IDENTIFIER = {120, 121, 122, 123};
public static final int[] CHANNEL = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135};
public static final int[] SYSTEM_SERVICE_CLASS = {136, 137, 138, 139, 140, 141, 142, 143};
private IBandIdentifier mIdentifierUpdate;
public RFSSStatusBroadcast( BinaryMessage message,
DataUnitID duid,
AliasList aliasList )
public RFSSStatusBroadcast(BinaryMessage message, DataUnitID duid, AliasList aliasList)
{
super( message, duid, aliasList );
super(message, duid, aliasList);
}
@Override
@@ -37,100 +49,110 @@ public class RFSSStatusBroadcast extends TSBKMessage implements IdentifierReceiv
{
return Opcode.RFSS_STATUS_BROADCAST.getDescription();
}
public String getMessage()
{
StringBuilder sb = new StringBuilder();
sb.append( getMessageStub() );
sb.append( " LRA:" + getLocationRegistrationArea() );
sb.append( " SYSID:" + getSystemID() );
sb.append(getMessageStub());
sb.append( " RFSS:" + getRFSubsystemID() );
sb.append( " SITE:" + getSiteID() );
sb.append( " CHAN:" + getIdentifier() + "-" + getChannel() );
sb.append( " DN:" + getDownlinkFrequency() );
sb.append( " UP:" + getUplinkFrequency() );
sb.append(" LRA:" + getLocationRegistrationArea());
if( hasActiveNetworkConnection() )
sb.append(" SYSID:" + getSystemID());
sb.append(" RFSS:" + getRFSubsystemID());
sb.append(" SITE:" + getSiteID());
sb.append(" CHAN:" + getIdentifier() + "-" + getChannel());
sb.append(" DN:" + getDownlinkFrequency());
sb.append(" UP:" + getUplinkFrequency());
if(hasActiveNetworkConnection())
{
sb.append( " ACTIVE-NETWORK-CONN" );
sb.append(" ACTIVE-NETWORK-CONN");
}
sb.append( SystemService.toString( getSystemServiceClass() ) );
sb.append(SystemService.toString(getSystemServiceClass()));
return sb.toString();
}
public String getLocationRegistrationArea()
{
return mMessage.getHex( LOCATION_REGISTRATION_AREA, 2 );
return mMessage.getHex(LOCATION_REGISTRATION_AREA, 2);
}
public boolean hasActiveNetworkConnection()
{
return mMessage.get( ACTIVE_NETWORK_CONNECTION_FLAG );
return mMessage.get(ACTIVE_NETWORK_CONNECTION_FLAG);
}
public String getSystemID()
{
return mMessage.getHex( SYSTEM_ID, 3 );
return mMessage.getHex(SYSTEM_ID, 3);
}
public String getRFSubsystemID()
{
return mMessage.getHex( RFSS_ID, 2 );
return mMessage.getHex(RFSS_ID, 2);
}
public String getSiteID()
{
return mMessage.getHex( SITE_ID, 2 );
return mMessage.getHex(SITE_ID, 2);
}
public int getIdentifier()
{
return mMessage.getInt( IDENTIFIER );
}
public int getChannel()
{
return mMessage.getInt( CHANNEL );
}
public int getSystemServiceClass()
{
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
}
public long getDownlinkFrequency()
{
return calculateDownlink( mIdentifierUpdate, getChannel() );
}
public long getUplinkFrequency()
{
return calculateUplink( mIdentifierUpdate, getChannel() );
return mMessage.getInt(IDENTIFIER);
}
@Override
public void setIdentifierMessage( int identifier, IBandIdentifier message )
public int getChannel()
{
/* we're only expecting 1 identifier, so use whatever is received */
mIdentifierUpdate = message;
return mMessage.getInt(CHANNEL);
}
public int getSystemServiceClass()
{
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
}
public long getDownlinkFrequency()
{
if(mIdentifierUpdate != null)
{
return mIdentifierUpdate.getDownlinkFrequency(getChannel());
}
return 0;
}
public long getUplinkFrequency()
{
if(mIdentifierUpdate != null)
{
return mIdentifierUpdate.getUplinkFrequency(getChannel());
}
return 0;
}
@Override
public void setIdentifierMessage(int identifier, IBandIdentifier message)
{
/* we're only expecting 1 identifier, so use whatever is received */
mIdentifierUpdate = message;
}
public int[] getIdentifiers()
{
int[] idens = new int[1];
idens[0] = getIdentifier();
return idens;
}
public int[] getIdentifiers()
{
int[] idens = new int[ 1 ];
idens[ 0 ] = getIdentifier();
return idens;
}
}

View File

@@ -1,3 +1,21 @@
/*******************************************************************************
* sdrtrunk
* Copyright (C) 2014-2017 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package module.decode.p25.message.tsbk.osp.control;
import alias.AliasList;
@@ -7,38 +25,21 @@ import module.decode.p25.message.IdentifierReceiver;
import module.decode.p25.message.tsbk.TSBKMessage;
import module.decode.p25.reference.DataUnitID;
import module.decode.p25.reference.Opcode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SecondaryControlChannelBroadcast extends TSBKMessage
implements IdentifierReceiver, Comparable<SecondaryControlChannelBroadcast>
public class SecondaryControlChannelBroadcast extends TSBKMessage implements IdentifierReceiver, Comparable<SecondaryControlChannelBroadcast>
{
private final static Logger mLog =
LoggerFactory.getLogger(SecondaryControlChannelBroadcast.class);
public static final int[] RFSS_ID = {80, 81, 82, 83, 84, 85, 86, 87};
public static final int[] SITE_ID = {88, 89, 90, 91, 92, 93, 94, 95};
public static final int[] IDENTIFIER_1 = {96, 97, 98, 99};
public static final int[] CHANNEL_1 = {100, 101, 102, 103, 104, 105, 106, 107, 108,
109, 110, 111};
public static final int[] SYSTEM_SERVICE_CLASS_1 = {112, 113, 114, 115, 116,
117, 118, 119};
public static final int[] CHANNEL_1 = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
public static final int[] SYSTEM_SERVICE_CLASS_1 = {112, 113, 114, 115, 116, 117, 118, 119};
public static final int[] IDENTIFIER_2 = {120, 121, 122, 123};
public static final int[] CHANNEL_2 = {124, 125, 126, 127, 128, 129, 130, 131, 132,
133, 134, 135};
public static final int[] SYSTEM_SERVICE_CLASS_2 = {136, 137, 138, 139, 140,
141, 142, 143};
public static final int[] CHANNEL_2 = {124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135};
public static final int[] SYSTEM_SERVICE_CLASS_2 = {136, 137, 138, 139, 140, 141, 142, 143};
private IBandIdentifier mIdentifierUpdate1;
private IBandIdentifier mIdentifierUpdate2;
private int mRFSS;
private int mSite;
private int mIdent1;
private int mIdent2;
private int mChan1;
private int mChan2;
public SecondaryControlChannelBroadcast(BinaryMessage message,
DataUnitID duid,
AliasList aliasList)
@@ -66,8 +67,7 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
sb.append(" UP1:" + getUplinkFrequency1());
sb.append(" SVC1:" +
SystemService.toString(getSystemServiceClass1()));
sb.append(" SVC1:" + SystemService.toString(getSystemServiceClass1()));
if(hasChannel2())
{
@@ -77,8 +77,7 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
sb.append(" UP2:" + getUplinkFrequency2());
sb.append(" SVC2:" +
SystemService.toString(getSystemServiceClass2()));
sb.append(" SVC2:" + SystemService.toString(getSystemServiceClass2()));
}
return sb.toString();
@@ -132,22 +131,42 @@ public class SecondaryControlChannelBroadcast extends TSBKMessage
public long getDownlinkFrequency1()
{
return calculateDownlink(mIdentifierUpdate1, getChannel1());
if(mIdentifierUpdate1 != null)
{
return mIdentifierUpdate1.getDownlinkFrequency(getChannel1());
}
return 0;
}
public long getUplinkFrequency1()
{
return calculateUplink(mIdentifierUpdate1, getChannel1());
if(mIdentifierUpdate1 != null)
{
return mIdentifierUpdate1.getUplinkFrequency(getChannel1());
}
return 0;
}
public long getDownlinkFrequency2()
{
return calculateDownlink(mIdentifierUpdate2, getChannel2());
if(mIdentifierUpdate2 != null)
{
return mIdentifierUpdate2.getDownlinkFrequency(getChannel2());
}
return 0;
}
public long getUplinkFrequency2()
{
return calculateUplink(mIdentifierUpdate2, getChannel2());
if(mIdentifierUpdate2 != null)
{
return mIdentifierUpdate2.getUplinkFrequency(getChannel2());
}
return 0;
}
@Override