mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-15 10:07:26 -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)
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user