mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
@@ -306,10 +306,8 @@ public class P25P1MessageProcessor implements Listener<IMessage>
|
||||
private void processForFrequencyBands(AbstractMessage message)
|
||||
{
|
||||
//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();
|
||||
|
||||
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
|
||||
if(message instanceof IFrequencyBand)
|
||||
if(message instanceof IFrequencyBand band && band.isValid())
|
||||
{
|
||||
IFrequencyBand bandIdentifier = (IFrequencyBand)message;
|
||||
mFrequencyBandMap.put(bandIdentifier.getIdentifier(), bandIdentifier);
|
||||
mFrequencyBandMap.put(band.getIdentifier(), band);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,43 +19,49 @@
|
||||
*/
|
||||
package io.github.dsheirer.module.decode.p25.phase1.message;
|
||||
|
||||
/**
|
||||
* P25 frequency band provider interface.
|
||||
*/
|
||||
public interface IFrequencyBand
|
||||
{
|
||||
/**
|
||||
* Indicates if the band is valid and passes CRC checks.
|
||||
*/
|
||||
boolean isValid();
|
||||
/**
|
||||
* (Band) Identifier
|
||||
*/
|
||||
public abstract int getIdentifier();
|
||||
int getIdentifier();
|
||||
|
||||
/**
|
||||
* Channel spacing in hertz
|
||||
*/
|
||||
public abstract long getChannelSpacing();
|
||||
long getChannelSpacing();
|
||||
|
||||
/**
|
||||
* Base frequency in hertz
|
||||
*/
|
||||
public abstract long getBaseFrequency();
|
||||
|
||||
long getBaseFrequency();
|
||||
|
||||
/**
|
||||
* Channel bandwidth in hertz
|
||||
*/
|
||||
public abstract int getBandwidth();
|
||||
int getBandwidth();
|
||||
|
||||
/**
|
||||
* Transmit offset in hertz
|
||||
*/
|
||||
public abstract long getTransmitOffset();
|
||||
long getTransmitOffset();
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public abstract long getUplinkFrequency(int channelNumber);
|
||||
long getUplinkFrequency(int channelNumber);
|
||||
|
||||
/**
|
||||
* Indicates if this band is an FDMA (false) or TDMA (true) band
|
||||
|
||||
@@ -34,6 +34,12 @@ public class P25FrequencyBand implements IFrequencyBand
|
||||
mTimeslotCount = timeslotCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
|
||||
@@ -50,6 +50,13 @@ public class FrequencyBandUpdate extends MacStructure implements IFrequencyBand
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -53,6 +53,13 @@ public class FrequencyBandUpdateTDMAAbbreviated extends MacStructure implements
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -59,6 +59,13 @@ public class FrequencyBandUpdateTDMAExtended extends MacStructure implements IFr
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -50,6 +50,13 @@ public class FrequencyBandUpdateVUHF extends MacStructure implements IFrequencyB
|
||||
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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user