576 Update P25 Activity Summary To Provide Network Values in Hex and Decimal (#637)

* #576 Updates P25 activity summaries to list values in hex and decimal.  Resolves issue with P25 explicit channel uplink frequency calculations.  Resolves issue with Motorola base station id messages and traffic channel messages.  Resolves issue with RFSS link control message control channel frequency calculations.  Resolves issue with error when using recording tuners.
This commit is contained in:
Denny Sheirer
2020-01-11 05:23:47 -05:00
committed by GitHub
parent 085ba52294
commit f54b4dfd0e
3 changed files with 144 additions and 70 deletions

View File

@@ -1,7 +1,7 @@
/* /*
* *
* * ****************************************************************************** * * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer * * Copyright (C) 2014-2020 Dennis Sheirer
* * * *
* * This program is free software: you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
package io.github.dsheirer.module.decode.p25.phase1; package io.github.dsheirer.module.decode.p25.phase1;
import io.github.dsheirer.channel.IChannelDescriptor; import io.github.dsheirer.channel.IChannelDescriptor;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.p25.phase1.message.IFrequencyBand; import io.github.dsheirer.module.decode.p25.phase1.message.IFrequencyBand;
import io.github.dsheirer.module.decode.p25.phase1.message.lc.LinkControlWord; import io.github.dsheirer.module.decode.p25.phase1.message.lc.LinkControlWord;
import io.github.dsheirer.module.decode.p25.phase1.message.lc.standard.LCAdjacentSiteStatusBroadcast; import io.github.dsheirer.module.decode.p25.phase1.message.lc.standard.LCAdjacentSiteStatusBroadcast;
@@ -39,6 +40,7 @@ import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCAd
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCNetworkStatusBroadcast; import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCNetworkStatusBroadcast;
import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCRFSSStatusBroadcast; import io.github.dsheirer.module.decode.p25.phase1.message.pdu.ambtc.osp.AMBTCRFSSStatusBroadcast;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.TSBKMessage; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.TSBKMessage;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.MotorolaBaseStationId;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.standard.osp.AdjacentStatusBroadcast; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.standard.osp.AdjacentStatusBroadcast;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.standard.osp.NetworkStatusBroadcast; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.standard.osp.NetworkStatusBroadcast;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.standard.osp.RFSSStatusBroadcast; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.standard.osp.RFSSStatusBroadcast;
@@ -95,6 +97,8 @@ public class P25P1NetworkConfigurationMonitor
private Map<Integer,LCAdjacentSiteStatusBroadcastExplicit> mLCNeighborSitesExplicit = new HashMap<>(); private Map<Integer,LCAdjacentSiteStatusBroadcastExplicit> mLCNeighborSitesExplicit = new HashMap<>();
private Map<Integer,AdjacentStatusBroadcast> mTSBKNeighborSites = new HashMap<>(); private Map<Integer,AdjacentStatusBroadcast> mTSBKNeighborSites = new HashMap<>();
private MotorolaBaseStationId mMotorolaBaseStationId;
private P25P1Decoder.Modulation mModulation; private P25P1Decoder.Modulation mModulation;
/** /**
@@ -173,6 +177,12 @@ public class P25P1NetworkConfigurationMonitor
mSNDCPDataChannel = (SNDCPDataChannelAnnouncementExplicit)tsbk; mSNDCPDataChannel = (SNDCPDataChannelAnnouncementExplicit)tsbk;
} }
break; break;
case MOTOROLA_OSP_TRAFFIC_CHANNEL_ID:
if(tsbk instanceof MotorolaBaseStationId)
{
mMotorolaBaseStationId = (MotorolaBaseStationId)tsbk;
}
break;
} }
} }
@@ -314,6 +324,31 @@ public class P25P1NetworkConfigurationMonitor
mTSBKNeighborSites.clear(); mTSBKNeighborSites.clear();
} }
/**
* Formats the identifier with an appended hexadecimal value when the identifier is an integer
* @param identifier to format
* @param width of the hex value with zero pre-padding
* @return formatted identifier
*/
private String format(Identifier identifier, int width)
{
if(identifier.getValue() instanceof Integer)
{
String hex = Integer.toHexString((Integer)identifier.getValue());
while(hex.length() < width)
{
hex = "0" + hex;
}
return hex.toUpperCase() + "[" + identifier.getValue() + "]";
}
else
{
return identifier.toString();
}
}
public String getActivitySummary() public String getActivitySummary()
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@@ -323,26 +358,26 @@ public class P25P1NetworkConfigurationMonitor
sb.append("\n\nNetwork\n"); sb.append("\n\nNetwork\n");
if(mTSBKNetworkStatusBroadcast != null) if(mTSBKNetworkStatusBroadcast != null)
{ {
sb.append(" NAC:").append(mTSBKNetworkStatusBroadcast.getNAC()); sb.append(" WACN:").append(format(mTSBKNetworkStatusBroadcast.getWacn(), 5));
sb.append(" WACN:").append(mTSBKNetworkStatusBroadcast.getWacn()); sb.append(" SYSTEM:").append(format(mTSBKNetworkStatusBroadcast.getSystem(), 3));
sb.append(" SYSTEM:").append(mTSBKNetworkStatusBroadcast.getSystem()); sb.append(" NAC:").append(format(mTSBKNetworkStatusBroadcast.getNAC(), 3));
sb.append(" LRA:").append(mTSBKNetworkStatusBroadcast.getLocationRegistrationArea()); sb.append(" LRA:").append(format(mTSBKNetworkStatusBroadcast.getLocationRegistrationArea(), 2));
} }
else if(mAMBTCNetworkStatusBroadcast != null) else if(mAMBTCNetworkStatusBroadcast != null)
{ {
sb.append(" NAC:").append(mAMBTCNetworkStatusBroadcast.getNAC()); sb.append(" WACN:").append(format(mAMBTCNetworkStatusBroadcast.getWacn(), 5));
sb.append(" WACN:").append(mAMBTCNetworkStatusBroadcast.getWacn()); sb.append(" SYSTEM:").append(format(mAMBTCNetworkStatusBroadcast.getSystem(), 3));
sb.append(" SYSTEM:").append(mAMBTCNetworkStatusBroadcast.getSystem()); sb.append(" NAC:").append(format(mAMBTCNetworkStatusBroadcast.getNAC(), 3));
} }
else if(mLCNetworkStatusBroadcast != null) else if(mLCNetworkStatusBroadcast != null)
{ {
sb.append(" WACN:").append(mLCNetworkStatusBroadcast.getWACN()); sb.append(" WACN:").append(format(mLCNetworkStatusBroadcast.getWACN(), 5));
sb.append(" SYSTEM:").append(mLCNetworkStatusBroadcast.getSystem()); sb.append(" SYSTEM:").append(format(mLCNetworkStatusBroadcast.getSystem(), 3));
} }
else if(mLCNetworkStatusBroadcastExplicit != null) else if(mLCNetworkStatusBroadcastExplicit != null)
{ {
sb.append(" WACN:").append(mLCNetworkStatusBroadcastExplicit.getWACN()); sb.append(" WACN:").append(format(mLCNetworkStatusBroadcastExplicit.getWACN(), 5));
sb.append(" SYSTEM:").append(mLCNetworkStatusBroadcastExplicit.getSystem()); sb.append(" SYSTEM:").append(format(mLCNetworkStatusBroadcastExplicit.getSystem(), 3));
} }
else else
{ {
@@ -350,12 +385,14 @@ public class P25P1NetworkConfigurationMonitor
} }
sb.append("\n\nCurrent Site\n"); sb.append("\n\nCurrent Site\n");
if(mTSBKRFSSStatusBroadcast != null) if(mTSBKRFSSStatusBroadcast != null)
{ {
sb.append(" SYSTEM:").append(mTSBKRFSSStatusBroadcast.getSystem()); sb.append(" SYSTEM:").append(format(mTSBKRFSSStatusBroadcast.getSystem(), 3));
sb.append(" SITE:").append(mTSBKRFSSStatusBroadcast.getSite()); sb.append(" NAC:").append(format(mTSBKRFSSStatusBroadcast.getNAC(), 3));
sb.append(" RF SUBSYSTEM:").append(mTSBKRFSSStatusBroadcast.getRfss()); sb.append(" RFSS:").append(format(mTSBKRFSSStatusBroadcast.getRfss(), 2));
sb.append(" LOCATION REGISTRATION AREA:").append(mTSBKRFSSStatusBroadcast.getLocationRegistrationArea()); sb.append(" SITE:").append(format(mTSBKRFSSStatusBroadcast.getSite(), 2));
sb.append(" LRA:").append(format(mTSBKRFSSStatusBroadcast.getLocationRegistrationArea(), 2));
sb.append(" STATUS:").append(mTSBKRFSSStatusBroadcast.isActiveNetworkConnectionToRfssControllerSite() ? sb.append(" STATUS:").append(mTSBKRFSSStatusBroadcast.isActiveNetworkConnectionToRfssControllerSite() ?
"ACTIVE RFSS NETWORK CONNECTION\n" : "\n"); "ACTIVE RFSS NETWORK CONNECTION\n" : "\n");
sb.append(" PRI CONTROL CHANNEL:").append(mTSBKRFSSStatusBroadcast.getChannel()); sb.append(" PRI CONTROL CHANNEL:").append(mTSBKRFSSStatusBroadcast.getChannel());
@@ -364,29 +401,30 @@ public class P25P1NetworkConfigurationMonitor
} }
else if(mLCRFSSStatusBroadcast != null) else if(mLCRFSSStatusBroadcast != null)
{ {
sb.append(" SYSTEM:").append(mLCRFSSStatusBroadcast.getSystem()); sb.append(" SYSTEM:").append(format(mLCRFSSStatusBroadcast.getSystem(), 3));
sb.append(" SITE:").append(mLCRFSSStatusBroadcast.getSite()); sb.append(" RFSS:").append(format(mLCRFSSStatusBroadcast.getRfss(), 2));
sb.append(" RF SUBSYSTEM:").append(mLCRFSSStatusBroadcast.getRfss()); sb.append(" SITE:").append(format(mLCRFSSStatusBroadcast.getSite(), 2));
sb.append(" LOCATION REGISTRATION AREA:").append(mLCRFSSStatusBroadcast.getLocationRegistrationArea()).append("\n"); sb.append(" LRA:").append(format(mLCRFSSStatusBroadcast.getLocationRegistrationArea(), 2)).append("\n");
sb.append(" PRI CONTROL CHANNEL:").append(mLCRFSSStatusBroadcast.getChannel()); sb.append(" PRI CONTROL CHANNEL:").append(mLCRFSSStatusBroadcast.getChannel());
sb.append(" DOWNLINK:").append(mLCRFSSStatusBroadcast.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(mLCRFSSStatusBroadcast.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(mLCRFSSStatusBroadcast.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(mLCRFSSStatusBroadcast.getChannel().getUplinkFrequency()).append("\n");
} }
else if(mLCRFSSStatusBroadcastExplicit != null) else if(mLCRFSSStatusBroadcastExplicit != null)
{ {
sb.append(" SITE:").append(mLCRFSSStatusBroadcastExplicit.getSite()); sb.append(" RFSS:").append(mLCRFSSStatusBroadcastExplicit.getRfss());
sb.append(" RF SUBSYSTEM:").append(mLCRFSSStatusBroadcastExplicit.getRfss()); sb.append(" SITE:").append(format(mLCRFSSStatusBroadcastExplicit.getSite(), 2));
sb.append(" LOCATION REGISTRATION AREA:").append(mLCRFSSStatusBroadcastExplicit.getLocationRegistrationArea()).append("\n"); sb.append(" LRA:").append(format(mLCRFSSStatusBroadcastExplicit.getLocationRegistrationArea(), 2)).append("\n");
sb.append(" PRI CONTROL CHANNEL:").append(mLCRFSSStatusBroadcastExplicit.getChannel()); sb.append(" PRI CONTROL CHANNEL:").append(mLCRFSSStatusBroadcastExplicit.getChannel());
sb.append(" DOWNLINK:").append(mLCRFSSStatusBroadcastExplicit.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(mLCRFSSStatusBroadcastExplicit.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(mLCRFSSStatusBroadcastExplicit.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(mLCRFSSStatusBroadcastExplicit.getChannel().getUplinkFrequency()).append("\n");
} }
else if(mAMBTCRFSSStatusBroadcast != null) else if(mAMBTCRFSSStatusBroadcast != null)
{ {
sb.append(" SYSTEM:").append(mAMBTCRFSSStatusBroadcast.getSystem()); sb.append(" SYSTEM:").append(format(mAMBTCRFSSStatusBroadcast.getSystem(), 3));
sb.append(" SITE:").append(mAMBTCRFSSStatusBroadcast.getSite()); sb.append(" NAC:").append(format(mAMBTCRFSSStatusBroadcast.getNAC(), 3));
sb.append(" RF SUBSYSTEM:").append(mAMBTCRFSSStatusBroadcast.getRFSS()); sb.append(" RFSS:").append(format(mAMBTCRFSSStatusBroadcast.getRFSS(), 2));
sb.append(" LOCATION REGISTRATION AREA:").append(mAMBTCRFSSStatusBroadcast.getLRA()); sb.append(" SITE:").append(format(mAMBTCRFSSStatusBroadcast.getSite(), 2));
sb.append(" LRA:").append(format(mAMBTCRFSSStatusBroadcast.getLRA(), 2));
sb.append(" STATUS:").append(mAMBTCRFSSStatusBroadcast.isActiveNetworkConnectionToRfssControllerSite() ? sb.append(" STATUS:").append(mAMBTCRFSSStatusBroadcast.isActiveNetworkConnectionToRfssControllerSite() ?
"ACTIVE RFSS NETWORK CONNECTION\n" : "\n"); "ACTIVE RFSS NETWORK CONNECTION\n" : "\n");
sb.append(" PRI CONTROL CHANNEL:").append(mAMBTCRFSSStatusBroadcast.getChannel()); sb.append(" PRI CONTROL CHANNEL:").append(mAMBTCRFSSStatusBroadcast.getChannel());
@@ -423,6 +461,11 @@ public class P25P1NetworkConfigurationMonitor
sb.append(" UPLINK:").append(mSNDCPDataChannel.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(mSNDCPDataChannel.getChannel().getUplinkFrequency()).append("\n");
} }
if(mMotorolaBaseStationId != null)
{
sb.append(" STATION ID/LICENSE: " + mMotorolaBaseStationId.getCWID()).append("\n");
}
if(mTSBKSystemServiceBroadcast != null) if(mTSBKSystemServiceBroadcast != null)
{ {
sb.append(" AVAILABLE SERVICES:").append(mTSBKSystemServiceBroadcast.getAvailableServices()); sb.append(" AVAILABLE SERVICES:").append(mTSBKSystemServiceBroadcast.getAvailableServices());
@@ -434,7 +477,6 @@ public class P25P1NetworkConfigurationMonitor
sb.append(" SUPPORTED SERVICES:").append(mLCSystemServiceBroadcast.getSupportedServices()); sb.append(" SUPPORTED SERVICES:").append(mLCSystemServiceBroadcast.getSupportedServices());
} }
sb.append("\nNeighbor Sites\n"); sb.append("\nNeighbor Sites\n");
Set<Integer> sites = new TreeSet<>(); Set<Integer> sites = new TreeSet<>();
sites.addAll(mAMBTCNeighborSites.keySet()); sites.addAll(mAMBTCNeighborSites.keySet());
@@ -456,10 +498,11 @@ public class P25P1NetworkConfigurationMonitor
if(mAMBTCNeighborSites.containsKey(site)) if(mAMBTCNeighborSites.containsKey(site))
{ {
AMBTCAdjacentStatusBroadcast ambtc = mAMBTCNeighborSites.get(site); AMBTCAdjacentStatusBroadcast ambtc = mAMBTCNeighborSites.get(site);
sb.append(" SYSTEM:").append(ambtc.getSystem()); sb.append(" SYSTEM:").append(format(ambtc.getSystem(), 3));
sb.append(" SITE:").append(ambtc.getSite()); sb.append(" NAC:").append(format(ambtc.getNAC(), 3));
sb.append(" LRA:").append(ambtc.getLocationRegistrationArea()); sb.append(" RFSS:").append(format(ambtc.getRfss(), 2));
sb.append(" RFSS:").append(ambtc.getRfss()); sb.append(" SITE:").append(format(ambtc.getSite(), 2));
sb.append(" LRA:").append(format(ambtc.getLocationRegistrationArea(), 2));
sb.append(" CHANNEL:").append(ambtc.getChannel()); sb.append(" CHANNEL:").append(ambtc.getChannel());
sb.append(" DOWNLINK:").append(ambtc.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(ambtc.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(ambtc.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(ambtc.getChannel().getUplinkFrequency()).append("\n");
@@ -467,10 +510,10 @@ public class P25P1NetworkConfigurationMonitor
if(mLCNeighborSites.containsKey(site)) if(mLCNeighborSites.containsKey(site))
{ {
LCAdjacentSiteStatusBroadcast lc = mLCNeighborSites.get(site); LCAdjacentSiteStatusBroadcast lc = mLCNeighborSites.get(site);
sb.append(" SYSTEM:").append(lc.getSystem()); sb.append(" SYSTEM:").append(format(lc.getSystem(), 3));
sb.append(" SITE:").append(lc.getSite()); sb.append(" RFSS:").append(format(lc.getRfss(), 2));
sb.append(" LRA:").append(lc.getLocationRegistrationArea()); sb.append(" SITE:").append(format(lc.getSite(), 2));
sb.append(" RFSS:").append(lc.getRfss()); sb.append(" LRA:").append(format(lc.getLocationRegistrationArea(), 2));
sb.append(" CHANNEL:").append(lc.getChannel()); sb.append(" CHANNEL:").append(lc.getChannel());
sb.append(" DOWNLINK:").append(lc.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(lc.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(lc.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(lc.getChannel().getUplinkFrequency()).append("\n");
@@ -480,9 +523,9 @@ public class P25P1NetworkConfigurationMonitor
{ {
LCAdjacentSiteStatusBroadcastExplicit lce = mLCNeighborSitesExplicit.get(site); LCAdjacentSiteStatusBroadcastExplicit lce = mLCNeighborSitesExplicit.get(site);
sb.append(" SYSTEM:---"); sb.append(" SYSTEM:---");
sb.append(" SITE:").append(lce.getSite()); sb.append(" RFSS:").append(format(lce.getRfss(), 2));
sb.append(" LRA:").append(lce.getLocationRegistrationArea()); sb.append(" SITE:").append(format(lce.getSite(), 2));
sb.append(" RFSS:").append(lce.getRfss()); sb.append(" LRA:").append(format(lce.getLocationRegistrationArea(), 2));
sb.append(" CHANNEL:").append(lce.getChannel()); sb.append(" CHANNEL:").append(lce.getChannel());
sb.append(" DOWNLINK:").append(lce.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(lce.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(lce.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(lce.getChannel().getUplinkFrequency()).append("\n");
@@ -490,10 +533,11 @@ public class P25P1NetworkConfigurationMonitor
if(mTSBKNeighborSites.containsKey(site)) if(mTSBKNeighborSites.containsKey(site))
{ {
AdjacentStatusBroadcast asb = mTSBKNeighborSites.get(site); AdjacentStatusBroadcast asb = mTSBKNeighborSites.get(site);
sb.append(" SYSTEM:").append(asb.getSystem()); sb.append(" SYSTEM:").append(format(asb.getSystem(), 3));
sb.append(" SITE:").append(asb.getSite()); sb.append(" NAC:").append(format(asb.getNAC(), 3));
sb.append(" LRA:").append(asb.getLocationRegistrationArea()); sb.append(" RFSS:").append(format(asb.getRfss(), 2));
sb.append(" RFSS:").append(asb.getRfss()); sb.append(" SITE:").append(format(asb.getSite(), 2));
sb.append(" LRA:").append(format(asb.getLocationRegistrationArea(), 2));
sb.append(" CHANNEL:").append(asb.getChannel()); sb.append(" CHANNEL:").append(asb.getChannel());
sb.append(" DOWNLINK:").append(asb.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(asb.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(asb.getChannel().getUplinkFrequency()); sb.append(" UPLINK:").append(asb.getChannel().getUplinkFrequency());

View File

@@ -1,7 +1,7 @@
/* /*
* *
* * ****************************************************************************** * * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer * * Copyright (C) 2014-2020 Dennis Sheirer
* * * *
* * This program is free software: you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by
@@ -33,6 +33,7 @@ import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.isp.Unk
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.ChannelLoading; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.ChannelLoading;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.MotorolaBaseStationId; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.MotorolaBaseStationId;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.MotorolaDenyResponse; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.MotorolaDenyResponse;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.MotorolaTrafficChannel;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.PatchGroupAdd; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.PatchGroupAdd;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.PatchGroupDelete; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.PatchGroupDelete;
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.PatchGroupVoiceChannelGrant; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp.PatchGroupVoiceChannelGrant;
@@ -118,12 +119,15 @@ import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.unknown.isp.Unkn
import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.unknown.osp.UnknownVendorOSPMessage; import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.unknown.osp.UnknownVendorOSPMessage;
import io.github.dsheirer.module.decode.p25.reference.Direction; import io.github.dsheirer.module.decode.p25.reference.Direction;
import io.github.dsheirer.module.decode.p25.reference.Vendor; import io.github.dsheirer.module.decode.p25.reference.Vendor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Factory for creating Trunking Signalling Block (TSBK) message parser classes * Factory for creating Trunking Signalling Block (TSBK) message parser classes
*/ */
public class TSBKMessageFactory public class TSBKMessageFactory
{ {
private final static Logger mLog = LoggerFactory.getLogger(TSBKMessageFactory.class);
private static final ViterbiDecoder_1_2_P25 VITERBI_HALF_RATE_DECODER = new ViterbiDecoder_1_2_P25(); private static final ViterbiDecoder_1_2_P25 VITERBI_HALF_RATE_DECODER = new ViterbiDecoder_1_2_P25();
public static TSBKMessage create(Direction direction, P25P1DataUnitID dataUnitID, public static TSBKMessage create(Direction direction, P25P1DataUnitID dataUnitID,
@@ -308,7 +312,7 @@ public class TSBKMessageFactory
case MOTOROLA_OSP_DENY_RESPONSE: case MOTOROLA_OSP_DENY_RESPONSE:
return new MotorolaDenyResponse(dataUnitID, message, nac, timestamp); return new MotorolaDenyResponse(dataUnitID, message, nac, timestamp);
case MOTOROLA_OSP_TRAFFIC_CHANNEL_ID: case MOTOROLA_OSP_TRAFFIC_CHANNEL_ID:
return new MotorolaBaseStationId(dataUnitID, message, nac, timestamp); return new MotorolaTrafficChannel(dataUnitID, message, nac, timestamp);
case MOTOROLA_OSP_PATCH_GROUP_ADD: case MOTOROLA_OSP_PATCH_GROUP_ADD:
return new PatchGroupAdd(dataUnitID, message, nac, timestamp); return new PatchGroupAdd(dataUnitID, message, nac, timestamp);
case MOTOROLA_OSP_PATCH_GROUP_DELETE: case MOTOROLA_OSP_PATCH_GROUP_DELETE:

View File

@@ -1,7 +1,7 @@
/* /*
* *
* * ****************************************************************************** * * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer * * Copyright (C) 2014-2020 Dennis Sheirer
* * * *
* * This program is free software: you can redistribute it and/or modify * * 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 * * it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
package io.github.dsheirer.module.decode.p25.phase2; package io.github.dsheirer.module.decode.p25.phase2;
import io.github.dsheirer.channel.IChannelDescriptor; import io.github.dsheirer.channel.IChannelDescriptor;
import io.github.dsheirer.identifier.Identifier;
import io.github.dsheirer.module.decode.p25.phase1.message.IFrequencyBand; import io.github.dsheirer.module.decode.p25.phase1.message.IFrequencyBand;
import io.github.dsheirer.module.decode.p25.phase2.message.mac.MacMessage; import io.github.dsheirer.module.decode.p25.phase2.message.mac.MacMessage;
import io.github.dsheirer.module.decode.p25.phase2.message.mac.MacStructure; import io.github.dsheirer.module.decode.p25.phase2.message.mac.MacStructure;
@@ -84,6 +85,31 @@ public class P25P2NetworkConfigurationMonitor
{ {
} }
/**
* Formats the identifier with an appended hexadecimal value when the identifier is an integer
* @param identifier to format
* @param width of the hex value with zero pre-padding
* @return formatted identifier
*/
private String format(Identifier identifier, int width)
{
if(identifier.getValue() instanceof Integer)
{
String hex = Integer.toHexString((Integer)identifier.getValue());
while(hex.length() < width)
{
hex = "0" + hex;
}
return hex.toUpperCase() + "[" + identifier.getValue() + "]";
}
else
{
return identifier.toString();
}
}
/** /**
* Processes network configuration messages. * Processes network configuration messages.
* *
@@ -207,17 +233,17 @@ public class P25P2NetworkConfigurationMonitor
sb.append("\n\nNetwork\n"); sb.append("\n\nNetwork\n");
if(mNetworkStatusBroadcastAbbreviated != null) if(mNetworkStatusBroadcastAbbreviated != null)
{ {
sb.append(" NAC:").append(mNetworkStatusBroadcastAbbreviated.getNAC()); sb.append(" WACN:").append(format(mNetworkStatusBroadcastAbbreviated.getWACN(), 5));
sb.append(" WACN:").append(mNetworkStatusBroadcastAbbreviated.getWACN()); sb.append(" SYSTEM:").append(format(mNetworkStatusBroadcastAbbreviated.getSystem(), 3));
sb.append(" SYSTEM:").append(mNetworkStatusBroadcastAbbreviated.getSystem()); sb.append(" NAC:").append(format(mNetworkStatusBroadcastAbbreviated.getNAC(), 3));
sb.append(" LRA:").append(mNetworkStatusBroadcastAbbreviated.getLRA()); sb.append(" LRA:").append(format(mNetworkStatusBroadcastAbbreviated.getLRA(), 2));
} }
else if(mNetworkStatusBroadcastExtended != null) else if(mNetworkStatusBroadcastExtended != null)
{ {
sb.append(" NAC:").append(mNetworkStatusBroadcastExtended.getNAC()); sb.append(" WACN:").append(format(mNetworkStatusBroadcastExtended.getWACN(), 5));
sb.append(" WACN:").append(mNetworkStatusBroadcastExtended.getWACN()); sb.append(" SYSTEM:").append(format(mNetworkStatusBroadcastExtended.getSystem(), 3));
sb.append(" SYSTEM:").append(mNetworkStatusBroadcastExtended.getSystem()); sb.append(" NAC:").append(format(mNetworkStatusBroadcastExtended.getNAC(), 3));
sb.append(" LRA:").append(mNetworkStatusBroadcastExtended.getLRA()); sb.append(" LRA:").append(format(mNetworkStatusBroadcastExtended.getLRA(), 2));
} }
else else
{ {
@@ -227,20 +253,20 @@ public class P25P2NetworkConfigurationMonitor
sb.append("\n\nCurrent Site\n"); sb.append("\n\nCurrent Site\n");
if(mRFSSStatusBroadcastAbbreviated != null) if(mRFSSStatusBroadcastAbbreviated != null)
{ {
sb.append(" SYSTEM:").append(mRFSSStatusBroadcastAbbreviated.getSystem()); sb.append(" SYSTEM:").append(format(mRFSSStatusBroadcastAbbreviated.getSystem(), 3));
sb.append(" SITE:").append(mRFSSStatusBroadcastAbbreviated.getSite()); sb.append(" RFSS:").append(format(mRFSSStatusBroadcastAbbreviated.getRFSS(), 2));
sb.append(" RF SUBSYSTEM:").append(mRFSSStatusBroadcastAbbreviated.getRFSS()); sb.append(" SITE:").append(format(mRFSSStatusBroadcastAbbreviated.getSite(), 2));
sb.append(" LOCATION REGISTRATION AREA:").append(mRFSSStatusBroadcastAbbreviated.getLRA()); sb.append(" LRA:").append(format(mRFSSStatusBroadcastAbbreviated.getLRA(), 2));
sb.append(" PRI CONTROL CHANNEL:").append(mRFSSStatusBroadcastAbbreviated.getChannel()); sb.append(" PRI CONTROL CHANNEL:").append(mRFSSStatusBroadcastAbbreviated.getChannel());
sb.append(" DOWNLINK:").append(mRFSSStatusBroadcastAbbreviated.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(mRFSSStatusBroadcastAbbreviated.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(mRFSSStatusBroadcastAbbreviated.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(mRFSSStatusBroadcastAbbreviated.getChannel().getUplinkFrequency()).append("\n");
} }
else if(mRFSSStatusBroadcastExtended != null) else if(mRFSSStatusBroadcastExtended != null)
{ {
sb.append(" SYSTEM:").append(mRFSSStatusBroadcastExtended.getSystem()); sb.append(" SYSTEM:").append(format(mRFSSStatusBroadcastExtended.getSystem(), 3));
sb.append(" SITE:").append(mRFSSStatusBroadcastExtended.getSite()); sb.append(" RFSS:").append(format(mRFSSStatusBroadcastExtended.getRFSS(), 2));
sb.append(" RF SUBSYSTEM:").append(mRFSSStatusBroadcastExtended.getRFSS()); sb.append(" SITE:").append(format(mRFSSStatusBroadcastExtended.getSite(), 2));
sb.append(" LOCATION REGISTRATION AREA:").append(mRFSSStatusBroadcastExtended.getLRA()); sb.append(" LRA:").append(format(mRFSSStatusBroadcastExtended.getLRA(), 2));
sb.append(" PRI CONTROL CHANNEL:").append(mRFSSStatusBroadcastExtended.getChannel()); sb.append(" PRI CONTROL CHANNEL:").append(mRFSSStatusBroadcastExtended.getChannel());
sb.append(" DOWNLINK:").append(mRFSSStatusBroadcastExtended.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(mRFSSStatusBroadcastExtended.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(mRFSSStatusBroadcastExtended.getChannel().getUplinkFrequency()).append("\n"); sb.append(" UPLINK:").append(mRFSSStatusBroadcastExtended.getChannel().getUplinkFrequency()).append("\n");
@@ -294,10 +320,10 @@ public class P25P2NetworkConfigurationMonitor
if(mNeighborSitesAbbreviated.containsKey(site)) if(mNeighborSitesAbbreviated.containsKey(site))
{ {
AdjacentStatusBroadcastAbbreviated asb = mNeighborSitesAbbreviated.get(site); AdjacentStatusBroadcastAbbreviated asb = mNeighborSitesAbbreviated.get(site);
sb.append(" SYSTEM:").append(asb.getSystem()); sb.append(" SYSTEM:").append(format(asb.getSystem(), 3));
sb.append(" SITE:").append(asb.getSite()); sb.append(" RFSS:").append(format(asb.getRFSS(), 2));
sb.append(" LRA:").append(asb.getLRA()); sb.append(" SITE:").append(format(asb.getSite(), 2));
sb.append(" RFSS:").append(asb.getRFSS()); sb.append(" LRA:").append(format(asb.getLRA(), 2));
sb.append(" CHANNEL:").append(asb.getChannel()); sb.append(" CHANNEL:").append(asb.getChannel());
sb.append(" DOWNLINK:").append(asb.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(asb.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(asb.getChannel().getUplinkFrequency()); sb.append(" UPLINK:").append(asb.getChannel().getUplinkFrequency());
@@ -306,10 +332,10 @@ public class P25P2NetworkConfigurationMonitor
else if(mNeighborSitesAbbreviated.containsKey(site)) else if(mNeighborSitesAbbreviated.containsKey(site))
{ {
AdjacentStatusBroadcastAbbreviated asb = mNeighborSitesAbbreviated.get(site); AdjacentStatusBroadcastAbbreviated asb = mNeighborSitesAbbreviated.get(site);
sb.append(" SYSTEM:").append(asb.getSystem()); sb.append(" SYSTEM:").append(format(asb.getSystem(), 3));
sb.append(" SITE:").append(asb.getSite()); sb.append(" RFSS:").append(format(asb.getRFSS(), 2));
sb.append(" LRA:").append(asb.getLRA()); sb.append(" SITE:").append(format(asb.getSite(), 2));
sb.append(" RFSS:").append(asb.getRFSS()); sb.append(" LRA:").append(format(asb.getLRA(), 2));
sb.append(" CHANNEL:").append(asb.getChannel()); sb.append(" CHANNEL:").append(asb.getChannel());
sb.append(" DOWNLINK:").append(asb.getChannel().getDownlinkFrequency()); sb.append(" DOWNLINK:").append(asb.getChannel().getDownlinkFrequency());
sb.append(" UPLINK:").append(asb.getChannel().getUplinkFrequency()); sb.append(" UPLINK:").append(asb.getChannel().getUplinkFrequency());