#2473 P25P1 bad frequency bands messages contaminating channel frequency calculation map (#2474)

Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
Denny Sheirer
2026-09-26 04:05:26 -04:00
committed by GitHub
parent a33c99347b
commit 7ee3c5d251
7 changed files with 51 additions and 14 deletions

View File

@@ -306,10 +306,8 @@ public class P25P1MessageProcessor implements Listener<IMessage>
private void processForFrequencyBands(AbstractMessage message) private void processForFrequencyBands(AbstractMessage message)
{ {
//Insert frequency band identifier update messages into channel-type messages */ //Insert frequency band identifier update messages into channel-type messages */
if(message instanceof IFrequencyBandReceiver) if(message instanceof IFrequencyBandReceiver receiver)
{ {
IFrequencyBandReceiver receiver = (IFrequencyBandReceiver)message;
List<IBandChannelDescriptor> channels = receiver.getChannels(); List<IBandChannelDescriptor> channels = receiver.getChannels();
for(IBandChannelDescriptor channel : channels) for(IBandChannelDescriptor channel : channels)
@@ -327,10 +325,9 @@ public class P25P1MessageProcessor implements Listener<IMessage>
} }
//Store band identifiers so that they can be injected into channel type messages //Store band identifiers so that they can be injected into channel type messages
if(message instanceof IFrequencyBand) if(message instanceof IFrequencyBand band && band.isValid())
{ {
IFrequencyBand bandIdentifier = (IFrequencyBand)message; mFrequencyBandMap.put(band.getIdentifier(), band);
mFrequencyBandMap.put(bandIdentifier.getIdentifier(), bandIdentifier);
} }
} }

View File

@@ -19,43 +19,49 @@
*/ */
package io.github.dsheirer.module.decode.p25.phase1.message; package io.github.dsheirer.module.decode.p25.phase1.message;
/**
* P25 frequency band provider interface.
*/
public interface IFrequencyBand public interface IFrequencyBand
{ {
/**
* Indicates if the band is valid and passes CRC checks.
*/
boolean isValid();
/** /**
* (Band) Identifier * (Band) Identifier
*/ */
public abstract int getIdentifier(); int getIdentifier();
/** /**
* Channel spacing in hertz * Channel spacing in hertz
*/ */
public abstract long getChannelSpacing(); long getChannelSpacing();
/** /**
* Base frequency in hertz * Base frequency in hertz
*/ */
public abstract long getBaseFrequency(); long getBaseFrequency();
/** /**
* Channel bandwidth in hertz * Channel bandwidth in hertz
*/ */
public abstract int getBandwidth(); int getBandwidth();
/** /**
* Transmit offset in hertz * Transmit offset in hertz
*/ */
public abstract long getTransmitOffset(); long getTransmitOffset();
/** /**
* Downlink (tower to mobile) Frequency for the specified channel * Downlink (tower to mobile) Frequency for the specified channel
*/ */
public abstract long getDownlinkFrequency(int channelNumber); long getDownlinkFrequency(int channelNumber);
/** /**
* Uplink (mobile to tower) Frequency for the specified channel * Uplink (mobile to tower) Frequency for the specified channel
*/ */
public abstract long getUplinkFrequency(int channelNumber); long getUplinkFrequency(int channelNumber);
/** /**
* Indicates if this band is an FDMA (false) or TDMA (true) band * Indicates if this band is an FDMA (false) or TDMA (true) band

View File

@@ -34,6 +34,12 @@ public class P25FrequencyBand implements IFrequencyBand
mTimeslotCount = timeslotCount; mTimeslotCount = timeslotCount;
} }
@Override
public boolean isValid()
{
return true;
}
@Override @Override
public int getIdentifier() public int getIdentifier()
{ {

View File

@@ -50,6 +50,13 @@ public class FrequencyBandUpdate extends MacStructure implements IFrequencyBand
super(message, offset); super(message, offset);
} }
@Override
public boolean isValid()
{
//Note: this message is only created when the parent passes CRC, therefore it should be valid.
return true;
}
/** /**
* Textual representation of this message * Textual representation of this message
*/ */

View File

@@ -53,6 +53,13 @@ public class FrequencyBandUpdateTDMAAbbreviated extends MacStructure implements
super(message, offset); super(message, offset);
} }
@Override
public boolean isValid()
{
//Note: this message is only created when the parent passes CRC, therefore it should be valid.
return true;
}
/** /**
* Textual representation of this message * Textual representation of this message
*/ */

View File

@@ -59,6 +59,13 @@ public class FrequencyBandUpdateTDMAExtended extends MacStructure implements IFr
super(message, offset); super(message, offset);
} }
@Override
public boolean isValid()
{
//Note: this message is only created when the parent passes CRC, therefore it should be valid.
return true;
}
/** /**
* Textual representation of this message * Textual representation of this message
*/ */

View File

@@ -50,6 +50,13 @@ public class FrequencyBandUpdateVUHF extends MacStructure implements IFrequencyB
super(message, offset); super(message, offset);
} }
@Override
public boolean isValid()
{
//Note: this message is only created when the parent passes CRC, therefore it should be valid.
return true;
}
/** /**
* Textual representation of this message * Textual representation of this message
*/ */