mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-09 15:17:24 -05:00
Resolves #173 - logging/management of P25 TDMA channels. There is no Phase II decoder support yet.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
buffers. Bounded queues have ability to enter/exit overflow state when queue
|
||||
size reaches overflow threshold and reset when queue size falls below the reset
|
||||
threshold. Channel state will show OVERFLOW in red/yellow.
|
||||
- Improves handling of P25 TDMA channels (NO Phase 2 decoder support yet)
|
||||
- Updated airspy controller for airspy-mini specific sample rate handling.
|
||||
- New developer remez filter designer tool and internal usage
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
package channel.metadata;
|
||||
|
||||
import alias.Alias;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import sample.Listener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -30,8 +28,6 @@ import java.util.Map;
|
||||
|
||||
public class AttributeMonitor<T>
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(AttributeMonitor.class);
|
||||
|
||||
private Attribute mAttribute;
|
||||
private Listener<AttributeChangeRequest> mListener;
|
||||
private boolean mHeuristicsEnabled = true;
|
||||
@@ -50,8 +46,8 @@ public class AttributeMonitor<T>
|
||||
* an internal mapping of values to occurrence counts is updated and a change is emitted once a value that is
|
||||
* different from the current value, has a higher occurrence count than the current value. If heuristics are
|
||||
* disabled, then a change is emitted at each change in the value.
|
||||
* @param t
|
||||
*
|
||||
* @param t type
|
||||
* @return true if the value was changed after processing
|
||||
*/
|
||||
public boolean process(T t)
|
||||
@@ -83,7 +79,7 @@ public class AttributeMonitor<T>
|
||||
{
|
||||
int count = mOccurrenceCounts.get(mCurrentValue);
|
||||
|
||||
for(Map.Entry<T,Integer> entry: mOccurrenceCounts.entrySet())
|
||||
for(Map.Entry<T,Integer> entry : mOccurrenceCounts.entrySet())
|
||||
{
|
||||
if(entry.getValue() > count)
|
||||
{
|
||||
@@ -155,35 +151,4 @@ public class AttributeMonitor<T>
|
||||
{
|
||||
return mCurrentValue != null;
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
AttributeMonitor<String> monitor = new AttributeMonitor<>(Attribute.PRIMARY_ADDRESS_TO, new Listener<AttributeChangeRequest>()
|
||||
{
|
||||
@Override
|
||||
public void receive(AttributeChangeRequest attributeChangeRequest)
|
||||
{
|
||||
mLog.debug("Attribute Changed - value:" + attributeChangeRequest.getValue());
|
||||
}
|
||||
});
|
||||
monitor.addIllegalValue("0000");
|
||||
monitor.addIllegalValue("000000");
|
||||
|
||||
monitor.process("ABCD");
|
||||
monitor.process("EFGH");
|
||||
monitor.process("0000");
|
||||
monitor.process("0000");
|
||||
monitor.process("ABCD");
|
||||
monitor.reset();
|
||||
|
||||
monitor.process("EFGH");
|
||||
monitor.process("ABCD");
|
||||
monitor.process("ABCD");
|
||||
monitor.process("EFGH");
|
||||
monitor.process("EFGH");
|
||||
monitor.process("000000");
|
||||
monitor.process("000000");
|
||||
monitor.process("000000");
|
||||
monitor.process("000000");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2742,7 +2742,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.PATCH_GROUP_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (pgvcg.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(pgvcg.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -2753,8 +2753,10 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!pgvcg.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case PATCH_GROUP_CHANNEL_GRANT_UPDATE:
|
||||
//Cleanup patch groups - auto-expire any patch groups before we allocate a channel
|
||||
@@ -2773,10 +2775,8 @@ public class P25DecoderState extends DecoderState
|
||||
{
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.PATCH_GROUP_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.details((gvcgu.isEncrypted() ? "ENCRYPTED " : "") +
|
||||
"PATCH UPDATE - GROUP 2:" + gvcgu.getPatchGroupAddress2() +
|
||||
" DN:" + gvcgu.getDownlinkFrequency2())
|
||||
.channel(channel + (gvcgu.isTDMAChannel1() ? " TDMA" : ""))
|
||||
.details((gvcgu.isEncrypted() ? "ENCRYPTED " : ""))
|
||||
.frequency(gvcgu.getDownlinkFrequency1())
|
||||
.to(to)
|
||||
.build();
|
||||
@@ -2785,8 +2785,37 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!gvcgu.isTDMAChannel1())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
|
||||
String channel2 = gvcgu.getChannel2();
|
||||
String to2 = gvcgu.getPatchGroupAddress2();
|
||||
|
||||
if(hasCallEvent(channel2, null, to2))
|
||||
{
|
||||
updateCallEvent(channel2, null, to2);
|
||||
}
|
||||
else
|
||||
{
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.PATCH_GROUP_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel2 + (gvcgu.isTDMAChannel2() ? " TDMA" : ""))
|
||||
.details((gvcgu.isEncrypted() ? "ENCRYPTED " : ""))
|
||||
.frequency(gvcgu.getDownlinkFrequency2())
|
||||
.to(to2)
|
||||
.build();
|
||||
|
||||
registerCallEvent(event);
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
if(!gvcgu.isTDMAChannel2())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel2)));
|
||||
}
|
||||
|
||||
break;
|
||||
case PATCH_GROUP_ADD:
|
||||
PatchGroupAdd pga = (PatchGroupAdd)tsbk;
|
||||
@@ -2844,7 +2873,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.DATA_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (gdcg.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(gdcg.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -2855,7 +2884,7 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
if(!mIgnoreDataCalls)
|
||||
if(!mIgnoreDataCalls && !gdcg.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
@@ -2882,7 +2911,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.GROUP_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (gvcg.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(gvcg.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -2893,8 +2922,10 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!gvcg.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case GROUP_VOICE_CHANNEL_GRANT_UPDATE:
|
||||
GroupVoiceChannelGrantUpdate gvcgu =
|
||||
@@ -2918,8 +2949,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.GROUP_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(gvcgu.getChannel1())
|
||||
.channel(gvcgu.getChannel1() + (gvcgu.isTDMAChannel1() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(gvcgu.getDownlinkFrequency1())
|
||||
.from(from)
|
||||
@@ -2930,8 +2960,10 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!gvcgu.isTDMAChannel1())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
|
||||
if(gvcgu.hasChannelNumber2())
|
||||
{
|
||||
@@ -2952,7 +2984,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event2 = new P25CallEvent.Builder(CallEventType.GROUP_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(gvcgu.getChannel2())
|
||||
.channel(gvcgu.getChannel2() + (gvcgu.isTDMAChannel2() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(gvcgu.getDownlinkFrequency2())
|
||||
.to(gvcgu.getGroupAddress2())
|
||||
@@ -2962,8 +2994,10 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event2);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!gvcgu.isTDMAChannel2())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case GROUP_VOICE_CHANNEL_GRANT_UPDATE_EXPLICIT:
|
||||
@@ -2989,7 +3023,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.GROUP_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (gvcgue.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(gvcgue.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -3000,8 +3034,10 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!gvcgue.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case INDIVIDUAL_DATA_CHANNEL_GRANT:
|
||||
IndividualDataChannelGrant idcg = (IndividualDataChannelGrant)message;
|
||||
@@ -3024,7 +3060,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.DATA_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (idcg.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(idcg.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -3035,10 +3071,9 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
if(!mIgnoreDataCalls)
|
||||
if(!mIgnoreDataCalls && !idcg.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case SNDCP_DATA_CHANNEL_GRANT:
|
||||
@@ -3061,7 +3096,7 @@ public class P25DecoderState extends DecoderState
|
||||
|
||||
P25CallEvent event = new P25CallEvent.Builder(CallEventType.DATA_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (sdcg.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(sdcg.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -3072,15 +3107,13 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
if(!mIgnoreDataCalls)
|
||||
if(!mIgnoreDataCalls && !sdcg.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT:
|
||||
TelephoneInterconnectVoiceChannelGrant tivcg =
|
||||
(TelephoneInterconnectVoiceChannelGrant)message;
|
||||
TelephoneInterconnectVoiceChannelGrant tivcg = (TelephoneInterconnectVoiceChannelGrant)message;
|
||||
|
||||
channel = tivcg.getChannel();
|
||||
from = null;
|
||||
@@ -3104,7 +3137,7 @@ public class P25DecoderState extends DecoderState
|
||||
P25CallEvent event = new P25CallEvent.Builder(
|
||||
CallEventType.TELEPHONE_INTERCONNECT)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (tivcg.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(tivcg.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -3115,15 +3148,15 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!tivcg.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT_UPDATE:
|
||||
TelephoneInterconnectVoiceChannelGrantUpdate tivcgu =
|
||||
(TelephoneInterconnectVoiceChannelGrantUpdate)message;
|
||||
TelephoneInterconnectVoiceChannelGrantUpdate tivcgu = (TelephoneInterconnectVoiceChannelGrantUpdate)message;
|
||||
|
||||
channel = tivcgu.getChannelIdentifier() + "-" +
|
||||
tivcgu.getChannelNumber();
|
||||
channel = tivcgu.getChannelIdentifier() + "-" + tivcgu.getChannelNumber();
|
||||
from = null;
|
||||
|
||||
/* Address is ambiguous and could mean either source or target,
|
||||
@@ -3146,7 +3179,7 @@ public class P25DecoderState extends DecoderState
|
||||
P25CallEvent event = new P25CallEvent.Builder(
|
||||
CallEventType.TELEPHONE_INTERCONNECT)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (tivcgu.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(tivcgu.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -3157,15 +3190,15 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!tivcgu.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT:
|
||||
UnitToUnitVoiceChannelGrant uuvcg =
|
||||
(UnitToUnitVoiceChannelGrant)message;
|
||||
UnitToUnitVoiceChannelGrant uuvcg = (UnitToUnitVoiceChannelGrant)message;
|
||||
|
||||
channel = uuvcg.getChannelIdentifier() + "-" +
|
||||
uuvcg.getChannelNumber();
|
||||
channel = uuvcg.getChannelIdentifier() + "-" + uuvcg.getChannelNumber();
|
||||
from = uuvcg.getSourceAddress();
|
||||
to = uuvcg.getTargetAddress();
|
||||
|
||||
@@ -3184,7 +3217,7 @@ public class P25DecoderState extends DecoderState
|
||||
P25CallEvent event = new P25CallEvent.Builder(
|
||||
CallEventType.UNIT_TO_UNIT_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (uuvcg.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(uuvcg.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -3195,15 +3228,15 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!uuvcg.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
case UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE:
|
||||
UnitToUnitVoiceChannelGrantUpdate uuvcgu =
|
||||
(UnitToUnitVoiceChannelGrantUpdate)message;
|
||||
UnitToUnitVoiceChannelGrantUpdate uuvcgu = (UnitToUnitVoiceChannelGrantUpdate)message;
|
||||
|
||||
channel = uuvcgu.getChannelIdentifier() + "-" +
|
||||
uuvcgu.getChannelNumber();
|
||||
channel = uuvcgu.getChannelIdentifier() + "-" + uuvcgu.getChannelNumber();
|
||||
from = uuvcgu.getSourceAddress();
|
||||
to = uuvcgu.getTargetAddress();
|
||||
|
||||
@@ -3222,7 +3255,7 @@ public class P25DecoderState extends DecoderState
|
||||
P25CallEvent event = new P25CallEvent.Builder(
|
||||
CallEventType.UNIT_TO_UNIT_CALL)
|
||||
.aliasList(getAliasList())
|
||||
.channel(channel)
|
||||
.channel(channel + (uuvcgu.isTDMAChannel() ? " TDMA" : ""))
|
||||
.details(details.toString())
|
||||
.frequency(uuvcgu.getDownlinkFrequency())
|
||||
.from(from)
|
||||
@@ -3233,8 +3266,10 @@ public class P25DecoderState extends DecoderState
|
||||
broadcast(event);
|
||||
}
|
||||
|
||||
broadcast(new TrafficChannelAllocationEvent(this,
|
||||
mChannelCallMap.get(channel)));
|
||||
if(!uuvcgu.isTDMAChannel())
|
||||
{
|
||||
broadcast(new TrafficChannelAllocationEvent(this, mChannelCallMap.get(channel)));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -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;
|
||||
|
||||
public interface IBandIdentifier
|
||||
@@ -29,4 +47,18 @@ public interface IBandIdentifier
|
||||
*/
|
||||
public abstract long getTransmitOffset();
|
||||
|
||||
/**
|
||||
* Downlink (tower to mobile) Frequency for the specified channel
|
||||
*/
|
||||
public abstract long getDownlinkFrequency(int channelNumber);
|
||||
|
||||
/**
|
||||
* Uplink (mobile to tower) Frequency for the specified channel
|
||||
*/
|
||||
public abstract long getUplinkFrequency(int channelNumber);
|
||||
|
||||
/**
|
||||
* Indicates if this band is an FDMA (false) or TDMA (true) band
|
||||
*/
|
||||
public boolean isTDMA();
|
||||
}
|
||||
@@ -1,214 +1,188 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import map.Plottable;
|
||||
import message.Message;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.Alias;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRC;
|
||||
import map.Plottable;
|
||||
import message.Message;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
public class P25Message extends Message
|
||||
{
|
||||
public enum DuplexMode { HALF, FULL };
|
||||
public enum SessionMode { PACKET, CIRCUIT };
|
||||
|
||||
public static final int[] NAC = { 0,1,2,3,4,5,6,7,8,9,10,11 };
|
||||
public static final int[] DUID = { 12,13,14,15 };
|
||||
public static final int[] BCH = { 16,17,18,19,20,21,22,23,24,25,26,27,28,29,
|
||||
30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,
|
||||
54,55,56,57,58,59,60,61,62,63 };
|
||||
|
||||
protected SimpleDateFormat mTimeDurationFormat =
|
||||
new SimpleDateFormat( "HH:mm:ss.SSS");
|
||||
|
||||
protected BinaryMessage mMessage;
|
||||
protected DataUnitID mDUID;
|
||||
protected AliasList mAliasList;
|
||||
|
||||
protected CRC[] mCRC;
|
||||
|
||||
public P25Message( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
{
|
||||
super();
|
||||
|
||||
mMessage = message;
|
||||
mDUID = duid;
|
||||
mAliasList = aliasList;
|
||||
}
|
||||
|
||||
public CRC[] getCRCResults()
|
||||
{
|
||||
return mCRC;
|
||||
}
|
||||
|
||||
public BinaryMessage getSourceMessage()
|
||||
{
|
||||
return mMessage;
|
||||
}
|
||||
|
||||
public AliasList getAliasList()
|
||||
{
|
||||
return mAliasList;
|
||||
}
|
||||
|
||||
public String getNAC()
|
||||
{
|
||||
return mMessage.getHex( NAC, 3 );
|
||||
}
|
||||
|
||||
public DataUnitID getDUID()
|
||||
{
|
||||
return mDUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public enum DuplexMode {HALF, FULL};
|
||||
public enum SessionMode {PACKET, CIRCUIT};
|
||||
|
||||
public static final int[] NAC = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
|
||||
public static final int[] DUID = {12, 13, 14, 15};
|
||||
public static final int[] BCH = {16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
|
||||
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63};
|
||||
|
||||
protected SimpleDateFormat mTimeDurationFormat = new SimpleDateFormat("HH:mm:ss.SSS");
|
||||
|
||||
protected BinaryMessage mMessage;
|
||||
protected DataUnitID mDUID;
|
||||
protected AliasList mAliasList;
|
||||
|
||||
protected CRC[] mCRC;
|
||||
|
||||
public P25Message(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super();
|
||||
|
||||
mMessage = message;
|
||||
mDUID = duid;
|
||||
mAliasList = aliasList;
|
||||
}
|
||||
|
||||
public CRC[] getCRCResults()
|
||||
{
|
||||
return mCRC;
|
||||
}
|
||||
|
||||
public BinaryMessage getSourceMessage()
|
||||
{
|
||||
return mMessage;
|
||||
}
|
||||
|
||||
public AliasList getAliasList()
|
||||
{
|
||||
return mAliasList;
|
||||
}
|
||||
|
||||
public String getNAC()
|
||||
{
|
||||
return mMessage.getHex(NAC, 3);
|
||||
}
|
||||
|
||||
public DataUnitID getDUID()
|
||||
{
|
||||
return mDUID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorStatus()
|
||||
{
|
||||
if( mCRC == null )
|
||||
{
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
return CRC.format( mCRC );
|
||||
if(mCRC == null)
|
||||
{
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
return CRC.format(mCRC);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( "NAC:" );
|
||||
sb.append( getNAC() );
|
||||
sb.append( " " );
|
||||
sb.append( getDUID().getLabel() );
|
||||
sb.append( " DATA UNIT ID:" + mMessage.getInt( DUID ) );
|
||||
|
||||
return sb.toString();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("NAC:");
|
||||
sb.append(getNAC());
|
||||
sb.append(" ");
|
||||
sb.append(getDUID().getLabel());
|
||||
sb.append(" DATA UNIT ID:" + mMessage.getInt(DUID));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getBinaryMessage()
|
||||
{
|
||||
return mMessage.toString();
|
||||
return mMessage.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getProtocol()
|
||||
{
|
||||
return "P25 Phase 1";
|
||||
return "P25 Phase 1";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return mDUID.name();
|
||||
return mDUID.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getFromID()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Alias getFromIDAlias()
|
||||
{
|
||||
if( mAliasList != null )
|
||||
{
|
||||
return mAliasList.getTalkgroupAlias( getFromID() );
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public Alias getFromIDAlias()
|
||||
{
|
||||
if(mAliasList != null)
|
||||
{
|
||||
return mAliasList.getTalkgroupAlias(getFromID());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToID()
|
||||
{
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public Alias getToIDAlias()
|
||||
{
|
||||
if( mAliasList != null )
|
||||
{
|
||||
return mAliasList.getTalkgroupAlias( getToID() );
|
||||
}
|
||||
|
||||
return null;
|
||||
if(mAliasList != null)
|
||||
{
|
||||
return mAliasList.getTalkgroupAlias(getToID());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public Plottable getPlottable()
|
||||
{
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getMessage();
|
||||
return getMessage();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean isValid()
|
||||
{
|
||||
if( mCRC != null )
|
||||
{
|
||||
for( CRC crc: mCRC )
|
||||
{
|
||||
if( crc == CRC.FAILED_CRC )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
if(mCRC != null)
|
||||
{
|
||||
for(CRC crc : mCRC)
|
||||
{
|
||||
if(crc == CRC.FAILED_CRC)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the frequency of the uplink channel using the channel number
|
||||
* and the IdentifierUpdate message.
|
||||
*
|
||||
* @param iden - Identifier Update message
|
||||
* @param channel - channel number
|
||||
* @return - frequency in Hertz
|
||||
*/
|
||||
protected static long calculateUplink( IBandIdentifier iden, int channel )
|
||||
{
|
||||
long downlink = calculateDownlink( iden, channel );
|
||||
|
||||
if( downlink > 0 && iden != null )
|
||||
{
|
||||
return downlink + iden.getTransmitOffset();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the frequency of the downlink channel using the channel number
|
||||
* and the IdentifierUpdate message.
|
||||
*
|
||||
* @param iden - Identifier Update message
|
||||
* @param channel - channel number
|
||||
* @return - frequency in Hertz
|
||||
*/
|
||||
protected static long calculateDownlink( IBandIdentifier iden, int channel )
|
||||
{
|
||||
if( iden != null )
|
||||
{
|
||||
return iden.getBaseFrequency() +
|
||||
( channel * iden.getChannelSpacing() );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IAdjacentSite;
|
||||
@@ -7,142 +25,148 @@ import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class AdjacentSiteStatusBroadcast extends LDU1Message
|
||||
implements IdentifierReceiver, IAdjacentSite
|
||||
public class AdjacentSiteStatusBroadcast extends LDU1Message implements IdentifierReceiver, IAdjacentSite
|
||||
{
|
||||
public static final int[] LRA = { 364,365,366,367,372,373,374,375 };
|
||||
public static final int[] SYSTEM_ID = { 384,385,386,387,536,537,538,539,540,
|
||||
541,546,547 };
|
||||
public static final int[] RFSS_ID = { 548,549,550,551,556,557,558,559 };
|
||||
public static final int[] SITE_ID = { 560,561,566,567,568,569,570,571 };
|
||||
public static final int[] IDENTIFIER = { 720,721,722,723 };
|
||||
public static final int[] CHANNEL = { 724,725,730,731,732,733,734,735,740,
|
||||
741,742,743 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 744,745,750,751,752,753,
|
||||
754,755 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public AdjacentSiteStatusBroadcast( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
public static final int[] LRA = {364, 365, 366, 367, 372, 373, 374, 375};
|
||||
public static final int[] SYSTEM_ID = {384, 385, 386, 387, 536, 537, 538, 539, 540, 541, 546, 547};
|
||||
public static final int[] RFSS_ID = {548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] SITE_ID = {560, 561, 566, 567, 568, 569, 570, 571};
|
||||
public static final int[] IDENTIFIER = {720, 721, 722, 723};
|
||||
public static final int[] CHANNEL = {724, 725, 730, 731, 732, 733, 734, 735, 740, 741, 742, 743};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {744, 745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public AdjacentSiteStatusBroadcast(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.ADJACENT_SITE_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLRA() );
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( " SYS:" + getSystemID() );
|
||||
|
||||
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN:" + getChannel() );
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLRA());
|
||||
|
||||
sb.append(" SYS:" + getSystemID());
|
||||
|
||||
sb.append(" SITE:" + getRFSS() + "-" + getSiteID());
|
||||
|
||||
sb.append(" CHAN:" + getChannel());
|
||||
|
||||
sb.append(" " + getSystemServiceClass());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
sb.append( " " + getSystemServiceClass() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getUniqueID()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getSystemID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getRFSS() );
|
||||
sb.append( ":" );
|
||||
sb.append( getSiteID() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLRA()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return SystemService.toString( mMessage.getInt( SYSTEM_SERVICE_CLASS ) );
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
sb.append(getSystemID());
|
||||
sb.append(":");
|
||||
sb.append(getRFSS());
|
||||
sb.append(":");
|
||||
sb.append(getSiteID());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLRA()
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return SystemService.toString(mMessage.getInt(SYSTEM_SERVICE_CLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
|
||||
identifiers[0] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IAdjacentSite;
|
||||
@@ -6,154 +24,160 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class AdjacentSiteStatusBroadcastExplicit extends LDU1Message
|
||||
implements IdentifierReceiver, IAdjacentSite
|
||||
public class AdjacentSiteStatusBroadcastExplicit extends LDU1Message implements IdentifierReceiver, IAdjacentSite
|
||||
{
|
||||
public static final int[] LRA = { 364,365,366,367,372,373,374,375 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 376,377,382,383 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 384,385,386,387,536,537,538,
|
||||
539,540,541,546,547 };
|
||||
public static final int[] RFSS_ID = { 548,549,550,551,556,557,558,559 };
|
||||
public static final int[] SITE_ID = { 560,561,566,567,568,569,570,571 };
|
||||
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 720,721,722,723 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 724,725,730,731,732,733,734,
|
||||
735,740,741,742,743 };
|
||||
|
||||
private IBandIdentifier mTransmitBand;
|
||||
private IBandIdentifier mReceiveBand;
|
||||
|
||||
public AdjacentSiteStatusBroadcastExplicit( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
public static final int[] LRA = {364, 365, 366, 367, 372, 373, 374, 375};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {376, 377, 382, 383};
|
||||
public static final int[] TRANSMIT_CHANNEL = {384, 385, 386, 387, 536, 537, 538, 539, 540, 541, 546, 547};
|
||||
public static final int[] RFSS_ID = {548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] SITE_ID = {560, 561, 566, 567, 568, 569, 570, 571};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {720, 721, 722, 723};
|
||||
public static final int[] RECEIVE_CHANNEL = {724, 725, 730, 731, 732, 733, 734, 735, 740, 741, 742, 743};
|
||||
|
||||
private IBandIdentifier mTransmitBand;
|
||||
private IBandIdentifier mReceiveBand;
|
||||
|
||||
public AdjacentSiteStatusBroadcastExplicit(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.ADJACENT_SITE_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLRA() );
|
||||
|
||||
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " DNLINK:" + getDownlinkChannel() );
|
||||
|
||||
sb.append( " UPLINK:" + getUplinkChannel() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLRA());
|
||||
|
||||
sb.append(" SITE:" + getRFSS() + "-" + getSiteID());
|
||||
|
||||
sb.append(" DNLINK:" + getDownlinkChannel());
|
||||
|
||||
sb.append(" UPLINK:" + getUplinkChannel());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getUniqueID()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getSystemID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getRFSS() );
|
||||
sb.append( ":" );
|
||||
sb.append( getSiteID() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLRA()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return "***";
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannel();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannel();
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@Override
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return "[]";
|
||||
}
|
||||
sb.append(getSystemID());
|
||||
sb.append(":");
|
||||
sb.append(getRFSS());
|
||||
sb.append(":");
|
||||
sb.append(getSiteID());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLRA()
|
||||
{
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return "***";
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannel();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return "[]";
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitBand, getTransmitChannel() );
|
||||
if(mTransmitBand != null)
|
||||
{
|
||||
return mTransmitBand.getDownlinkFrequency(getTransmitChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveBand, getReceiveChannel() );
|
||||
if(mReceiveBand != null)
|
||||
{
|
||||
return mReceiveBand.getUplinkFrequency(getReceiveChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitBand = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveBand = message;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitBand = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveBand = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,83 +1,118 @@
|
||||
/*******************************************************************************
|
||||
* 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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class ChannelIdentifierUpdate extends LDU1Message
|
||||
implements IBandIdentifier
|
||||
public class ChannelIdentifierUpdate extends LDU1Message implements IBandIdentifier
|
||||
{
|
||||
public static final int[] IDENTIFIER = { 364,365,366,367 };
|
||||
public static final int[] BANDWIDTH = { 372,373,374,375,376,377,382,383,384 };
|
||||
public static final int[] TRANSMIT_OFFSET = { 385,386,387,536,537,538,539,
|
||||
540,541 };
|
||||
public static final int[] CHANNEL_SPACING = { 546,547,548,549,550,551,556,
|
||||
557,558,559 };
|
||||
public static final int[] BASE_FREQUENCY = { 560,561,566,567,568,569,570,
|
||||
571,720,721,722,723,724,725,730,731,732,733,734,735,740,741,742,743,744,
|
||||
745,750,751,752,753,754,755 };
|
||||
public static final int[] IDENTIFIER = {364, 365, 366, 367};
|
||||
public static final int[] BANDWIDTH = {372, 373, 374, 375, 376, 377, 382, 383, 384};
|
||||
public static final int[] TRANSMIT_OFFSET = {385, 386, 387, 536, 537, 538, 539,
|
||||
540, 541};
|
||||
public static final int[] CHANNEL_SPACING = {546, 547, 548, 549, 550, 551, 556,
|
||||
557, 558, 559};
|
||||
public static final int[] BASE_FREQUENCY = {560, 561, 566, 567, 568, 569, 570,
|
||||
571, 720, 721, 722, 723, 724, 725, 730, 731, 732, 733, 734, 735, 740, 741, 742, 743, 744,
|
||||
745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
public ChannelIdentifierUpdate(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ChannelIdentifierUpdate( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.CHANNEL_IDENTIFIER_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " IDEN:" + getIdentifier() );
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( " BASE:" + getBaseFrequency() );
|
||||
|
||||
sb.append( " BW:" + getBandwidth() );
|
||||
|
||||
sb.append( " SPACING:" + getChannelSpacing() );
|
||||
|
||||
sb.append( " OFFSET:" + getTransmitOffset() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
sb.append(getMessageStub());
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
sb.append(" IDEN:" + getIdentifier());
|
||||
|
||||
/**
|
||||
sb.append(" BASE:" + getBaseFrequency());
|
||||
|
||||
sb.append(" BW:" + getBandwidth());
|
||||
|
||||
sb.append(" SPACING:" + getChannelSpacing());
|
||||
|
||||
sb.append(" OFFSET:" + getTransmitOffset());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel bandwidth in hertz
|
||||
*/
|
||||
@Override
|
||||
public int getBandwidth()
|
||||
{
|
||||
return mMessage.getInt( BANDWIDTH ) * 125;
|
||||
return mMessage.getInt(BANDWIDTH) * 125;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getChannelSpacing()
|
||||
{
|
||||
return mMessage.getLong( CHANNEL_SPACING ) * 125l;
|
||||
return mMessage.getLong(CHANNEL_SPACING) * 125l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBaseFrequency()
|
||||
{
|
||||
return mMessage.getLong( BASE_FREQUENCY ) * 5l;
|
||||
return mMessage.getLong(BASE_FREQUENCY) * 5l;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public long getTransmitOffset()
|
||||
{
|
||||
return -1 * mMessage.getLong( TRANSMIT_OFFSET ) * 250000l;
|
||||
return -1 * mMessage.getLong(TRANSMIT_OFFSET) * 250000l;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,7 @@ import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class ChannelIdentifierUpdateExplicit extends LDU1Message
|
||||
implements IBandIdentifier
|
||||
public class ChannelIdentifierUpdateExplicit extends LDU1Message implements IBandIdentifier
|
||||
{
|
||||
public static final int[] IDENTIFIER = { 364,365,366,367 };
|
||||
public static final int[] BANDWIDTH = { 372,373,374,375 };
|
||||
@@ -80,4 +79,22 @@ public class ChannelIdentifierUpdateExplicit extends LDU1Message
|
||||
{
|
||||
return -1 * mMessage.getLong( TRANSMIT_OFFSET ) * 250000l;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -5,156 +23,167 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupVoiceChannelUpdate extends LDU1Message
|
||||
implements IdentifierReceiver
|
||||
public class GroupVoiceChannelUpdate extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupVoiceChannelUpdate.class );
|
||||
public static final int[] IDENTIFIER_A = {364, 365, 366, 367};
|
||||
public static final int[] CHANNEL_A = {372, 373, 374, 375, 376, 377, 382, 383, 384, 385, 386, 387};
|
||||
public static final int[] GROUP_ADDRESS_A = {536, 537, 538, 539, 540, 541, 546, 547, 548, 549, 550, 551, 556, 557,
|
||||
558, 559};
|
||||
public static final int[] IDENTIFIER_B = {560, 561, 566, 567};
|
||||
public static final int[] CHANNEL_B = {568, 569, 570, 571, 720, 721, 722, 723, 724, 725, 730, 731};
|
||||
public static final int[] GROUP_ADDRESS_B = {732, 733, 734, 735, 740, 741, 742, 743, 744, 745, 750, 751, 752, 753,
|
||||
754, 755};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdateA;
|
||||
private IBandIdentifier mIdentifierUpdateB;
|
||||
|
||||
public GroupVoiceChannelUpdate(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
public static final int[] IDENTIFIER_A = { 364,365,366,367 };
|
||||
public static final int[] CHANNEL_A = { 372,373,374,375,376,377,382,383,384,
|
||||
385,386,387 };
|
||||
public static final int[] GROUP_ADDRESS_A = { 536,537,538,539,540,541,546,
|
||||
547,548,549,550,551,556,557,558,559 };
|
||||
public static final int[] IDENTIFIER_B = { 560,561,566,567 };
|
||||
public static final int[] CHANNEL_B = { 568,569,570,571,720,721,722,723,724,
|
||||
725,730,731 };
|
||||
public static final int[] GROUP_ADDRESS_B = { 732,733,734,735,740,741,742,
|
||||
743,744,745,750,751,752,753,754,755 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdateA;
|
||||
private IBandIdentifier mIdentifierUpdateB;
|
||||
|
||||
public GroupVoiceChannelUpdate( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_VOICE_CHANNEL_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " CHAN A:" + getChannelA() );
|
||||
|
||||
sb.append( " GRP A:" + getGroupAddressA() );
|
||||
|
||||
if( hasChannelB() )
|
||||
{
|
||||
sb.append( " CHAN B:" + getChannelA() );
|
||||
|
||||
sb.append( " GRP B:" + getGroupAddressA() );
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" CHAN A:" + getChannelA());
|
||||
|
||||
sb.append(" GRP A:" + getGroupAddressA());
|
||||
|
||||
if(hasChannelB())
|
||||
{
|
||||
sb.append(" CHAN B:" + getChannelA());
|
||||
|
||||
sb.append(" GRP B:" + getGroupAddressA());
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public int getChannelIdentifierA()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_A);
|
||||
}
|
||||
|
||||
public int getChannelIdentifierA()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_A );
|
||||
}
|
||||
|
||||
public int getChannelNumberA()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_A );
|
||||
return mMessage.getInt(CHANNEL_A);
|
||||
}
|
||||
|
||||
|
||||
public String getChannelA()
|
||||
{
|
||||
return getChannelIdentifierA() + "-" + getChannelNumberA();
|
||||
return getChannelIdentifierA() + "-" + getChannelNumberA();
|
||||
}
|
||||
|
||||
public int getChannelIdentifierB()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_B );
|
||||
}
|
||||
|
||||
|
||||
public int getChannelIdentifierB()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_B);
|
||||
}
|
||||
|
||||
public int getChannelNumberB()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_B );
|
||||
return mMessage.getInt(CHANNEL_B);
|
||||
}
|
||||
|
||||
|
||||
public String getChannelB()
|
||||
{
|
||||
return getChannelIdentifierB() + "-" + getChannelNumberB();
|
||||
return getChannelIdentifierB() + "-" + getChannelNumberB();
|
||||
}
|
||||
|
||||
|
||||
public boolean hasChannelB()
|
||||
{
|
||||
return getChannelNumberB() != 0;
|
||||
return getChannelNumberB() != 0;
|
||||
}
|
||||
|
||||
|
||||
public String getGroupAddressA()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_A, 4 );
|
||||
return mMessage.getHex(GROUP_ADDRESS_A, 4);
|
||||
}
|
||||
|
||||
public String getGroupAddressB()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_B, 4 );
|
||||
return mMessage.getHex(GROUP_ADDRESS_B, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if( identifier == getChannelIdentifierA() )
|
||||
{
|
||||
mIdentifierUpdateA = message;
|
||||
}
|
||||
if( identifier == getChannelIdentifierB() )
|
||||
{
|
||||
mIdentifierUpdateB = message;
|
||||
}
|
||||
if(identifier == getChannelIdentifierA())
|
||||
{
|
||||
mIdentifierUpdateA = message;
|
||||
}
|
||||
if(identifier == getChannelIdentifierB())
|
||||
{
|
||||
mIdentifierUpdateB = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
if( hasChannelB() )
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
identifiers[ 0 ] = getChannelIdentifierA();
|
||||
identifiers[ 1 ] = getChannelIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
identifiers[ 0 ] = getChannelIdentifierA();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
if(hasChannelB())
|
||||
{
|
||||
int[] identifiers = new int[2];
|
||||
identifiers[0] = getChannelIdentifierA();
|
||||
identifiers[1] = getChannelIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] identifiers = new int[1];
|
||||
identifiers[0] = getChannelIdentifierA();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyA()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateA, getChannelNumberA() );
|
||||
if(mIdentifierUpdateA != null)
|
||||
{
|
||||
return mIdentifierUpdateA.getDownlinkFrequency(getChannelNumberA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyA()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateA, getChannelNumberA() );
|
||||
if(mIdentifierUpdateA != null)
|
||||
{
|
||||
return mIdentifierUpdateA.getUplinkFrequency(getChannelNumberA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyB()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateB, getChannelNumberA() );
|
||||
if(mIdentifierUpdateB != null)
|
||||
{
|
||||
return mIdentifierUpdateB.getDownlinkFrequency(getChannelNumberB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyB()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateB, getChannelNumberA() );
|
||||
if(mIdentifierUpdateB != null)
|
||||
{
|
||||
return mIdentifierUpdateB.getUplinkFrequency(getChannelNumberB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -5,151 +23,149 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupVoiceChannelUpdateExplicit extends LDU1Message
|
||||
implements IdentifierReceiver
|
||||
public class GroupVoiceChannelUpdateExplicit extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupVoiceChannelUpdateExplicit.class );
|
||||
|
||||
public static final int EMERGENCY_FLAG = 376;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 377;
|
||||
public static final int DUPLEX_MODE = 382;
|
||||
public static final int SESSION_MODE = 383;
|
||||
public static final int[] GROUP_ADDRESS = { 536,537,538,539,540,541,546,547,
|
||||
548,549,550,551,556,557,558,559 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 560,561,566,567 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 568,569,570,571,720,721,722,
|
||||
723,724,725,730,731 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 732,733,734,735 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 740,741,742,743,744,745,750,
|
||||
751,752,753,754,755 };
|
||||
public static final int[] GROUP_ADDRESS = {536, 537, 538, 539, 540, 541, 546, 547, 548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {560, 561, 566, 567};
|
||||
public static final int[] TRANSMIT_CHANNEL = {568, 569, 570, 571, 720, 721, 722, 723, 724, 725, 730, 731};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {732, 733, 734, 735};
|
||||
public static final int[] RECEIVE_CHANNEL = {740, 741, 742, 743, 744, 745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupVoiceChannelUpdateExplicit(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupVoiceChannelUpdateExplicit( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_VOICE_CHANNEL_UPDATE_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
if( isEncryptedChannel() )
|
||||
{
|
||||
sb.append( " ENCRYPTED CHANNEL" );
|
||||
}
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
if(isEncryptedChannel())
|
||||
{
|
||||
sb.append(" ENCRYPTED CHANNEL");
|
||||
}
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex(GROUP_ADDRESS, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitChannelIdentifier();
|
||||
identifiers[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitChannelIdentifier();
|
||||
identifiers[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate,
|
||||
getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate,
|
||||
getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -6,105 +24,106 @@ import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
import module.decode.p25.reference.Service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class NetworkStatusBroadcast extends LDU1Message
|
||||
implements IdentifierReceiver
|
||||
public class NetworkStatusBroadcast extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( NetworkStatusBroadcast.class );
|
||||
public static final int[] NETWORK_ID = { 376,377,382,383,384,385,386,387,
|
||||
536,537,538,539,540,541,546,547,548,549,550,551 };
|
||||
public static final int[] SYSTEM_ID = { 556,557,558,559,560,561,566,567,568,
|
||||
569,570,571 };
|
||||
public static final int[] IDENTIFIER = { 720,721,722,723 };
|
||||
public static final int[] CHANNEL = { 724,725,730,731,732,733,734,735,740,
|
||||
741,742,743 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 744,745,750,751,752,753,
|
||||
754,755 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcast( LDU1Message source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
public static final int[] NETWORK_ID = {376, 377, 382, 383, 384, 385, 386, 387, 536, 537, 538, 539, 540, 541, 546,
|
||||
547, 548, 549, 550, 551};
|
||||
public static final int[] SYSTEM_ID = {556, 557, 558, 559, 560, 561, 566, 567, 568, 569, 570, 571};
|
||||
public static final int[] IDENTIFIER = {720, 721, 722, 723};
|
||||
public static final int[] CHANNEL = {724, 725, 730, 731, 732, 733, 734, 735, 740, 741, 742, 743};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {744, 745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcast(LDU1Message source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.NETWORK_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " NETWORK:" + getNetworkID() );
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
sb.append( " CHAN:" + getChannel() );
|
||||
sb.append( " " + Service.getServices( getSystemServiceClass() ).toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getNetworkID()
|
||||
{
|
||||
return mMessage.getHex( NETWORK_ID, 5 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" NETWORK:" + getNetworkID());
|
||||
sb.append(" SYS:" + getSystem());
|
||||
sb.append(" CHAN:" + getChannel());
|
||||
sb.append(" " + Service.getServices(getSystemServiceClass()).toString());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNetworkID()
|
||||
{
|
||||
return mMessage.getHex(NETWORK_ID, 5);
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
|
||||
identifiers[0] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,131 +1,150 @@
|
||||
/*******************************************************************************
|
||||
* 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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class NetworkStatusBroadcastExplicit extends LDU1Message
|
||||
implements IdentifierReceiver
|
||||
public class NetworkStatusBroadcastExplicit extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( NetworkStatusBroadcastExplicit.class );
|
||||
public static final int[] NETWORK_ID = { 364,365,366,367,372,373,374,375,
|
||||
376,377,382,383,384,385,386,387,536,537,538,539 };
|
||||
public static final int[] SYSTEM_ID = { 540,541,546,547,548,549,550,551,556,
|
||||
557,558,559 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 560,561,566,567 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 568,569,570,571,720,721,722,
|
||||
723,724,725,730,731 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 732,733,734,735 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 740,741,742,743,744,745,750,
|
||||
751,752,753,754,755 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcastExplicit( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
public static final int[] NETWORK_ID = {364, 365, 366, 367, 372, 373, 374, 375, 376, 377, 382, 383, 384, 385, 386,
|
||||
387, 536, 537, 538, 539};
|
||||
public static final int[] SYSTEM_ID = {540, 541, 546, 547, 548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {560, 561, 566, 567};
|
||||
public static final int[] TRANSMIT_CHANNEL = {568, 569, 570, 571, 720, 721, 722, 723, 724, 725, 730, 731};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {732, 733, 734, 735};
|
||||
public static final int[] RECEIVE_CHANNEL = {740, 741, 742, 743, 744, 745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcastExplicit(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.NETWORK_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " NETWORK:" + getNetworkID() );
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
sb.append( " TRANSMIT:" + getTransmitChannel() );
|
||||
sb.append( " RECEIVE:" + getReceiveChannel() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getNetworkID()
|
||||
{
|
||||
return mMessage.getHex( NETWORK_ID, 5 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" NETWORK:" + getNetworkID());
|
||||
sb.append(" SYS:" + getSystem());
|
||||
sb.append(" TRANSMIT:" + getTransmitChannel());
|
||||
sb.append(" RECEIVE:" + getReceiveChannel());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNetworkID()
|
||||
{
|
||||
return mMessage.getHex(NETWORK_ID, 5);
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate,
|
||||
getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate,
|
||||
getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -6,125 +24,124 @@ import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RFSSStatusBroadcast extends LDU1Message
|
||||
implements IdentifierReceiver
|
||||
public class RFSSStatusBroadcast extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( RFSSStatusBroadcast.class );
|
||||
public static final int[] LRA = {364, 365, 366, 367, 372, 373, 374, 375};
|
||||
public static final int[] SYSTEM_ID = {384, 385, 386, 387, 536, 537, 538, 539, 540, 541, 546, 547};
|
||||
public static final int[] RFSS_ID = {548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] SITE_ID = {560, 561, 566, 567, 568, 569, 570, 571};
|
||||
public static final int[] IDENTIFIER = {720, 721, 722, 723};
|
||||
public static final int[] CHANNEL = {724, 725, 730, 731, 732, 733, 734, 735, 740, 741, 742, 743};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {744, 745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcast(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
public static final int[] LRA = { 364,365,366,367,372,373,374,375 };
|
||||
public static final int[] SYSTEM_ID = { 384,385,386,387,536,537,538,539,540,
|
||||
541,546,547 };
|
||||
public static final int[] RFSS_ID = { 548,549,550,551,556,557,558,559 };
|
||||
public static final int[] SITE_ID = { 560,561,566,567,568,569,570,571 };
|
||||
public static final int[] IDENTIFIER = { 720,721,722,723 };
|
||||
public static final int[] CHANNEL = { 724,725,730,731,732,733,734,735,740,
|
||||
741,742,743 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 744,745,750,751,752,753,
|
||||
754,755 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcast( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.RFSS_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN:" + getChannelNumber() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
sb.append( " " + mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLocationRegistrationArea());
|
||||
|
||||
sb.append(" SYS:" + getSystem());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" CHAN:" + getChannelNumber());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
sb.append(" " + mMessage.toString());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
|
||||
identifiers[0] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -5,146 +23,148 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RFSSStatusBroadcastExplicit extends LDU1Message
|
||||
implements IdentifierReceiver
|
||||
public class RFSSStatusBroadcastExplicit extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( RFSSStatusBroadcastExplicit.class );
|
||||
public static final int[] LRA = {364, 365, 366, 367, 372, 373, 374, 375};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {376, 377, 382, 383};
|
||||
public static final int[] RECEIVE_CHANNEL = {384, 385, 386, 387, 536, 537, 538, 539, 540, 541, 546, 547};
|
||||
public static final int[] RFSS_ID = {548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] SITE_ID = {560, 561, 566, 567, 568, 569, 570, 571};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {720, 721, 722, 723};
|
||||
public static final int[] TRANSMIT_CHANNEL = {724, 725, 730, 731, 732, 733, 734, 735, 740, 741, 742, 743};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {744, 745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
public static final int[] LRA = { 364,365,366,367,372,373,374,375 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 376,377,382,383 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 384,385,386,387,536,537,538,
|
||||
539,540,541,546,547 };
|
||||
public static final int[] RFSS_ID = { 548,549,550,551,556,557,558,559 };
|
||||
public static final int[] SITE_ID = { 560,561,566,567,568,569,570,571 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 720,721,722,723 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 724,725,730,731,732,733,734,
|
||||
735,740,741,742,743 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 744,745,750,751,752,753,754,755 };
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcastExplicit(LDU1Message source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcastExplicit( LDU1Message source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.RFSS_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " TRANSMIT:" + getTransmitChannelNumber() );
|
||||
|
||||
sb.append( " RECEIVE:" + getReceiveChannelNumber() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
sb.append( " " + mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLocationRegistrationArea());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" TRANSMIT:" + getTransmitChannelNumber());
|
||||
|
||||
sb.append(" RECEIVE:" + getReceiveChannelNumber());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
sb.append(" " + mMessage.toString());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -6,151 +24,162 @@ import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SecondaryControlChannelBroadcast extends LDU1Message
|
||||
implements IdentifierReceiver
|
||||
public class SecondaryControlChannelBroadcast extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SecondaryControlChannelBroadcast.class );
|
||||
public static final int[] RFSS_ID = {364, 365, 366, 367, 372, 373, 374, 375};
|
||||
public static final int[] SITE_ID = {376, 377, 382, 383, 384, 385, 386, 387};
|
||||
public static final int[] IDENTIFIER_A = {536, 537, 538, 539};
|
||||
public static final int[] CHANNEL_A = {540, 541, 546, 547, 548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_A = {560, 561, 566, 567, 568, 569, 570, 571};
|
||||
public static final int[] IDENTIFIER_B = {720, 721, 722, 723};
|
||||
public static final int[] CHANNEL_B = {724, 725, 730, 731, 732, 733, 734, 735, 740, 741, 742, 743};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_B = {744, 745, 750, 751, 752, 753, 754, 755};
|
||||
|
||||
public static final int[] RFSS_ID = { 364,365,366,367,372,373,374,375 };
|
||||
public static final int[] SITE_ID = { 376,377,382,383,384,385,386,387 };
|
||||
public static final int[] IDENTIFIER_A = { 536,537,538,539 };
|
||||
public static final int[] CHANNEL_A = { 540,541,546,547,548,549,550,551,
|
||||
556,557,558,559 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_A = { 560,561,566,567,568,569,570,571 };
|
||||
public static final int[] IDENTIFIER_B = { 720,721,722,723 };
|
||||
public static final int[] CHANNEL_B = { 724,725,730,731,732,733,734,735,740,
|
||||
741,742,743 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_B = { 744,745,750,751,752,753,754,755 };
|
||||
private IBandIdentifier mIdentifierProviderA;
|
||||
private IBandIdentifier mIdentifierProviderB;
|
||||
|
||||
public SecondaryControlChannelBroadcast(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
private IBandIdentifier mIdentifierProviderA;
|
||||
private IBandIdentifier mIdentifierProviderB;
|
||||
|
||||
public SecondaryControlChannelBroadcast( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.SECONDARY_CONTROL_CHANNEL_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN A:" + getChannelA() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClassA() ) );
|
||||
|
||||
sb.append( " CHAN B:" + getChannelB() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClassB() ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifierA()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_A );
|
||||
}
|
||||
|
||||
public int getChannelA()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_A );
|
||||
}
|
||||
|
||||
public String getChannelNumberA()
|
||||
{
|
||||
return getIdentifierA() + "-" + getChannelA();
|
||||
}
|
||||
|
||||
public int getIdentifierB()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_B );
|
||||
}
|
||||
|
||||
public int getChannelB()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_B );
|
||||
}
|
||||
|
||||
public String getChannelNumberB()
|
||||
{
|
||||
return getIdentifierB() + "-" + getChannelB();
|
||||
}
|
||||
|
||||
public int getSystemServiceClassA()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS_A );
|
||||
}
|
||||
|
||||
public int getSystemServiceClassB()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS_B );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getIdentifierA() )
|
||||
{
|
||||
mIdentifierProviderA = message;
|
||||
}
|
||||
if( identifier == getIdentifierB() )
|
||||
{
|
||||
mIdentifierProviderB = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" CHAN A:" + getChannelA());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClassA()));
|
||||
|
||||
sb.append(" CHAN B:" + getChannelB());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClassB()));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getIdentifierA()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_A);
|
||||
}
|
||||
|
||||
public int getChannelA()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL_A);
|
||||
}
|
||||
|
||||
public String getChannelNumberA()
|
||||
{
|
||||
return getIdentifierA() + "-" + getChannelA();
|
||||
}
|
||||
|
||||
public int getIdentifierB()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_B);
|
||||
}
|
||||
|
||||
public int getChannelB()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL_B);
|
||||
}
|
||||
|
||||
public String getChannelNumberB()
|
||||
{
|
||||
return getIdentifierB() + "-" + getChannelB();
|
||||
}
|
||||
|
||||
public int getSystemServiceClassA()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS_A);
|
||||
}
|
||||
|
||||
public int getSystemServiceClassB()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS_B);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getIdentifierA())
|
||||
{
|
||||
mIdentifierProviderA = message;
|
||||
}
|
||||
if(identifier == getIdentifierB())
|
||||
{
|
||||
mIdentifierProviderB = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifierA();
|
||||
identifiers[ 1 ] = getIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getIdentifierA();
|
||||
identifiers[1] = getIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequencyA()
|
||||
{
|
||||
return calculateDownlink( mIdentifierProviderA, getChannelA() );
|
||||
if(mIdentifierProviderA != null)
|
||||
{
|
||||
return mIdentifierProviderA.getDownlinkFrequency(getChannelA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyA()
|
||||
{
|
||||
return calculateUplink( mIdentifierProviderA, getChannelA() );
|
||||
if(mIdentifierProviderA != null)
|
||||
{
|
||||
return mIdentifierProviderA.getUplinkFrequency(getChannelA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequencyB()
|
||||
{
|
||||
return calculateDownlink( mIdentifierProviderB, getChannelB() );
|
||||
if(mIdentifierProviderB != null)
|
||||
{
|
||||
return mIdentifierProviderB.getDownlinkFrequency(getChannelB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyB()
|
||||
{
|
||||
return calculateUplink( mIdentifierProviderB, getChannelB() );
|
||||
if(mIdentifierProviderB != null)
|
||||
{
|
||||
return mIdentifierProviderB.getUplinkFrequency(getChannelB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ldu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -6,136 +24,134 @@ import module.decode.p25.message.ldu.LDU1Message;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SecondaryControlChannelBroadcastExplicit
|
||||
extends LDU1Message implements IdentifierReceiver
|
||||
public class SecondaryControlChannelBroadcastExplicit extends LDU1Message implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SecondaryControlChannelBroadcastExplicit.class );
|
||||
public static final int[] RFSS_ID = {364, 365, 366, 367, 372, 373, 374, 375};
|
||||
public static final int[] SITE_ID = {376, 377, 382, 383, 384, 385, 386, 387};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {536, 537, 538, 539};
|
||||
public static final int[] TRANSMIT_CHANNEL = {540, 541, 546, 547, 548, 549, 550, 551, 556, 557, 558, 559};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {560, 561, 566, 567};
|
||||
public static final int[] RECEIVE_CHANNEL = {568, 569, 570, 571, 720, 721, 722, 723, 724, 725, 730, 731};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {732, 733, 734, 735, 740, 741, 742, 743};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierProvider;
|
||||
private IBandIdentifier mReceiveIdentifierProvider;
|
||||
|
||||
public SecondaryControlChannelBroadcastExplicit(LDU1Message message)
|
||||
{
|
||||
super(message);
|
||||
}
|
||||
|
||||
public static final int[] RFSS_ID = { 364,365,366,367,372,373,374,375 };
|
||||
public static final int[] SITE_ID = { 376,377,382,383,384,385,386,387 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 536,537,538,539 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 540,541,546,547,548,549,550,
|
||||
551,556,557,558,559 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 560,561,566,567 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 568,569,570,571,720,721,722,
|
||||
723,724,725,730,731 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 732,733,734,735,740,741,
|
||||
742,743 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierProvider;
|
||||
private IBandIdentifier mReceiveIdentifierProvider;
|
||||
|
||||
public SecondaryControlChannelBroadcastExplicit( LDU1Message message )
|
||||
{
|
||||
super( message );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.SECONDARY_CONTROL_CHANNEL_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " TRANSMIT:" + getTransmitChannel() );
|
||||
|
||||
sb.append( " RECEIVE:" + getReceiveChannel() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierProvider = message;
|
||||
}
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierProvider = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" TRANSMIT:" + getTransmitChannel());
|
||||
|
||||
sb.append(" RECEIVE:" + getReceiveChannel());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierProvider = message;
|
||||
}
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierProvider = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierProvider,
|
||||
getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierProvider != null)
|
||||
{
|
||||
return mTransmitIdentifierProvider.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierProvider,
|
||||
getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierProvider != null)
|
||||
{
|
||||
return mReceiveIdentifierProvider.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,199 +1,220 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
|
||||
public abstract class UnitToUnitChannelGrantExtended extends PDUMessage
|
||||
implements IdentifierReceiver
|
||||
public abstract class UnitToUnitChannelGrantExtended extends PDUMessage implements IdentifierReceiver
|
||||
{
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 128;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 129;
|
||||
public static final int DUPLEX_MODE = 130;
|
||||
public static final int SESSION_MODE = 131;
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = { 88,89,90,91,92,93,94,95,96,97,
|
||||
98,99,100,101,102,103,104,105,106,107,108,109,110,111 };
|
||||
public static final int[] SERVICE_OPTIONS = { 128,129,130,131,132,133,134,
|
||||
135 };
|
||||
public static final int[] SOURCE_WACN = { 160,161,162,163,164,165,166,167,
|
||||
168,169,170,171,172,173,174,175,176,177,178,179 };
|
||||
public static final int[] SOURCE_SYSTEM_ID = { 180,181,182,183,184,185,186,
|
||||
187,188,189,190,191 };
|
||||
public static final int[] SOURCE_ID = { 192,193,194,195,196,197,198,199,200,
|
||||
201,202,203,204,205,206,207,208,209,210,211,212,213,214,215 };
|
||||
public static final int[] TARGET_ADDRESS = { 216,217,218,219,220,221,222,
|
||||
223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 240,241,242,243 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 244,245,246,247,248,249,250,
|
||||
251,252,253,254,255 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 256,257,258,259 };
|
||||
public static final int[] RECEIVE_NUMBER = { 260,261,262,263,264,265,266,
|
||||
267,268,269,270,271 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 320,321,322,323,324,325,
|
||||
326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,
|
||||
343,344,345,346,347,348,349,350,351 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public UnitToUnitChannelGrantExtended( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
|
||||
105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] SERVICE_OPTIONS = {128, 129, 130, 131, 132, 133, 134, 135};
|
||||
public static final int[] SOURCE_WACN = {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
|
||||
175, 176, 177, 178, 179};
|
||||
public static final int[] SOURCE_SYSTEM_ID = {180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191};
|
||||
public static final int[] SOURCE_ID = {192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
|
||||
207, 208, 209, 210, 211, 212, 213, 214, 215};
|
||||
public static final int[] TARGET_ADDRESS = {216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
|
||||
230, 231, 232, 233, 234, 235, 236, 237, 238, 239};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {240, 241, 242, 243};
|
||||
public static final int[] TRANSMIT_NUMBER = {244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {256, 257, 258, 259};
|
||||
public static final int[] RECEIVE_NUMBER = {260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
|
||||
333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public UnitToUnitChannelGrantExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU2( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU2(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " FROM ADDR:" );
|
||||
sb.append( getSourceAddress() );
|
||||
|
||||
sb.append( " ID:" );
|
||||
sb.append( getSourceID() );
|
||||
|
||||
sb.append( " TO:" );
|
||||
sb.append( getTargetAddress() );
|
||||
|
||||
sb.append( " WACN:" );
|
||||
sb.append( getSourceWACN() );
|
||||
|
||||
sb.append( " SYS:" );
|
||||
sb.append( getSourceSystemID() );
|
||||
|
||||
sb.append( " CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber() );
|
||||
sb.append( " " + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber() );
|
||||
sb.append( " " + getUplinkFrequency() );
|
||||
|
||||
sb.append(" FROM ADDR:");
|
||||
sb.append(getSourceAddress());
|
||||
|
||||
sb.append(" ID:");
|
||||
sb.append(getSourceID());
|
||||
|
||||
sb.append(" TO:");
|
||||
sb.append(getTargetAddress());
|
||||
|
||||
sb.append(" WACN:");
|
||||
sb.append(getSourceWACN());
|
||||
|
||||
sb.append(" SYS:");
|
||||
sb.append(getSourceSystemID());
|
||||
|
||||
sb.append(" CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber());
|
||||
sb.append(" " + getDownlinkFrequency());
|
||||
|
||||
sb.append(" CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber());
|
||||
sb.append(" " + getUplinkFrequency());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncrypted()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceID()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ID, 6 );
|
||||
}
|
||||
|
||||
public String getSourceWACN()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_WACN, 5 );
|
||||
}
|
||||
|
||||
public String getSourceSystemID()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
return mMessage.getHex(SOURCE_ADDRESS, 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public String getSourceID()
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getHex(SOURCE_ID, 6);
|
||||
}
|
||||
|
||||
public String getSourceWACN()
|
||||
{
|
||||
return mMessage.getHex(SOURCE_WACN, 5);
|
||||
}
|
||||
|
||||
public String getSourceSystemID()
|
||||
{
|
||||
return mMessage.getHex(SOURCE_SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex(TARGET_ADDRESS, 6);
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
idens[0] = getTransmitChannelIdentifier();
|
||||
idens[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitChannelIdentifier();
|
||||
idens[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu.osp.control;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IAdjacentSite;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
@@ -7,43 +28,32 @@ import module.decode.p25.message.pdu.PDUMessage;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
|
||||
public class AdjacentStatusBroadcastExtended extends PDUMessage
|
||||
implements IdentifierReceiver, IAdjacentSite
|
||||
public class AdjacentStatusBroadcastExtended extends PDUMessage implements IdentifierReceiver, IAdjacentSite
|
||||
{
|
||||
public static final int[] LRA = { 88,89,90,91,92,93,94,95 };
|
||||
public static final int[] SYSTEM_ID = { 100,101,102,103,104,105,106,107,108,
|
||||
109,110,111 };
|
||||
public static final int[] RF_SUBSYSTEM_ID = { 128,129,130,131,132,133,134,
|
||||
135 };
|
||||
public static final int[] SITE_ID = { 136,137,138,139,140,141,142,143 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,172,173,174,175 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 176,177,178,179 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 180,181,182,183,184,185,186,
|
||||
187,188,189,190,191 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 192,193,194,195,196,197,
|
||||
198,199 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
|
||||
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
|
||||
248,249,250,251,252,253,254,255 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierProvider;
|
||||
private IBandIdentifier mReceiveIdentifierProvider;
|
||||
|
||||
public AdjacentStatusBroadcastExtended( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
public static final int[] LRA = {88, 89, 90, 91, 92, 93, 94, 95};
|
||||
public static final int[] SYSTEM_ID = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] RF_SUBSYSTEM_ID = {128, 129, 130, 131, 132, 133, 134, 135};
|
||||
public static final int[] SITE_ID = {136, 137, 138, 139, 140, 141, 142, 143};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] TRANSMIT_CHANNEL = {164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {176, 177, 178, 179};
|
||||
public static final int[] RECEIVE_CHANNEL = {180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {192, 193, 194, 195, 196, 197, 198, 199};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
|
||||
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierProvider;
|
||||
private IBandIdentifier mReceiveIdentifierProvider;
|
||||
|
||||
public AdjacentStatusBroadcastExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,138 +61,148 @@ public class AdjacentStatusBroadcastExtended extends PDUMessage
|
||||
{
|
||||
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( " RFSS:" + getRFSS() );
|
||||
|
||||
sb.append( " SITE:" + getSiteID() );
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append( " CTRL CHAN:" + getTransmitIdentifier() + "-" + getTransmitChannel() );
|
||||
sb.append(" LRA:" + getLRA());
|
||||
|
||||
sb.append( " DN:" + getDownlinkFrequency() );
|
||||
sb.append(" SYS:" + getSystemID());
|
||||
|
||||
sb.append( " " + getReceiveIdentifier() + "-" + getReceiveChannel() );
|
||||
sb.append(" RFSS:" + getRFSS());
|
||||
|
||||
sb.append(" SITE:" + getSiteID());
|
||||
|
||||
sb.append(" CTRL CHAN:" + getTransmitIdentifier() + "-" + getTransmitChannel());
|
||||
|
||||
sb.append(" DN:" + getDownlinkFrequency());
|
||||
|
||||
sb.append(" " + getReceiveIdentifier() + "-" + getReceiveChannel());
|
||||
|
||||
sb.append(" UP:" + getUplinkFrequency());
|
||||
|
||||
sb.append(" SYS SVC CLASS:" + getSystemServiceClass());
|
||||
|
||||
sb.append( " UP:" + getUplinkFrequency() );
|
||||
|
||||
sb.append( " SYS SVC CLASS:" + getSystemServiceClass() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierProvider, getTransmitChannel() );
|
||||
if(mTransmitIdentifierProvider != null)
|
||||
{
|
||||
return mTransmitIdentifierProvider.getDownlinkFrequency(getTransmitChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierProvider, getReceiveChannel() );
|
||||
if(mReceiveIdentifierProvider != null)
|
||||
{
|
||||
return mReceiveIdentifierProvider.getUplinkFrequency(getReceiveChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierProvider = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierProvider = message;
|
||||
}
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierProvider = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierProvider = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitIdentifier();
|
||||
idens[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex( RF_SUBSYSTEM_ID, 2 );
|
||||
}
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
@Override
|
||||
public String getLRA()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
idens[0] = getTransmitIdentifier();
|
||||
idens[1] = getReceiveIdentifier();
|
||||
|
||||
@Override
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return SystemService.toString( mMessage.getInt( SYSTEM_SERVICE_CLASS ) );
|
||||
}
|
||||
return idens;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannel();
|
||||
}
|
||||
@Override
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex(RF_SUBSYSTEM_ID, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannel();
|
||||
}
|
||||
@Override
|
||||
public String getLRA()
|
||||
{
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return SystemService.toString(mMessage.getInt(SYSTEM_SERVICE_CLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu.osp.control;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.pdu.PDUMessage;
|
||||
@@ -7,42 +28,32 @@ import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import module.decode.p25.reference.P25NetworkCallsign;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
|
||||
public class NetworkStatusBroadcastExtended extends PDUMessage
|
||||
implements IdentifierReceiver
|
||||
public class NetworkStatusBroadcastExtended extends PDUMessage implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] LRA = { 88,89,90,91,92,93,94,95 };
|
||||
public static final int[] SYSTEM_ID = { 100,101,102,103,104,105,106,107,108,
|
||||
109,110,111 };
|
||||
public static final int[] WACN = { 160,161,162,163,164,165,166,167,168,169,
|
||||
170,171,172,173,174,175,176,177,178,179 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 184,185,186,187 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 188,189,190,191,192,193,194,
|
||||
195,196,197,198,199 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 200,201,202,203 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 204,205,206,207,208,209,210,
|
||||
211,212,213,214,215 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 216,217,218,219,220,221,
|
||||
222,223 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
|
||||
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
|
||||
248,249,250,251,252,253,254,255 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcastExtended( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
public static final int[] LRA = {88, 89, 90, 91, 92, 93, 94, 95};
|
||||
public static final int[] SYSTEM_ID = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] WACN = {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
|
||||
176, 177, 178, 179};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {184, 185, 186, 187};
|
||||
public static final int[] TRANSMIT_CHANNEL = {188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {200, 201, 202, 203};
|
||||
public static final int[] RECEIVE_CHANNEL = {204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {216, 217, 218, 219, 220, 221, 222, 223};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
|
||||
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcastExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,111 +61,121 @@ public class NetworkStatusBroadcastExtended extends PDUMessage
|
||||
{
|
||||
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:" + getReceiveIdentifier() + "-" + getReceiveChannel() );
|
||||
|
||||
sb.append( " DN:" + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " " + getTransmitIdentifier() + "-" + getTransmitChannel() );
|
||||
|
||||
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:" + getReceiveIdentifier() + "-" + getReceiveChannel());
|
||||
|
||||
sb.append(" DN:" + getDownlinkFrequency());
|
||||
|
||||
sb.append(" " + getTransmitIdentifier() + "-" + getTransmitChannel());
|
||||
|
||||
sb.append(" UP:" + getUplinkFrequency());
|
||||
|
||||
sb.append(" SYS SVC CLASS:" +
|
||||
SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex( WACN, 5 );
|
||||
}
|
||||
|
||||
public String getNetworkCallsign()
|
||||
{
|
||||
return P25NetworkCallsign.getCallsign( mMessage.getInt( WACN ),
|
||||
mMessage.getInt( SYSTEM_ID ) );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannel() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannel() );
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public String getSystemID()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex(WACN, 5);
|
||||
}
|
||||
|
||||
public String getNetworkCallsign()
|
||||
{
|
||||
return P25NetworkCallsign.getCallsign(mMessage.getInt(WACN),
|
||||
mMessage.getInt(SYSTEM_ID));
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
idens[0] = getTransmitIdentifier();
|
||||
idens[1] = getReceiveIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitIdentifier();
|
||||
idens[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,59 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu.osp.control;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.pdu.PDUMessage;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
|
||||
public class RFSSStatusBroadcastExtended extends PDUMessage
|
||||
implements IdentifierReceiver
|
||||
public class RFSSStatusBroadcastExtended extends PDUMessage implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] LRA = { 88,89,90,91,92,93,94,95 };
|
||||
public static final int ACTIVE_NETWORK_CONNECTION_INDICATOR = 99;
|
||||
public static final int[] SYSTEM_ID = { 100,101,102,103,104,105,106,107,108,
|
||||
109,110,111 };
|
||||
public static final int[] RFSS_ID = { 160,161,162,163,164,165,166,167 };
|
||||
public static final int[] SITE_ID = { 168,169,170,171,172,173,174,175 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 184,185,186,187 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 188,189,190,191,192,193,194,
|
||||
195,196,197,198,199 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 200,201,202,203 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 204,205,206,207,208,209,210,
|
||||
211,212,213,214,215 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 216,217,218,219,220,221,
|
||||
222,223 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
|
||||
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
|
||||
248,249,250,251,252,253,254,255 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcastExtended( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
public static final int[] LRA = {88, 89, 90, 91, 92, 93, 94, 95};
|
||||
public static final int ACTIVE_NETWORK_CONNECTION_INDICATOR = 99;
|
||||
public static final int[] SYSTEM_ID = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] RFSS_ID = {160, 161, 162, 163, 164, 165, 166, 167};
|
||||
public static final int[] SITE_ID = {168, 169, 170, 171, 172, 173, 174, 175};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {184, 185, 186, 187};
|
||||
public static final int[] TRANSMIT_CHANNEL = {188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {200, 201, 202, 203};
|
||||
public static final int[] RECEIVE_CHANNEL = {204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {216, 217, 218, 219, 220, 221, 222, 223};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
|
||||
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcastExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,115 +61,125 @@ public class RFSSStatusBroadcastExtended extends PDUMessage
|
||||
{
|
||||
return Opcode.NETWORK_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SYS:" + getSystemID() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CTRL CHAN:" + getReceiveIdentifier() + "-" + getReceiveChannel() );
|
||||
|
||||
sb.append( " DN:" + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " " + getTransmitIdentifier() + "-" + getTransmitChannel() );
|
||||
|
||||
sb.append( " UP:" + getUplinkFrequency() );
|
||||
|
||||
sb.append( " SYS SVC CLASS:" +
|
||||
SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLocationRegistrationArea());
|
||||
|
||||
sb.append(" SYS:" + getSystemID());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" CTRL CHAN:" + getReceiveIdentifier() + "-" + getReceiveChannel());
|
||||
|
||||
sb.append(" DN:" + getDownlinkFrequency());
|
||||
|
||||
sb.append(" " + getTransmitIdentifier() + "-" + getTransmitChannel());
|
||||
|
||||
sb.append(" UP:" + getUplinkFrequency());
|
||||
|
||||
sb.append(" SYS SVC CLASS:" +
|
||||
SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public boolean hasActiveNetworkConnection()
|
||||
{
|
||||
return mMessage.get( ACTIVE_NETWORK_CONNECTION_INDICATOR );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannel() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannel() );
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public boolean hasActiveNetworkConnection()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.get(ACTIVE_NETWORK_CONNECTION_INDICATOR);
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
idens[0] = getTransmitIdentifier();
|
||||
idens[1] = getReceiveIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitIdentifier();
|
||||
idens[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,63 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu.osp.data;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.pdu.PDUMessage;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
|
||||
public class GroupDataChannelGrantExtended extends PDUMessage
|
||||
implements IdentifierReceiver
|
||||
public class GroupDataChannelGrantExtended extends PDUMessage implements IdentifierReceiver
|
||||
{
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 128;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 129;
|
||||
public static final int DUPLEX_MODE = 130;
|
||||
public static final int SESSION_MODE = 131;
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = { 88,89,90,91,92,93,94,95,96,97,
|
||||
98,99,100,101,102,103,104,105,106,107,108,109,110,111 };
|
||||
public static final int[] SERVICE_OPTIONS = { 128,129,130,131,132,133,134,
|
||||
135 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 164,165,166,167,168,169,170,
|
||||
171,172,173,174,175 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 176,177,178,179 };
|
||||
public static final int[] RECEIVE_NUMBER = { 180,181,182,183,184,185,186,
|
||||
187,188,189,190,191 };
|
||||
public static final int[] GROUP_ADDRESS = { 192,193,194,195,196,197,198,199,
|
||||
200,201,202,203,204,205,206,207 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
|
||||
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
|
||||
248,249,250,251,252,253,254,255 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupDataChannelGrantExtended( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
|
||||
104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] SERVICE_OPTIONS = {128, 129, 130, 131, 132, 133, 134, 135};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] TRANSMIT_NUMBER = {164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {176, 177, 178, 179};
|
||||
public static final int[] RECEIVE_NUMBER = {180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191};
|
||||
public static final int[] GROUP_ADDRESS = {192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205,
|
||||
206, 207};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
|
||||
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupDataChannelGrantExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,125 +65,135 @@ public class GroupDataChannelGrantExtended extends PDUMessage
|
||||
{
|
||||
return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT.getDescription();
|
||||
}
|
||||
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " FROM:" );
|
||||
sb.append( getSourceAddress() );
|
||||
|
||||
sb.append( " TO:" );
|
||||
sb.append( getGroupAddress() );
|
||||
|
||||
sb.append( " CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber() );
|
||||
sb.append( " " + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber() );
|
||||
sb.append( " " + getUplinkFrequency() );
|
||||
|
||||
|
||||
sb.append(" FROM:");
|
||||
sb.append(getSourceAddress());
|
||||
|
||||
sb.append(" TO:");
|
||||
sb.append(getGroupAddress());
|
||||
|
||||
sb.append(" CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber());
|
||||
sb.append(" " + getDownlinkFrequency());
|
||||
|
||||
sb.append(" CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber());
|
||||
sb.append(" " + getUplinkFrequency());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncrypted()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
return mMessage.getHex(SOURCE_ADDRESS, 6);
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
return mMessage.getHex(GROUP_ADDRESS, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
idens[0] = getTransmitChannelIdentifier();
|
||||
idens[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitChannelIdentifier();
|
||||
idens[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,63 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu.osp.voice;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.pdu.PDUMessage;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
|
||||
public class GroupVoiceChannelGrantExplicit extends PDUMessage
|
||||
implements IdentifierReceiver
|
||||
public class GroupVoiceChannelGrantExplicit extends PDUMessage implements IdentifierReceiver
|
||||
{
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 128;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 129;
|
||||
public static final int DUPLEX_MODE = 130;
|
||||
public static final int SESSION_MODE = 131;
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = { 88,89,90,91,92,93,94,95,96,97,
|
||||
98,99,100,101,102,103,104,105,106,107,108,109,110,111 };
|
||||
public static final int[] SERVICE_OPTIONS = { 128,129,130,131,132,133,134,
|
||||
135 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 176,177,178,179 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 180,181,182,183,184,185,186,
|
||||
187,188,189,190,191 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 192,193,194,195 };
|
||||
public static final int[] RECEIVE_NUMBER = { 196,197,198,199,200,201,202,
|
||||
203,204,205,206,207 };
|
||||
public static final int[] GROUP_ADDRESS = { 208,209,210,211,212,213,214,215,
|
||||
216,217,218,219,220,221,222,223 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
|
||||
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
|
||||
248,249,250,251,252,253,254,255 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupVoiceChannelGrantExplicit( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
|
||||
105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] SERVICE_OPTIONS = {128, 129, 130, 131, 132, 133, 134, 135};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {176, 177, 178, 179};
|
||||
public static final int[] TRANSMIT_NUMBER = {180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {192, 193, 194, 195};
|
||||
public static final int[] RECEIVE_NUMBER = {196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207};
|
||||
public static final int[] GROUP_ADDRESS = {208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221,
|
||||
222, 223};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
|
||||
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupVoiceChannelGrantExplicit(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,125 +65,135 @@ public class GroupVoiceChannelGrantExplicit extends PDUMessage
|
||||
{
|
||||
return Opcode.GROUP_VOICE_CHANNEL_GRANT.getDescription();
|
||||
}
|
||||
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " FROM:" );
|
||||
sb.append( getSourceAddress() );
|
||||
|
||||
sb.append( " GRP:" );
|
||||
sb.append( getGroupAddress() );
|
||||
|
||||
sb.append( " CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber() );
|
||||
sb.append( " " + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber() );
|
||||
sb.append( " " + getUplinkFrequency() );
|
||||
|
||||
sb.append(" FROM:");
|
||||
sb.append(getSourceAddress());
|
||||
|
||||
sb.append(" GRP:");
|
||||
sb.append(getGroupAddress());
|
||||
|
||||
sb.append(" CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber());
|
||||
sb.append(" " + getDownlinkFrequency());
|
||||
|
||||
sb.append(" CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber());
|
||||
sb.append(" " + getUplinkFrequency());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncrypted()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
return mMessage.getHex(SOURCE_ADDRESS, 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public String getGroupAddress()
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getHex(GROUP_ADDRESS, 4);
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
idens[0] = getTransmitChannelIdentifier();
|
||||
idens[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitChannelIdentifier();
|
||||
idens[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,53 +1,64 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu.osp.voice;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.pdu.PDUMessage;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
|
||||
public class TelephoneInterconnectChannelGrantExplicit extends PDUMessage
|
||||
implements IdentifierReceiver
|
||||
import java.util.Date;
|
||||
|
||||
public class TelephoneInterconnectChannelGrantExplicit extends PDUMessage implements IdentifierReceiver
|
||||
{
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 128;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 129;
|
||||
public static final int DUPLEX_MODE = 130;
|
||||
public static final int SESSION_MODE = 131;
|
||||
|
||||
public static final int[] ADDRESS = { 88,89,90,91,92,93,94,95,96,97,
|
||||
98,99,100,101,102,103,104,105,106,107,108,109,110,111 };
|
||||
public static final int[] SERVICE_OPTIONS = { 128,129,130,131,132,133,134,
|
||||
135 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 164,165,166,167,168,169,170,
|
||||
171,172,173,174,175 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 176,177,178,179 };
|
||||
public static final int[] RECEIVE_NUMBER = { 180,181,182,183,184,185,186,
|
||||
187,188,189,190,191 };
|
||||
public static final int[] CALL_TIMER = { 192,193,194,195,196,197,198,199,
|
||||
200,201,202,203,204,205,206,207 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 224,225,226,227,228,229,
|
||||
230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,
|
||||
248,249,250,251,252,253,254,255 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public TelephoneInterconnectChannelGrantExplicit( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
|
||||
public static final int[] ADDRESS = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
|
||||
106, 107, 108, 109, 110, 111};
|
||||
public static final int[] SERVICE_OPTIONS = {128, 129, 130, 131, 132, 133, 134, 135};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] TRANSMIT_NUMBER = {164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {176, 177, 178, 179};
|
||||
public static final int[] RECEIVE_NUMBER = {180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191};
|
||||
public static final int[] CALL_TIMER = {192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
|
||||
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public TelephoneInterconnectChannelGrantExplicit(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU1(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,57 +66,57 @@ public class TelephoneInterconnectChannelGrantExplicit extends PDUMessage
|
||||
{
|
||||
return Opcode.TELEPHONE_INTERCONNECT_VOICE_CHANNEL_GRANT.getDescription();
|
||||
}
|
||||
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " ADDR:" );
|
||||
sb.append( getAddress() );
|
||||
|
||||
sb.append( " CALL TIMER:" );
|
||||
sb.append( mTimeDurationFormat.format( new Date( getCallTimer() ) ) );
|
||||
|
||||
sb.append( " CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber() );
|
||||
sb.append( " " + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber() );
|
||||
sb.append( " " + getUplinkFrequency() );
|
||||
|
||||
|
||||
sb.append(" ADDR:");
|
||||
sb.append(getAddress());
|
||||
|
||||
sb.append(" CALL TIMER:");
|
||||
sb.append(mTimeDurationFormat.format(new Date(getCallTimer())));
|
||||
|
||||
sb.append(" CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber());
|
||||
sb.append(" " + getDownlinkFrequency());
|
||||
|
||||
sb.append(" CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber());
|
||||
sb.append(" " + getUplinkFrequency());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncrypted()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getAddress()
|
||||
{
|
||||
return mMessage.getHex( ADDRESS, 6 );
|
||||
return mMessage.getHex(ADDRESS, 6);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -113,72 +124,82 @@ public class TelephoneInterconnectChannelGrantExplicit extends PDUMessage
|
||||
*/
|
||||
public long getCallTimer()
|
||||
{
|
||||
int timer = mMessage.getInt( CALL_TIMER );
|
||||
|
||||
return timer / 100;
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
int timer = mMessage.getInt(CALL_TIMER);
|
||||
|
||||
return timer / 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
idens[0] = getTransmitChannelIdentifier();
|
||||
idens[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitChannelIdentifier();
|
||||
idens[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,57 +1,68 @@
|
||||
/*******************************************************************************
|
||||
* 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.pdu.osp.voice;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.pdu.PDUMessage;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import edac.CRCP25;
|
||||
|
||||
public class UnitToUnitVoiceChannelGrantUpdateExtended extends PDUMessage
|
||||
implements IdentifierReceiver
|
||||
public class UnitToUnitVoiceChannelGrantUpdateExtended extends PDUMessage implements IdentifierReceiver
|
||||
{
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 128;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 129;
|
||||
public static final int DUPLEX_MODE = 130;
|
||||
public static final int SESSION_MODE = 131;
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = { 88,89,90,91,92,93,94,95,96,97,
|
||||
98,99,100,101,102,103,104,105,106,107,108,109,110,111 };
|
||||
public static final int[] SERVICE_OPTIONS = { 128,129,130,131,132,133,134,
|
||||
135 };
|
||||
public static final int[] SOURCE_WACN = { 160,161,162,163,164,165,166,167,
|
||||
168,169,170,171,172,173,174,175,176,177,178,179 };
|
||||
public static final int[] SOURCE_SYSTEM_ID = { 180,181,182,183,184,185,186,
|
||||
187,188,189,190,191 };
|
||||
public static final int[] SOURCE_ID = { 192,193,194,195,196,197,198,199,200,
|
||||
201,202,203,204,205,206,207,208,209,210,211,212,213,214,215 };
|
||||
public static final int[] TARGET_ADDRESS = { 216,217,218,219,220,221,222,
|
||||
223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 240,241,242,243 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 244,245,246,247,248,249,250,
|
||||
251,252,253,254,255 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 256,257,258,259 };
|
||||
public static final int[] RECEIVE_NUMBER = { 260,261,262,263,264,265,266,
|
||||
267,268,269,270,271 };
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = { 320,321,322,323,324,325,
|
||||
326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,
|
||||
343,344,345,346,347,348,349,350,351 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public UnitToUnitVoiceChannelGrantUpdateExtended( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
|
||||
105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] SERVICE_OPTIONS = {128, 129, 130, 131, 132, 133, 134, 135};
|
||||
public static final int[] SOURCE_WACN = {160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174,
|
||||
175, 176, 177, 178, 179};
|
||||
public static final int[] SOURCE_SYSTEM_ID = {180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191};
|
||||
public static final int[] SOURCE_ID = {192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
|
||||
207, 208, 209, 210, 211, 212, 213, 214, 215};
|
||||
public static final int[] TARGET_ADDRESS = {216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
|
||||
230, 231, 232, 233, 234, 235, 236, 237, 238, 239};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {240, 241, 242, 243};
|
||||
public static final int[] TRANSMIT_NUMBER = {244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {256, 257, 258, 259};
|
||||
public static final int[] RECEIVE_NUMBER = {260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271};
|
||||
public static final int[] MULTIPLE_BLOCK_CRC = {320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
|
||||
333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public UnitToUnitVoiceChannelGrantUpdateExtended(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
|
||||
super(message, duid, aliasList);
|
||||
|
||||
/* Header block is already error detected/corrected - perform error
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU2( mMessage );
|
||||
mCRC[ 1 ] = mMessage.getCRC();
|
||||
* detection correction on the intermediate and final data blocks */
|
||||
mMessage = CRCP25.correctPDU2(mMessage);
|
||||
mCRC[1] = mMessage.getCRC();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,149 +70,159 @@ public class UnitToUnitVoiceChannelGrantUpdateExtended extends PDUMessage
|
||||
{
|
||||
return Opcode.UNIT_TO_UNIT_VOICE_CHANNEL_GRANT_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " FROM ADDR:" );
|
||||
sb.append( getSourceAddress() );
|
||||
|
||||
sb.append( " ID:" );
|
||||
sb.append( getSourceID() );
|
||||
|
||||
sb.append( " TO:" );
|
||||
sb.append( getTargetAddress() );
|
||||
|
||||
sb.append( " WACN:" );
|
||||
sb.append( getSourceWACN() );
|
||||
|
||||
sb.append( " SYS:" );
|
||||
sb.append( getSourceSystemID() );
|
||||
|
||||
sb.append( " CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber() );
|
||||
sb.append( " " + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber() );
|
||||
sb.append( " " + getUplinkFrequency() );
|
||||
|
||||
sb.append(" FROM ADDR:");
|
||||
sb.append(getSourceAddress());
|
||||
|
||||
sb.append(" ID:");
|
||||
sb.append(getSourceID());
|
||||
|
||||
sb.append(" TO:");
|
||||
sb.append(getTargetAddress());
|
||||
|
||||
sb.append(" WACN:");
|
||||
sb.append(getSourceWACN());
|
||||
|
||||
sb.append(" SYS:");
|
||||
sb.append(getSourceSystemID());
|
||||
|
||||
sb.append(" CHAN DN:" + getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber());
|
||||
sb.append(" " + getDownlinkFrequency());
|
||||
|
||||
sb.append(" CHAN UP:" + getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber());
|
||||
sb.append(" " + getUplinkFrequency());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncrypted()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public String getSourceID()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ID, 6 );
|
||||
}
|
||||
|
||||
public String getSourceWACN()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_WACN, 5 );
|
||||
}
|
||||
|
||||
public String getSourceSystemID()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
return mMessage.getHex(SOURCE_ADDRESS, 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public String getSourceID()
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getHex(SOURCE_ID, 6);
|
||||
}
|
||||
|
||||
public String getSourceWACN()
|
||||
{
|
||||
return mMessage.getHex(SOURCE_WACN, 5);
|
||||
}
|
||||
|
||||
public String getSourceSystemID()
|
||||
{
|
||||
return mMessage.getHex(SOURCE_SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex(TARGET_ADDRESS, 6);
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[2];
|
||||
|
||||
idens[0] = getTransmitChannelIdentifier();
|
||||
idens[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] idens = new int[ 2 ];
|
||||
|
||||
idens[ 0 ] = getTransmitChannelIdentifier();
|
||||
idens[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return idens;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IAdjacentSite;
|
||||
@@ -6,141 +24,147 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class AdjacentSiteStatusBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver, IAdjacentSite
|
||||
public class AdjacentSiteStatusBroadcast extends TDULinkControlMessage implements IdentifierReceiver, IAdjacentSite
|
||||
{
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] SYSTEM_ID = { 96,97,98,99,112,113,114,115,
|
||||
116,117,118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
public static final int[] IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public AdjacentSiteStatusBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
public static final int[] LRA = {72, 73, 74, 75, 88, 89, 90, 91};
|
||||
public static final int[] SYSTEM_ID = {96, 97, 98, 99, 112, 113, 114, 115, 116, 117, 118, 119};
|
||||
public static final int[] RFSS_ID = {120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] SITE_ID = {140, 141, 142, 143, 144, 145, 146, 147};
|
||||
public static final int[] IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] CHANNEL = {164, 165, 166, 167, 168, 169, 170, 171, 184, 185, 186, 187};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public AdjacentSiteStatusBroadcast(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.ADJACENT_SITE_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLRA() );
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( " SYS:" + getSystemID() );
|
||||
|
||||
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN:" + getChannel() );
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLRA());
|
||||
|
||||
sb.append(" SYS:" + getSystemID());
|
||||
|
||||
sb.append(" SITE:" + getRFSS() + "-" + getSiteID());
|
||||
|
||||
sb.append(" CHAN:" + getChannel());
|
||||
|
||||
sb.append(" " + getSystemServiceClass());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
sb.append( " " + getSystemServiceClass() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
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 getLRA()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return SystemService.toString( mMessage.getInt( SYSTEM_SERVICE_CLASS ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
public String getLRA()
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemID()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getChannel();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return SystemService.toString(mMessage.getInt(SYSTEM_SERVICE_CLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
|
||||
identifiers[0] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IAdjacentSite;
|
||||
@@ -5,153 +23,162 @@ import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class AdjacentSiteStatusBroadcastExplicit extends TDULinkControlMessage
|
||||
implements IdentifierReceiver, IAdjacentSite
|
||||
public class AdjacentSiteStatusBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver, IAdjacentSite
|
||||
{
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 92,93,94,95 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 96,97,98,99,112,113,114,115,
|
||||
116,117,118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
|
||||
private IBandIdentifier mTransmitBand;
|
||||
private IBandIdentifier mReceiveBand;
|
||||
public static final int[] LRA = {72, 73, 74, 75, 88, 89, 90, 91};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {92, 93, 94, 95};
|
||||
public static final int[] TRANSMIT_CHANNEL = {96, 97, 98, 99, 112, 113, 114, 115,
|
||||
116, 117, 118, 119};
|
||||
public static final int[] RFSS_ID = {120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] SITE_ID = {140, 141, 142, 143, 144, 145, 146, 147};
|
||||
|
||||
public static final int[] RECEIVE_IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] RECEIVE_CHANNEL = {164, 165, 166, 167, 168, 169, 170,
|
||||
171, 184, 185, 186, 187};
|
||||
|
||||
private IBandIdentifier mTransmitBand;
|
||||
private IBandIdentifier mReceiveBand;
|
||||
|
||||
public AdjacentSiteStatusBroadcastExplicit(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
public AdjacentSiteStatusBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.ADJACENT_SITE_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLRA() );
|
||||
|
||||
sb.append( " SITE:" + getRFSS() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " DNLINK:" + getDownlinkChannel() );
|
||||
|
||||
sb.append( " UPLINK:" + getUplinkChannel() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLRA());
|
||||
|
||||
sb.append(" SITE:" + getRFSS() + "-" + getSiteID());
|
||||
|
||||
sb.append(" DNLINK:" + getDownlinkChannel());
|
||||
|
||||
sb.append(" UPLINK:" + getUplinkChannel());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getUniqueID()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getSystemID() );
|
||||
sb.append( ":" );
|
||||
sb.append( getRFSS() );
|
||||
sb.append( ":" );
|
||||
sb.append( getSiteID() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLRA()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return "***";
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return "[]";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getSystemID());
|
||||
sb.append(":");
|
||||
sb.append(getRFSS());
|
||||
sb.append(":");
|
||||
sb.append(getSiteID());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLRA()
|
||||
{
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
public String getRFSS()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSystemID()
|
||||
{
|
||||
return "***";
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSystemServiceClass()
|
||||
{
|
||||
return "[]";
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannel();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannel();
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannel()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getDownlinkChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannel();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannel()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getUplinkChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannel();
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitBand, getTransmitChannel() );
|
||||
if(mTransmitBand != null)
|
||||
{
|
||||
return mTransmitBand.getDownlinkFrequency(getTransmitChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveBand, getReceiveChannel() );
|
||||
if(mReceiveBand != null)
|
||||
{
|
||||
return mReceiveBand.getUplinkFrequency(getReceiveChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitBand = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveBand = message;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitBand = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveBand = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +1,117 @@
|
||||
/*******************************************************************************
|
||||
* 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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class ChannelIdentifierUpdate extends TDULinkControlMessage
|
||||
implements IBandIdentifier
|
||||
public class ChannelIdentifierUpdate extends TDULinkControlMessage implements IBandIdentifier
|
||||
{
|
||||
public static final int[] IDENTIFIER = { 72,73,74,75 };
|
||||
public static final int[] BANDWIDTH = { 88,89,90,91,92,93,94,95,96 };
|
||||
public static final int[] TRANSMIT_OFFSET = { 97,98,99,112,113,114,115,116,
|
||||
117 };
|
||||
public static final int[] CHANNEL_SPACING = { 118,119,120,121,122,123,136,
|
||||
137,138,139 };
|
||||
public static final int[] BASE_FREQUENCY = { 140,141,142,143,144,145,146,
|
||||
147,160,161,162,163,164,165,166,167,168,169,170,171,184,185,186,
|
||||
187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public ChannelIdentifierUpdate( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
public static final int[] IDENTIFIER = {72, 73, 74, 75};
|
||||
public static final int[] BANDWIDTH = {88, 89, 90, 91, 92, 93, 94, 95, 96};
|
||||
public static final int[] TRANSMIT_OFFSET = {97, 98, 99, 112, 113, 114, 115, 116,
|
||||
117};
|
||||
public static final int[] CHANNEL_SPACING = {118, 119, 120, 121, 122, 123, 136,
|
||||
137, 138, 139};
|
||||
public static final int[] BASE_FREQUENCY = {140, 141, 142, 143, 144, 145, 146,
|
||||
147, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 184, 185, 186,
|
||||
187, 188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
public ChannelIdentifierUpdate(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.CHANNEL_IDENTIFIER_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " IDEN:" + getIdentifier() );
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( " BASE:" + getBaseFrequency() );
|
||||
|
||||
sb.append( " BW:" + getBandwidth() );
|
||||
|
||||
sb.append( " SPACING:" + getChannelSpacing() );
|
||||
|
||||
sb.append( " OFFSET:" + getTransmitOffset() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
sb.append(getMessageStub());
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
sb.append(" IDEN:" + getIdentifier());
|
||||
|
||||
/**
|
||||
sb.append(" BASE:" + getBaseFrequency());
|
||||
|
||||
sb.append(" BW:" + getBandwidth());
|
||||
|
||||
sb.append(" SPACING:" + getChannelSpacing());
|
||||
|
||||
sb.append(" OFFSET:" + getTransmitOffset());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel bandwidth in hertz
|
||||
*/
|
||||
@Override
|
||||
public int getBandwidth()
|
||||
{
|
||||
return mMessage.getInt( BANDWIDTH ) * 125;
|
||||
return mMessage.getInt(BANDWIDTH) * 125;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getChannelSpacing()
|
||||
{
|
||||
return mMessage.getLong( CHANNEL_SPACING ) * 125l;
|
||||
return mMessage.getLong(CHANNEL_SPACING) * 125l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBaseFrequency()
|
||||
{
|
||||
return mMessage.getLong( BASE_FREQUENCY ) * 5l;
|
||||
return mMessage.getLong(BASE_FREQUENCY) * 5l;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public long getTransmitOffset()
|
||||
{
|
||||
return -1 * mMessage.getLong( TRANSMIT_OFFSET ) * 250000l;
|
||||
return -1 * mMessage.getLong(TRANSMIT_OFFSET) * 250000l;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +1,114 @@
|
||||
/*******************************************************************************
|
||||
* 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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
public class ChannelIdentifierUpdateExplicit extends TDULinkControlMessage
|
||||
implements IBandIdentifier
|
||||
public class ChannelIdentifierUpdateExplicit extends TDULinkControlMessage implements IBandIdentifier
|
||||
{
|
||||
public static final int[] IDENTIFIER = { 72,73,74,75 };
|
||||
public static final int[] BANDWIDTH = { 88,89,90,91 };
|
||||
public static final int[] TRANSMIT_OFFSET = { 92,93,94,95,96,97,98,99,112,
|
||||
113,114,115,116,117 };
|
||||
public static final int[] CHANNEL_SPACING = { 118,119,120,121,122,
|
||||
123,136,137,138,139 };
|
||||
public static final int[] BASE_FREQUENCY = { 140,141,142,143,144,145,146,
|
||||
147,160,161,162,163,164,165,166,167,168,169,170,171,184,185,186,
|
||||
187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
public ChannelIdentifierUpdateExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
public static final int[] IDENTIFIER = {72, 73, 74, 75};
|
||||
public static final int[] BANDWIDTH = {88, 89, 90, 91};
|
||||
public static final int[] TRANSMIT_OFFSET = {92, 93, 94, 95, 96, 97, 98, 99, 112, 113, 114, 115, 116, 117};
|
||||
public static final int[] CHANNEL_SPACING = {118, 119, 120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] BASE_FREQUENCY = {140, 141, 142, 143, 144, 145, 146, 147, 160, 161, 162, 163, 164, 165,
|
||||
166, 167, 168, 169, 170, 171, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
public ChannelIdentifierUpdateExplicit(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.CHANNEL_IDENTIFIER_UPDATE_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " IDEN:" + getIdentifier() );
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( " BASE:" + getBaseFrequency() );
|
||||
|
||||
sb.append( " BW:" + getBandwidth() );
|
||||
|
||||
sb.append( " SPACING:" + getChannelSpacing() );
|
||||
|
||||
sb.append( " OFFSET:" + getTransmitOffset() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
sb.append(getMessageStub());
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
sb.append(" IDEN:" + getIdentifier());
|
||||
|
||||
/**
|
||||
sb.append(" BASE:" + getBaseFrequency());
|
||||
|
||||
sb.append(" BW:" + getBandwidth());
|
||||
|
||||
sb.append(" SPACING:" + getChannelSpacing());
|
||||
|
||||
sb.append(" OFFSET:" + getTransmitOffset());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Channel bandwidth in hertz
|
||||
*/
|
||||
@Override
|
||||
public int getBandwidth()
|
||||
{
|
||||
return mMessage.getInt( BANDWIDTH ) * 125;
|
||||
return mMessage.getInt(BANDWIDTH) * 125;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getChannelSpacing()
|
||||
{
|
||||
return mMessage.getLong( CHANNEL_SPACING ) * 125l;
|
||||
return mMessage.getLong(CHANNEL_SPACING) * 125l;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBaseFrequency()
|
||||
{
|
||||
return mMessage.getLong( BASE_FREQUENCY ) * 5l;
|
||||
return mMessage.getLong(BASE_FREQUENCY) * 5l;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public long getTransmitOffset()
|
||||
{
|
||||
return -1 * mMessage.getLong( TRANSMIT_OFFSET ) * 250000l;
|
||||
return -1 * mMessage.getLong(TRANSMIT_OFFSET) * 250000l;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,176 +1,207 @@
|
||||
/*******************************************************************************
|
||||
* 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.tdu.lc;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupVoiceChannelUpdate extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupVoiceChannelUpdate.class );
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
public class GroupVoiceChannelUpdate extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] IDENTIFIER_A = {72, 73, 74, 75};
|
||||
public static final int[] CHANNEL_A = {88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99};
|
||||
public static final int[] GROUP_ADDRESS_A = {112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] IDENTIFIER_B = {140, 141, 142, 143};
|
||||
public static final int[] CHANNEL_B = {144, 145, 146, 147, 160, 161, 162, 163, 164, 165, 166, 167};
|
||||
public static final int[] GROUP_ADDRESS_B = {168, 169, 170, 171, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdateA;
|
||||
private IBandIdentifier mIdentifierUpdateB;
|
||||
|
||||
public GroupVoiceChannelUpdate(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
public static final int[] IDENTIFIER_A = { 72,73,74,75 };
|
||||
public static final int[] CHANNEL_A = { 88,89,90,91,92,93,94,95,96,97,98,99 };
|
||||
public static final int[] GROUP_ADDRESS_A = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139 };
|
||||
public static final int[] IDENTIFIER_B = { 140,141,142,143 };
|
||||
public static final int[] CHANNEL_B = { 144,145,146,147,160,161,162,163,164,
|
||||
165,166,167 };
|
||||
public static final int[] GROUP_ADDRESS_B = { 168,169,170,171,184,185,186,
|
||||
187,188,189,190,191,192,193,194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdateA;
|
||||
private IBandIdentifier mIdentifierUpdateB;
|
||||
|
||||
public GroupVoiceChannelUpdate( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_VOICE_CHANNEL_UPDATE.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " CHAN A:" + getChannelA() );
|
||||
|
||||
sb.append( " GRP A:" + getGroupAddressA() );
|
||||
|
||||
if( hasChannelB() )
|
||||
{
|
||||
sb.append( " CHAN B:" + getChannelA() );
|
||||
|
||||
sb.append( " GRP B:" + getGroupAddressA() );
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" CHAN A:" + getChannelA());
|
||||
|
||||
sb.append(" GRP A:" + getGroupAddressA());
|
||||
|
||||
if(hasChannelB())
|
||||
{
|
||||
sb.append(" CHAN B:" + getChannelA());
|
||||
|
||||
sb.append(" GRP B:" + getGroupAddressA());
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public int getChannelIdentifierA()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_A);
|
||||
}
|
||||
|
||||
public int getChannelIdentifierA()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_A );
|
||||
}
|
||||
|
||||
public int getChannelNumberA()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_A );
|
||||
return mMessage.getInt(CHANNEL_A);
|
||||
}
|
||||
|
||||
|
||||
public String getChannelA()
|
||||
{
|
||||
return getChannelIdentifierA() + "-" + getChannelNumberA();
|
||||
return getChannelIdentifierA() + "-" + getChannelNumberA();
|
||||
}
|
||||
|
||||
public int getChannelIdentifierB()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_B );
|
||||
}
|
||||
|
||||
|
||||
public int getChannelIdentifierB()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_B);
|
||||
}
|
||||
|
||||
public int getChannelNumberB()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_B );
|
||||
return mMessage.getInt(CHANNEL_B);
|
||||
}
|
||||
|
||||
|
||||
public String getChannelB()
|
||||
{
|
||||
return getChannelIdentifierB() + "-" + getChannelNumberB();
|
||||
return getChannelIdentifierB() + "-" + getChannelNumberB();
|
||||
}
|
||||
|
||||
|
||||
public boolean hasChannelB()
|
||||
{
|
||||
return getChannelNumberB() != 0;
|
||||
return getChannelNumberB() != 0;
|
||||
}
|
||||
|
||||
|
||||
public String getGroupAddressA()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_A, 4 );
|
||||
return mMessage.getHex(GROUP_ADDRESS_A, 4);
|
||||
}
|
||||
|
||||
public String getGroupAddressB()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_B, 4 );
|
||||
return mMessage.getHex(GROUP_ADDRESS_B, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a sorted list of addresses contained in the A and B fields
|
||||
* @return
|
||||
*/
|
||||
public Set<String> getAddresses()
|
||||
{
|
||||
Set<String> addresses = new TreeSet<String>();
|
||||
|
||||
addresses.add( getGroupAddressA() );
|
||||
addresses.add( getGroupAddressB() );
|
||||
|
||||
return addresses;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
/**
|
||||
* Returns a sorted list of addresses contained in the A and B fields
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<String> getAddresses()
|
||||
{
|
||||
if( identifier == getChannelIdentifierA() )
|
||||
{
|
||||
mIdentifierUpdateA = message;
|
||||
}
|
||||
if( identifier == getChannelIdentifierB() )
|
||||
{
|
||||
mIdentifierUpdateB = message;
|
||||
}
|
||||
Set<String> addresses = new TreeSet<String>();
|
||||
|
||||
addresses.add(getGroupAddressA());
|
||||
addresses.add(getGroupAddressB());
|
||||
|
||||
return addresses;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getChannelIdentifierA())
|
||||
{
|
||||
mIdentifierUpdateA = message;
|
||||
}
|
||||
if(identifier == getChannelIdentifierB())
|
||||
{
|
||||
mIdentifierUpdateB = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
if( hasChannelB() )
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
identifiers[ 0 ] = getChannelIdentifierA();
|
||||
identifiers[ 1 ] = getChannelIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
identifiers[ 0 ] = getChannelIdentifierA();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
if(hasChannelB())
|
||||
{
|
||||
int[] identifiers = new int[2];
|
||||
identifiers[0] = getChannelIdentifierA();
|
||||
identifiers[1] = getChannelIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
else
|
||||
{
|
||||
int[] identifiers = new int[1];
|
||||
identifiers[0] = getChannelIdentifierA();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyA()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateA, getChannelNumberA() );
|
||||
if(mIdentifierUpdateA != null)
|
||||
{
|
||||
return mIdentifierUpdateA.getDownlinkFrequency(getChannelNumberA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyA()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateA, getChannelNumberA() );
|
||||
if(mIdentifierUpdateA != null)
|
||||
{
|
||||
return mIdentifierUpdateA.getUplinkFrequency(getChannelNumberA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequencyB()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateB, getChannelNumberA() );
|
||||
if(mIdentifierUpdateB != null)
|
||||
{
|
||||
return mIdentifierUpdateB.getDownlinkFrequency(getChannelNumberB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyB()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateB, getChannelNumberA() );
|
||||
if(mIdentifierUpdateB != null)
|
||||
{
|
||||
return mIdentifierUpdateB.getUplinkFrequency(getChannelNumberB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,154 +1,176 @@
|
||||
/*******************************************************************************
|
||||
* 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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class GroupVoiceChannelUpdateExplicit extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( GroupVoiceChannelUpdateExplicit.class );
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger(GroupVoiceChannelUpdateExplicit.class);
|
||||
|
||||
public static final int EMERGENCY_FLAG = 92;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 93;
|
||||
public static final int DUPLEX_MODE = 94;
|
||||
public static final int SESSION_MODE = 95;
|
||||
public static final int[] GROUP_ADDRESS = { 112,113,114,115,116,117,118,
|
||||
119,120,121,122,123,136,137,138,139 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 140,141,142,143 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 144,145,146,147,160,161,162,
|
||||
163,164,165,166,167 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 168,169,170,171 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 184,185,186,187,188,189,190,
|
||||
191,192,193,194,195,196,197,198,199 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupVoiceChannelUpdateExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
public static final int[] GROUP_ADDRESS = {112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {140, 141, 142, 143};
|
||||
public static final int[] TRANSMIT_CHANNEL = {144, 145, 146, 147, 160, 161, 162, 163, 164, 165, 166, 167};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {168, 169, 170, 171};
|
||||
public static final int[] RECEIVE_CHANNEL = {184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupVoiceChannelUpdateExplicit(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.GROUP_VOICE_CHANNEL_UPDATE_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
if( isEncryptedChannel() )
|
||||
{
|
||||
sb.append( " ENCRYPTED CHANNEL" );
|
||||
}
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
if(isEncryptedChannel())
|
||||
{
|
||||
sb.append(" ENCRYPTED CHANNEL");
|
||||
}
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex(GROUP_ADDRESS, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitChannelIdentifier();
|
||||
identifiers[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitChannelIdentifier();
|
||||
identifiers[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate,
|
||||
getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate,
|
||||
getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -5,106 +23,106 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
import module.decode.p25.reference.Service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class NetworkStatusBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
public class NetworkStatusBroadcast extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( NetworkStatusBroadcast.class );
|
||||
|
||||
public static final int[] WACN = { 72,73,74,75,88,89,90,91,92,93,94,95,96,
|
||||
97,98,99,112,113,114,115,116,117,118,119,120,121,122,123 };
|
||||
public static final int[] SYSTEM = { 136,137,138,139,140,141,142,143,144,
|
||||
145,146,147 };
|
||||
public static final int[] IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL = { 164,165,166,167,168,169,170,171,184,
|
||||
185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
public static final int[] WACN = {72, 73, 74, 75, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 112, 113, 114,
|
||||
115, 116, 117, 118, 119, 120, 121, 122, 123};
|
||||
public static final int[] SYSTEM = {136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147};
|
||||
public static final int[] IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] CHANNEL = {164, 165, 166, 167, 168, 169, 170, 171, 184, 185, 186, 187};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcast(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.NETWORK_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " NETWORK:" + getWACN() );
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
sb.append( " CHAN:" + getChannel() );
|
||||
sb.append( " " + Service.getServices( getSystemServiceClass() ).toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex( WACN, 5 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM, 3 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" NETWORK:" + getWACN());
|
||||
sb.append(" SYS:" + getSystem());
|
||||
sb.append(" CHAN:" + getChannel());
|
||||
sb.append(" " + Service.getServices(getSystemServiceClass()).toString());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex(WACN, 5);
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM, 3);
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
|
||||
identifiers[0] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,131 +1,146 @@
|
||||
/*******************************************************************************
|
||||
* 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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class NetworkStatusBroadcastExplicit extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
public class NetworkStatusBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( NetworkStatusBroadcastExplicit.class );
|
||||
public static final int[] WACN = {72, 73, 74, 75, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 112, 113, 114, 115};
|
||||
public static final int[] SYSTEM = {116, 117, 118, 119, 120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {140, 141, 142, 143};
|
||||
public static final int[] TRANSMIT_CHANNEL = {144, 145, 146, 147, 160, 161, 162, 163, 164, 165, 166, 167};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {168, 169, 170, 171};
|
||||
public static final int[] RECEIVE_CHANNEL = {184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcastExplicit(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
public static final int[] WACN = { 72,73,74,75,88,89,90,91,92,93,94,95,96,
|
||||
97,98,99,112,113,114,115 };
|
||||
public static final int[] SYSTEM = { 116,117,118,119,120,121,122,123,136,
|
||||
137,138,139 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 140,141,142,143 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 144,145,146,147,160,161,162,
|
||||
163,164,165,166,167 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 168,169,170,171 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 184,185,186,187,188,189,190,
|
||||
191,192,193,194,195 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public NetworkStatusBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.NETWORK_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " NETWORK:" + getWACN() );
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
sb.append( " TRANSMIT:" + getTransmitChannel() );
|
||||
sb.append( " RECEIVE:" + getReceiveChannel() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex( WACN, 5 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM, 3 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" NETWORK:" + getWACN());
|
||||
sb.append(" SYS:" + getSystem());
|
||||
sb.append(" TRANSMIT:" + getTransmitChannel());
|
||||
sb.append(" RECEIVE:" + getReceiveChannel());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWACN()
|
||||
{
|
||||
return mMessage.getHex(WACN, 5);
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM, 3);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate,
|
||||
getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate,
|
||||
getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -5,128 +23,124 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RFSSStatusBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
public class RFSSStatusBroadcast extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( RFSSStatusBroadcast.class );
|
||||
public static final int[] LRA = {72, 73, 74, 75, 88, 89, 90, 91};
|
||||
public static final int[] SYSTEM_ID = {96, 97, 98, 99, 112, 113, 114, 115, 116, 117, 118, 119};
|
||||
public static final int[] RFSS_ID = {120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] SITE_ID = {140, 141, 142, 143, 144, 145, 146, 147};
|
||||
public static final int[] IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] CHANNEL = {164, 165, 166, 167, 168, 169, 170, 171, 184, 185, 186, 187};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcast(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,
|
||||
90,91 };
|
||||
public static final int[] SYSTEM_ID = { 96,97,98,99,112,113,114,115,116,117,
|
||||
118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,
|
||||
139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
|
||||
public static final int[] IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.RFSS_STATUS_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SYS:" + getSystem() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN:" + getChannelNumber() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
sb.append( " " + mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex( SYSTEM_ID, 3 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLocationRegistrationArea());
|
||||
|
||||
sb.append(" SYS:" + getSystem());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" CHAN:" + getChannelNumber());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
sb.append(" " + mMessage.toString());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
public String getSystem()
|
||||
{
|
||||
return mMessage.getHex(SYSTEM_ID, 3);
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
|
||||
identifiers[0] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,152 +1,171 @@
|
||||
/*******************************************************************************
|
||||
* 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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class RFSSStatusBroadcastExplicit extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
public class RFSSStatusBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( RFSSStatusBroadcastExplicit.class );
|
||||
private final static Logger mLog = LoggerFactory.getLogger(RFSSStatusBroadcastExplicit.class);
|
||||
|
||||
public static final int[] LRA = {72, 73, 74, 75, 88, 89, 90, 91};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {92, 93, 94, 95};
|
||||
public static final int[] RECEIVE_CHANNEL = {96, 97, 98, 99, 112, 113, 114, 115, 116, 117, 118, 119};
|
||||
public static final int[] RFSS_ID = {120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] SITE_ID = {140, 141, 142, 143, 144, 145, 146, 147};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {160, 161, 162, 163};
|
||||
public static final int[] TRANSMIT_CHANNEL = {164, 165, 166, 167, 168, 169, 170, 171, 184, 185, 186, 187};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcastExplicit(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
public static final int[] LRA = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 92,93,94,95 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 96,97,98,99,112,113,114,115,
|
||||
116,117,118,119 };
|
||||
public static final int[] RFSS_ID = { 120,121,122,123,136,137,138,
|
||||
139 };
|
||||
public static final int[] SITE_ID = { 140,141,142,143,144,145,146,147 };
|
||||
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 160,161,162,163 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 188,189,190,191,192,193,
|
||||
194,195 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public RFSSStatusBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.RFSS_STATUS_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " LRA:" + getLocationRegistrationArea() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " TRANSMIT:" + getTransmitChannelNumber() );
|
||||
|
||||
sb.append( " RECEIVE:" + getReceiveChannelNumber() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
sb.append( " " + mMessage.toString() );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex( LRA, 2 );
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" LRA:" + getLocationRegistrationArea());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" TRANSMIT:" + getTransmitChannelNumber());
|
||||
|
||||
sb.append(" RECEIVE:" + getReceiveChannelNumber());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
sb.append(" " + mMessage.toString());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocationRegistrationArea()
|
||||
{
|
||||
return mMessage.getHex(LRA, 2);
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -5,155 +23,162 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SecondaryControlChannelBroadcast extends TDULinkControlMessage
|
||||
implements IdentifierReceiver
|
||||
public class SecondaryControlChannelBroadcast extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SecondaryControlChannelBroadcast.class );
|
||||
public static final int[] RFSS_ID = {72, 73, 74, 75, 88, 89, 90, 91};
|
||||
public static final int[] SITE_ID = {92, 93, 94, 95, 96, 97, 98, 99};
|
||||
public static final int[] IDENTIFIER_A = {112, 113, 114, 115};
|
||||
public static final int[] CHANNEL_A = {116, 117, 118, 119, 120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_A = {140, 141, 142, 143, 144, 145, 146, 147};
|
||||
public static final int[] IDENTIFIER_B = {160, 161, 162, 163};
|
||||
public static final int[] CHANNEL_B = {164, 165, 166, 167, 168, 169, 170, 171, 184, 185, 186, 187};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_B = {188, 189, 190, 191, 192, 193, 194, 195};
|
||||
|
||||
private IBandIdentifier mIdentifierProviderA;
|
||||
private IBandIdentifier mIdentifierProviderB;
|
||||
|
||||
public SecondaryControlChannelBroadcast(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
public static final int[] RFSS_ID = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] SITE_ID = { 92,93,94,95,96,97,98,99 };
|
||||
public static final int[] IDENTIFIER_A = { 112,113,114,115 };
|
||||
public static final int[] CHANNEL_A = { 116,117,118,119,120,121,122,
|
||||
123,136,137,138,139 };
|
||||
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_A = { 140,141,142,143,144,
|
||||
145,146,147 };
|
||||
|
||||
public static final int[] IDENTIFIER_B = { 160,161,162,163 };
|
||||
public static final int[] CHANNEL_B = { 164,165,166,167,168,169,170,
|
||||
171,184,185,186,187 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS_B = { 188,189,190,191,192,
|
||||
193,194,195 };
|
||||
|
||||
private IBandIdentifier mIdentifierProviderA;
|
||||
private IBandIdentifier mIdentifierProviderB;
|
||||
|
||||
public SecondaryControlChannelBroadcast( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.SECONDARY_CONTROL_CHANNEL_BROADCAST.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " CHAN A:" + getChannelA() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClassA() ) );
|
||||
|
||||
sb.append( " CHAN B:" + getChannelB() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClassB() ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getIdentifierA()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_A );
|
||||
}
|
||||
|
||||
public int getChannelA()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_A );
|
||||
}
|
||||
|
||||
public String getChannelNumberA()
|
||||
{
|
||||
return getIdentifierA() + "-" + getChannelA();
|
||||
}
|
||||
|
||||
public int getIdentifierB()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_B );
|
||||
}
|
||||
|
||||
public int getChannelB()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_B );
|
||||
}
|
||||
|
||||
public String getChannelNumberB()
|
||||
{
|
||||
return getIdentifierB() + "-" + getChannelB();
|
||||
}
|
||||
|
||||
public int getSystemServiceClassA()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS_A );
|
||||
}
|
||||
|
||||
public int getSystemServiceClassB()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS_B );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getIdentifierA() )
|
||||
{
|
||||
mIdentifierProviderA = message;
|
||||
}
|
||||
if( identifier == getIdentifierB() )
|
||||
{
|
||||
mIdentifierProviderB = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" CHAN A:" + getChannelA());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClassA()));
|
||||
|
||||
sb.append(" CHAN B:" + getChannelB());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClassB()));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getIdentifierA()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_A);
|
||||
}
|
||||
|
||||
public int getChannelA()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL_A);
|
||||
}
|
||||
|
||||
public String getChannelNumberA()
|
||||
{
|
||||
return getIdentifierA() + "-" + getChannelA();
|
||||
}
|
||||
|
||||
public int getIdentifierB()
|
||||
{
|
||||
return mMessage.getInt(IDENTIFIER_B);
|
||||
}
|
||||
|
||||
public int getChannelB()
|
||||
{
|
||||
return mMessage.getInt(CHANNEL_B);
|
||||
}
|
||||
|
||||
public String getChannelNumberB()
|
||||
{
|
||||
return getIdentifierB() + "-" + getChannelB();
|
||||
}
|
||||
|
||||
public int getSystemServiceClassA()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS_A);
|
||||
}
|
||||
|
||||
public int getSystemServiceClassB()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS_B);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getIdentifierA())
|
||||
{
|
||||
mIdentifierProviderA = message;
|
||||
}
|
||||
if(identifier == getIdentifierB())
|
||||
{
|
||||
mIdentifierProviderB = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifierA();
|
||||
identifiers[ 1 ] = getIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getIdentifierA();
|
||||
identifiers[1] = getIdentifierB();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequencyA()
|
||||
{
|
||||
return calculateDownlink( mIdentifierProviderA, getChannelA() );
|
||||
if(mIdentifierProviderA != null)
|
||||
{
|
||||
return mIdentifierProviderA.getDownlinkFrequency(getChannelA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyA()
|
||||
{
|
||||
return calculateUplink( mIdentifierProviderA, getChannelA() );
|
||||
if(mIdentifierProviderA != null)
|
||||
{
|
||||
return mIdentifierProviderA.getUplinkFrequency(getChannelA());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequencyB()
|
||||
{
|
||||
return calculateDownlink( mIdentifierProviderB, getChannelB() );
|
||||
if(mIdentifierProviderB != null)
|
||||
{
|
||||
return mIdentifierProviderB.getDownlinkFrequency(getChannelB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequencyB()
|
||||
{
|
||||
return calculateUplink( mIdentifierProviderB, getChannelB() );
|
||||
if(mIdentifierProviderB != null)
|
||||
{
|
||||
return mIdentifierProviderB.getUplinkFrequency(getChannelB());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.tdu.lc;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
@@ -5,136 +23,134 @@ import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.message.tsbk.osp.control.SystemService;
|
||||
import module.decode.p25.reference.LinkControlOpcode;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SecondaryControlChannelBroadcastExplicit
|
||||
extends TDULinkControlMessage implements IdentifierReceiver
|
||||
public class SecondaryControlChannelBroadcastExplicit extends TDULinkControlMessage implements IdentifierReceiver
|
||||
{
|
||||
private final static Logger mLog =
|
||||
LoggerFactory.getLogger( SecondaryControlChannelBroadcastExplicit.class );
|
||||
public static final int[] RFSS_ID = {72, 73, 74, 75, 88, 89, 90, 91};
|
||||
public static final int[] SITE_ID = {92, 93, 94, 95, 96, 97, 98, 99};
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {112, 113, 114, 115};
|
||||
public static final int[] TRANSMIT_CHANNEL = {116, 117, 118, 119, 120, 121, 122, 123, 136, 137, 138, 139};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {140, 141, 142, 143};
|
||||
public static final int[] RECEIVE_CHANNEL = {144, 145, 146, 147, 160, 161, 162, 163, 164, 165, 166, 167};
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = {168, 169, 170, 171, 184, 185, 186, 187};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierProvider;
|
||||
private IBandIdentifier mReceiveIdentifierProvider;
|
||||
|
||||
public SecondaryControlChannelBroadcastExplicit(TDULinkControlMessage source)
|
||||
{
|
||||
super(source);
|
||||
}
|
||||
|
||||
public static final int[] RFSS_ID = { 72,73,74,75,88,89,90,91 };
|
||||
public static final int[] SITE_ID = { 92,93,94,95,96,97,98,99 };
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 112,113,114,115 };
|
||||
public static final int[] TRANSMIT_CHANNEL = { 116,117,118,119,120,121,122,
|
||||
123,136,137,138,139 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 140,141,142,143 };
|
||||
public static final int[] RECEIVE_CHANNEL = { 144,145,146,147,160,161,162,
|
||||
163,164,165,166,167 };
|
||||
public static final int[] SYSTEM_SERVICE_CLASS = { 168,169,170,171,184,
|
||||
185,186,187 };
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierProvider;
|
||||
private IBandIdentifier mReceiveIdentifierProvider;
|
||||
|
||||
public SecondaryControlChannelBroadcastExplicit( TDULinkControlMessage source )
|
||||
{
|
||||
super( source );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return LinkControlOpcode.SECONDARY_CONTROL_CHANNEL_BROADCAST_EXPLICIT.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " SITE:" + getRFSubsystemID() + "-" + getSiteID() );
|
||||
|
||||
sb.append( " TRANSMIT:" + getTransmitChannel() );
|
||||
|
||||
sb.append( " RECEIVE:" + getReceiveChannel() );
|
||||
|
||||
sb.append( " " + SystemService.toString( getSystemServiceClass() ) );
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex( RFSS_ID, 2 );
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex( SITE_ID, 2 );
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_CHANNEL );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_CHANNEL );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt( SYSTEM_SERVICE_CLASS );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
if( identifier == getTransmitIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierProvider = message;
|
||||
}
|
||||
if( identifier == getReceiveIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierProvider = message;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" SITE:" + getRFSubsystemID() + "-" + getSiteID());
|
||||
|
||||
sb.append(" TRANSMIT:" + getTransmitChannel());
|
||||
|
||||
sb.append(" RECEIVE:" + getReceiveChannel());
|
||||
|
||||
sb.append(" " + SystemService.toString(getSystemServiceClass()));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRFSubsystemID()
|
||||
{
|
||||
return mMessage.getHex(RFSS_ID, 2);
|
||||
}
|
||||
|
||||
public String getSiteID()
|
||||
{
|
||||
return mMessage.getHex(SITE_ID, 2);
|
||||
}
|
||||
|
||||
public int getTransmitIdentifier()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_CHANNEL);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_CHANNEL);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public int getSystemServiceClass()
|
||||
{
|
||||
return mMessage.getInt(SYSTEM_SERVICE_CLASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitIdentifier())
|
||||
{
|
||||
mTransmitIdentifierProvider = message;
|
||||
}
|
||||
if(identifier == getReceiveIdentifier())
|
||||
{
|
||||
mReceiveIdentifierProvider = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitIdentifier();
|
||||
identifiers[ 1 ] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
identifiers[0] = getTransmitIdentifier();
|
||||
identifiers[1] = getReceiveIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierProvider,
|
||||
getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierProvider != null)
|
||||
{
|
||||
return mTransmitIdentifierProvider.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierProvider,
|
||||
getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierProvider != null)
|
||||
{
|
||||
return mReceiveIdentifierProvider.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,53 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public abstract class ChannelGrant extends ServiceMessage
|
||||
implements IdentifierReceiver
|
||||
public abstract class ChannelGrant extends ServiceMessage implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] PRIORITY = { 85,86,87 };
|
||||
public static final int[] CHANNEL_IDENTIFIER = { 88,89,90,91 };
|
||||
public static final int[] CHANNEL_NUMBER = { 92,93,94,95,96,97,98,99,100,
|
||||
101,102,103 };
|
||||
|
||||
public static final int[] PRIORITY = {85, 86, 87};
|
||||
public static final int[] CHANNEL_IDENTIFIER = {88, 89, 90, 91};
|
||||
public static final int[] CHANNEL_NUMBER = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public ChannelGrant( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
|
||||
public ChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this channel grant is for a TDMA channel
|
||||
*/
|
||||
public boolean isTDMAChannel()
|
||||
{
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -28,47 +55,56 @@ public abstract class ChannelGrant extends ServiceMessage
|
||||
*/
|
||||
public int getPriority()
|
||||
{
|
||||
return mMessage.getInt( PRIORITY );
|
||||
return mMessage.getInt(PRIORITY);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_IDENTIFIER );
|
||||
return mMessage.getInt(CHANNEL_IDENTIFIER);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_NUMBER );
|
||||
return mMessage.getInt(CHANNEL_NUMBER);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getChannelIdentifier() + "-" + getChannelNumber();
|
||||
return getChannelIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
identifiers[ 0 ] = getChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
int[] identifiers = new int[1];
|
||||
identifiers[0] = getChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,120 +1,155 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
|
||||
public abstract class GroupChannelGrantExplicit extends ChannelGrant
|
||||
{
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 96,97,98,99 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 100,101,102,103,
|
||||
104,105,106,107,108,109,110,111 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 112,113,114,115 };
|
||||
public static final int[] RECEIVE_NUMBER = { 116,117,118,119,
|
||||
120,121,122,123,124,125,126,127 };
|
||||
public static final int[] GROUP_ADDRESS = { 128,129,130,131,132,133,134,135,
|
||||
136,137,138,139,140,141,142,143 };
|
||||
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {96, 97, 98, 99};
|
||||
public static final int[] TRANSMIT_NUMBER = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {112, 113, 114, 115};
|
||||
public static final int[] RECEIVE_NUMBER = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127};
|
||||
public static final int[] GROUP_ADDRESS = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
|
||||
142, 143};
|
||||
|
||||
private IBandIdentifier mTransmitIdentifierUpdate;
|
||||
private IBandIdentifier mReceiveIdentifierUpdate;
|
||||
|
||||
public GroupChannelGrantExplicit( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
public GroupChannelGrantExplicit(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTDMAChannel()
|
||||
{
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " XMIT:" );
|
||||
sb.append( getTransmitChannelIdentifier() + "/" + getTransmitChannelNumber() );
|
||||
|
||||
sb.append( " RCV:" );
|
||||
sb.append( getReceiveChannelIdentifier() + "/" + getReceiveChannelNumber() );
|
||||
|
||||
sb.append( " GRP:" );
|
||||
sb.append( getGroupAddress() );
|
||||
|
||||
|
||||
sb.append(" XMIT:");
|
||||
sb.append(getTransmitChannelIdentifier() + "/" + getTransmitChannelNumber());
|
||||
|
||||
sb.append(" RCV:");
|
||||
sb.append(getReceiveChannelIdentifier() + "/" + getReceiveChannelNumber());
|
||||
|
||||
sb.append(" GRP:");
|
||||
sb.append(getGroupAddress());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getGroupAddress()
|
||||
{
|
||||
return mMessage.getHex(GROUP_ADDRESS, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mTransmitIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mReceiveIdentifierUpdate = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
identifiers[ 0 ] = getTransmitChannelIdentifier();
|
||||
identifiers[ 1 ] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
identifiers[0] = getTransmitChannelIdentifier();
|
||||
identifiers[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mTransmitIdentifierUpdate, getTransmitChannelNumber() );
|
||||
if(mTransmitIdentifierUpdate != null)
|
||||
{
|
||||
return mTransmitIdentifierUpdate.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mReceiveIdentifierUpdate, getReceiveChannelNumber() );
|
||||
if(mReceiveIdentifierUpdate != null)
|
||||
{
|
||||
return mReceiveIdentifierUpdate.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,106 +1,116 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public abstract class GroupMultiChannelGrant extends ChannelGrant
|
||||
implements IdentifierReceiver
|
||||
public abstract class GroupMultiChannelGrant extends ChannelGrant implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] CHANNEL_IDENTIFIER_1 = { 80,81,82,83 };
|
||||
public static final int[] CHANNEL_NUMBER_1 = { 84,85,86,87,
|
||||
88,89,90,91,92,93,94,95 };
|
||||
public static final int[] GROUP_ADDRESS_1 = { 96,97,98,99,100,101,102,103,
|
||||
104,105,106,107,108,109,110,111 };
|
||||
|
||||
public static final int[] CHANNEL_IDENTIFIER_2 = { 112,113,114,115 };
|
||||
public static final int[] CHANNEL_NUMBER_2 = { 116,117,118,119,120,121,122,
|
||||
123,124,125,126,127 };
|
||||
public static final int[] GROUP_ADDRESS_2 = { 128,129,130,131,132,133,134,
|
||||
135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
public static final int[] CHANNEL_IDENTIFIER_1 = {80, 81, 82, 83};
|
||||
public static final int[] CHANNEL_NUMBER_1 = {84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95};
|
||||
public static final int[] GROUP_ADDRESS_1 = {96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] CHANNEL_IDENTIFIER_2 = {112, 113, 114, 115};
|
||||
public static final int[] CHANNEL_NUMBER_2 = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127};
|
||||
public static final int[] GROUP_ADDRESS_2 = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate1;
|
||||
private IBandIdentifier mIdentifierUpdate2;
|
||||
|
||||
public GroupMultiChannelGrant( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
public GroupMultiChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " CHAN1:" );
|
||||
sb.append( getChannelIdentifier1() + "/" + getChannelNumber1() );
|
||||
|
||||
sb.append( " GRP1:" );
|
||||
sb.append( getGroupAddress1() );
|
||||
|
||||
if( hasChannelNumber2() )
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" CHAN1:");
|
||||
sb.append(getChannelIdentifier1() + "/" + getChannelNumber1());
|
||||
|
||||
sb.append(" GRP1:");
|
||||
sb.append(getGroupAddress1());
|
||||
|
||||
if(hasChannelNumber2())
|
||||
{
|
||||
sb.append( " CHAN2:" );
|
||||
sb.append( getChannelIdentifier2() + "/" + getChannelNumber2() );
|
||||
|
||||
sb.append( " GRP2:" );
|
||||
sb.append( getGroupAddress2() );
|
||||
sb.append(" CHAN2:");
|
||||
sb.append(getChannelIdentifier2() + "/" + getChannelNumber2());
|
||||
|
||||
sb.append(" GRP2:");
|
||||
sb.append(getGroupAddress2());
|
||||
}
|
||||
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public int getChannelIdentifier1()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_IDENTIFIER_1 );
|
||||
return mMessage.getInt(CHANNEL_IDENTIFIER_1);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelNumber1()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_NUMBER_1 );
|
||||
return mMessage.getInt(CHANNEL_NUMBER_1);
|
||||
}
|
||||
|
||||
|
||||
public String getChannel1()
|
||||
{
|
||||
return getChannelIdentifier1() + "-" + getChannelNumber1();
|
||||
return getChannelIdentifier1() + "-" + getChannelNumber1();
|
||||
}
|
||||
|
||||
|
||||
public String getGroupAddress1()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_1, 4 );
|
||||
return mMessage.getHex(GROUP_ADDRESS_1, 4);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelIdentifier2()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_IDENTIFIER_2 );
|
||||
return mMessage.getInt(CHANNEL_IDENTIFIER_2);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelNumber2()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_NUMBER_2 );
|
||||
return mMessage.getInt(CHANNEL_NUMBER_2);
|
||||
}
|
||||
|
||||
|
||||
public String getChannel2()
|
||||
{
|
||||
return getChannelIdentifier2() + "-" + getChannelNumber2();
|
||||
return getChannelIdentifier2() + "-" + getChannelNumber2();
|
||||
}
|
||||
|
||||
|
||||
public String getGroupAddress2()
|
||||
{
|
||||
return mMessage.getHex( GROUP_ADDRESS_2, 4 );
|
||||
return mMessage.getHex(GROUP_ADDRESS_2, 4);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasChannelNumber2()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_NUMBER_2 ) !=
|
||||
mMessage.getInt( CHANNEL_NUMBER_1 );
|
||||
return mMessage.getInt(CHANNEL_NUMBER_2) !=
|
||||
mMessage.getInt(CHANNEL_NUMBER_1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getFromID()
|
||||
{
|
||||
@@ -112,59 +122,99 @@ public abstract class GroupMultiChannelGrant extends ChannelGrant
|
||||
{
|
||||
return getGroupAddress2();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getChannelIdentifier1() )
|
||||
{
|
||||
mIdentifierUpdate1 = message;
|
||||
}
|
||||
|
||||
if( hasChannelNumber2() && identifier == getChannelIdentifier2() )
|
||||
{
|
||||
mIdentifierUpdate2 = message;
|
||||
}
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getChannelIdentifier1())
|
||||
{
|
||||
mIdentifierUpdate1 = message;
|
||||
}
|
||||
|
||||
if(hasChannelNumber2() && identifier == getChannelIdentifier2())
|
||||
{
|
||||
mIdentifierUpdate2 = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers;
|
||||
|
||||
if( hasChannelNumber2() )
|
||||
{
|
||||
identifiers = new int[ 2 ];
|
||||
identifiers[ 0 ] = getChannelIdentifier1();
|
||||
identifiers[ 1 ] = getChannelIdentifier2();
|
||||
}
|
||||
else
|
||||
{
|
||||
identifiers = new int[ 1 ];
|
||||
identifiers[ 0 ] = getChannelIdentifier1();
|
||||
}
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers;
|
||||
|
||||
if(hasChannelNumber2())
|
||||
{
|
||||
identifiers = new int[2];
|
||||
identifiers[0] = getChannelIdentifier1();
|
||||
identifiers[1] = getChannelIdentifier2();
|
||||
}
|
||||
else
|
||||
{
|
||||
identifiers = new int[1];
|
||||
identifiers[0] = getChannelIdentifier1();
|
||||
}
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency1()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate1, getChannelNumber1() );
|
||||
if(mIdentifierUpdate1 != null)
|
||||
{
|
||||
return mIdentifierUpdate1.getDownlinkFrequency(getChannelNumber1());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTDMAChannel1()
|
||||
{
|
||||
if(mIdentifierUpdate1 != null)
|
||||
{
|
||||
return mIdentifierUpdate1.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency1()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate1, getChannelNumber1() );
|
||||
if(mIdentifierUpdate1 != null)
|
||||
{
|
||||
return mIdentifierUpdate1.getUplinkFrequency(getChannelNumber1());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency2()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate2, getChannelNumber2() );
|
||||
if(mIdentifierUpdate2 != null)
|
||||
{
|
||||
return mIdentifierUpdate2.getDownlinkFrequency(getChannelNumber2());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTDMAChannel2()
|
||||
{
|
||||
if(mIdentifierUpdate2 != null)
|
||||
{
|
||||
return mIdentifierUpdate2.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency2()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate2, getChannelNumber2() );
|
||||
if(mIdentifierUpdate2 != null)
|
||||
{
|
||||
return mIdentifierUpdate2.getUplinkFrequency(getChannelNumber2());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,55 +1,70 @@
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.Alias;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
|
||||
public abstract class UnitChannelGrant extends ChannelGrant
|
||||
{
|
||||
public static final int[] TARGET_ADDRESS = { 96,97,98,99,100,101,102,103,
|
||||
104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119 };
|
||||
|
||||
public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126,
|
||||
127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
public UnitChannelGrant( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
public static final int[] TARGET_ADDRESS = {96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
|
||||
111, 112, 113, 114, 115, 116, 117, 118, 119};
|
||||
public static final int[] SOURCE_ADDRESS = {120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
|
||||
134, 135, 136, 137, 138, 139, 140, 141, 142, 143};
|
||||
|
||||
public UnitChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " FROM:" );
|
||||
sb.append( getSourceAddress() );
|
||||
|
||||
sb.append( " TO:" );
|
||||
sb.append( getTargetAddress() );
|
||||
|
||||
|
||||
sb.append(" FROM:");
|
||||
sb.append(getSourceAddress());
|
||||
|
||||
sb.append(" TO:");
|
||||
sb.append(getTargetAddress());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
return mMessage.getHex(TARGET_ADDRESS, 6);
|
||||
}
|
||||
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
return mMessage.getHex(SOURCE_ADDRESS, 6);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getFromID()
|
||||
{
|
||||
@@ -59,11 +74,11 @@ public abstract class UnitChannelGrant extends ChannelGrant
|
||||
@Override
|
||||
public Alias getFromIDAlias()
|
||||
{
|
||||
if( mAliasList != null )
|
||||
if(mAliasList != null)
|
||||
{
|
||||
return mAliasList.getTalkgroupAlias( getFromID() );
|
||||
return mAliasList.getTalkgroupAlias(getFromID());
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +1,48 @@
|
||||
/*******************************************************************************
|
||||
* 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.motorola;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class ControlChannelBaseStationIdentification extends MotorolaTSBKMessage
|
||||
implements IdentifierReceiver
|
||||
public class ControlChannelBaseStationIdentification extends MotorolaTSBKMessage implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] CHARACTER_1 = { 80,81,82,83,84,85 };
|
||||
public static final int[] CHARACTER_2 = { 86,87,88,89,90,91 };
|
||||
public static final int[] CHARACTER_3 = { 92,93,94,95,96,97 };
|
||||
public static final int[] CHARACTER_4 = { 98,99,100,101,102,103 };
|
||||
public static final int[] CHARACTER_5 = { 104,105,106,107,108,109 };
|
||||
public static final int[] CHARACTER_6 = { 110,111,112,113,114,115 };
|
||||
public static final int[] CHARACTER_7 = { 116,117,118,119,120,121 };
|
||||
public static final int[] CHARACTER_8 = { 122,123,124,125,126,127 };
|
||||
|
||||
public static final int[] IDENTIFIER = { 128,129,130,131 };
|
||||
public static final int[] CHANNEL = { 132,133,134,135,136,137,138,139,140,
|
||||
141,142,143 };
|
||||
|
||||
public static final int[] CHARACTER_1 = {80, 81, 82, 83, 84, 85};
|
||||
public static final int[] CHARACTER_2 = {86, 87, 88, 89, 90, 91};
|
||||
public static final int[] CHARACTER_3 = {92, 93, 94, 95, 96, 97};
|
||||
public static final int[] CHARACTER_4 = {98, 99, 100, 101, 102, 103};
|
||||
public static final int[] CHARACTER_5 = {104, 105, 106, 107, 108, 109};
|
||||
public static final int[] CHARACTER_6 = {110, 111, 112, 113, 114, 115};
|
||||
public static final int[] CHARACTER_7 = {116, 117, 118, 119, 120, 121};
|
||||
public static final int[] CHARACTER_8 = {122, 123, 124, 125, 126, 127};
|
||||
|
||||
public static final int[] IDENTIFIER = {128, 129, 130, 131};
|
||||
public static final int[] CHANNEL = {132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public ControlChannelBaseStationIdentification( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
|
||||
public ControlChannelBaseStationIdentification(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -36,86 +50,96 @@ public class ControlChannelBaseStationIdentification extends MotorolaTSBKMessage
|
||||
{
|
||||
return MotorolaOpcode.CONTROL_CHANNEL_ID.getDescription();
|
||||
}
|
||||
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
sb.append( " CHAN:" + getIdentifier() + "-" + getChannel() );
|
||||
|
||||
sb.append( " CWID:" + getCWID() );
|
||||
|
||||
sb.append( " DN:" + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " UP:" + getUplinkFrequency() );
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
sb.append(" CHAN:" + getIdentifier() + "-" + getChannel());
|
||||
|
||||
sb.append(" CWID:" + getCWID());
|
||||
|
||||
sb.append(" DN:" + getDownlinkFrequency());
|
||||
|
||||
sb.append(" UP:" + getUplinkFrequency());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getCWID()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getCharacter( CHARACTER_1 ) );
|
||||
sb.append( getCharacter( CHARACTER_2 ) );
|
||||
sb.append( getCharacter( CHARACTER_3 ) );
|
||||
sb.append( getCharacter( CHARACTER_4 ) );
|
||||
sb.append( getCharacter( CHARACTER_5 ) );
|
||||
sb.append( getCharacter( CHARACTER_6 ) );
|
||||
sb.append( getCharacter( CHARACTER_7 ) );
|
||||
sb.append( getCharacter( CHARACTER_8 ) );
|
||||
|
||||
return sb.toString();
|
||||
sb.append(getCharacter(CHARACTER_1));
|
||||
sb.append(getCharacter(CHARACTER_2));
|
||||
sb.append(getCharacter(CHARACTER_3));
|
||||
sb.append(getCharacter(CHARACTER_4));
|
||||
sb.append(getCharacter(CHARACTER_5));
|
||||
sb.append(getCharacter(CHARACTER_6));
|
||||
sb.append(getCharacter(CHARACTER_7));
|
||||
sb.append(getCharacter(CHARACTER_8));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String getCharacter( int[] field )
|
||||
|
||||
private String getCharacter(int[] field)
|
||||
{
|
||||
int value = mMessage.getInt( field );
|
||||
|
||||
if( value != 0 )
|
||||
{
|
||||
return String.valueOf( (char)( value + 43 ) );
|
||||
}
|
||||
|
||||
return null;
|
||||
int value = mMessage.getInt(field);
|
||||
|
||||
if(value != 0)
|
||||
{
|
||||
return String.valueOf((char)(value + 43));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public int getIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
|
||||
public int getChannel()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannel() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
mIdentifierUpdate.getUplinkFrequency(getChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannel() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
mIdentifierUpdate.getDownlinkFrequency(getChannel());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
|
||||
identifiers[ 0 ] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
|
||||
identifiers[0] = getIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,151 +1,187 @@
|
||||
/*******************************************************************************
|
||||
* 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.motorola;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PatchGroupVoiceChannelGrant extends MotorolaTSBKMessage
|
||||
implements IdentifierReceiver
|
||||
public class PatchGroupVoiceChannelGrant extends MotorolaTSBKMessage implements IdentifierReceiver
|
||||
{
|
||||
/* Service Options */
|
||||
public static final int EMERGENCY_FLAG = 80;
|
||||
public static final int ENCRYPTED_CHANNEL_FLAG = 81;
|
||||
public static final int DUPLEX_MODE = 82;
|
||||
public static final int SESSION_MODE = 83;
|
||||
|
||||
public static final int[] PRIORITY = { 85,86,87 };
|
||||
public static final int[] IDENTIFIER = { 88,89,90,91 };
|
||||
public static final int[] CHANNEL = { 92,93,94,95,96,97,98,99,100,101,102,103 };
|
||||
public static final int[] PATCH_GROUP_ADDRESS = { 104,105,106,107,108,109,
|
||||
110,111,112,113,114,115,116,117,118,119 };
|
||||
public static final int[] SOURCE_ADDRESS = { 120,121,122,123,124,125,126,
|
||||
127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
public static final int[] PRIORITY = {85, 86, 87};
|
||||
public static final int[] IDENTIFIER = {88, 89, 90, 91};
|
||||
public static final int[] CHANNEL = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103};
|
||||
public static final int[] PATCH_GROUP_ADDRESS = {104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
|
||||
117, 118, 119};
|
||||
public static final int[] SOURCE_ADDRESS = {120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
|
||||
134, 135, 136, 137, 138, 139, 140, 141, 142, 143};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate;
|
||||
|
||||
public PatchGroupVoiceChannelGrant( BinaryMessage message, DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
public PatchGroupVoiceChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTDMAChannel()
|
||||
{
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.PATCH_GROUP_CHANNEL_GRANT.getLabel();
|
||||
return MotorolaOpcode.PATCH_GROUP_CHANNEL_GRANT.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
|
||||
sb.append( " PATCH GROUP:" );
|
||||
sb.append( getPatchGroupAddress() );
|
||||
sb.append( " FROM:" );
|
||||
sb.append( getSourceAddress() );
|
||||
sb.append( " PRI:" );
|
||||
sb.append( getPriority() );
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append( " CHAN:" );
|
||||
sb.append( getChannelIdentifier() + "-" + getChannelNumber() );
|
||||
|
||||
sb.append( " DN:" + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " UP:" + getUplinkFrequency() );
|
||||
sb.append(" PATCH GROUP:");
|
||||
sb.append(getPatchGroupAddress());
|
||||
sb.append(" FROM:");
|
||||
sb.append(getSourceAddress());
|
||||
sb.append(" PRI:");
|
||||
sb.append(getPriority());
|
||||
|
||||
sb.append( " SESSION MODE:");
|
||||
sb.append( getSessionMode().name() );
|
||||
|
||||
return sb.toString();
|
||||
sb.append(" CHAN:");
|
||||
sb.append(getChannelIdentifier() + "-" + getChannelNumber());
|
||||
|
||||
sb.append(" DN:" + getDownlinkFrequency());
|
||||
|
||||
sb.append(" UP:" + getUplinkFrequency());
|
||||
|
||||
sb.append(" SESSION MODE:");
|
||||
sb.append(getSessionMode().name());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getPatchGroupAddress()
|
||||
{
|
||||
return mMessage.getHex( PATCH_GROUP_ADDRESS, 4 );
|
||||
return mMessage.getHex(PATCH_GROUP_ADDRESS, 4);
|
||||
}
|
||||
|
||||
|
||||
public String getSourceAddress()
|
||||
{
|
||||
return mMessage.getHex( SOURCE_ADDRESS, 6 );
|
||||
return mMessage.getHex(SOURCE_ADDRESS, 6);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEmergency()
|
||||
{
|
||||
return mMessage.get( EMERGENCY_FLAG );
|
||||
return mMessage.get(EMERGENCY_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public boolean isEncryptedChannel()
|
||||
{
|
||||
return mMessage.get( ENCRYPTED_CHANNEL_FLAG );
|
||||
return mMessage.get(ENCRYPTED_CHANNEL_FLAG);
|
||||
}
|
||||
|
||||
|
||||
public DuplexMode getDuplexMode()
|
||||
{
|
||||
return mMessage.get( DUPLEX_MODE ) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
return mMessage.get(DUPLEX_MODE) ? DuplexMode.FULL : DuplexMode.HALF;
|
||||
}
|
||||
|
||||
public SessionMode getSessionMode()
|
||||
{
|
||||
return mMessage.get( SESSION_MODE ) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
return mMessage.get(SESSION_MODE) ?
|
||||
SessionMode.CIRCUIT : SessionMode.PACKET;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 1 = Lowest, 4 = Default, 7 = Highest
|
||||
*/
|
||||
public int getPriority()
|
||||
{
|
||||
return mMessage.getInt( PRIORITY );
|
||||
return mMessage.getInt(PRIORITY);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER );
|
||||
return mMessage.getInt(IDENTIFIER);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL );
|
||||
return mMessage.getInt(CHANNEL);
|
||||
}
|
||||
|
||||
public String getChannel()
|
||||
{
|
||||
return getChannelIdentifier() + "-" + getChannelNumber();
|
||||
return getChannelIdentifier() + "-" + getChannelNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
mIdentifierUpdate = message;
|
||||
mIdentifierUpdate = message;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 1 ];
|
||||
identifiers[ 0 ] = getChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[1];
|
||||
identifiers[0] = getChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getDownlinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate, getChannelNumber() );
|
||||
if(mIdentifierUpdate != null)
|
||||
{
|
||||
return mIdentifierUpdate.getUplinkFrequency(getChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,146 +1,197 @@
|
||||
/*******************************************************************************
|
||||
* 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.motorola;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class PatchGroupVoiceChannelGrantUpdate extends MotorolaTSBKMessage
|
||||
implements IdentifierReceiver
|
||||
public class PatchGroupVoiceChannelGrantUpdate extends MotorolaTSBKMessage implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] IDENTIFIER_1 = { 80,81,82,83 };
|
||||
public static final int[] CHANNEL_1 = { 84,85,86,87,88,89,90,91,92,93,94,
|
||||
95 };
|
||||
public static final int[] PATCH_GROUP_ADDRESS_1 = { 96,97,98,99,100,101,102,
|
||||
103,104,105,106,107,108,109,110,111 };
|
||||
public static final int[] IDENTIFIER_2 = { 112,113,114,115 };
|
||||
public static final int[] CHANNEL_2 = { 116,117,118,119,120,121,122,123,
|
||||
124,125,126,127 };
|
||||
public static final int[] PATCH_GROUP_ADDRESS_2 = { 128,129,130,131,132,133,
|
||||
134,135,136,137,138,139,140,141,142,143 };
|
||||
public static final int[] IDENTIFIER_1 = {80, 81, 82, 83};
|
||||
public static final int[] CHANNEL_1 = {84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95};
|
||||
public static final int[] PATCH_GROUP_ADDRESS_1 = {96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] IDENTIFIER_2 = {112, 113, 114, 115};
|
||||
public static final int[] CHANNEL_2 = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127};
|
||||
public static final int[] PATCH_GROUP_ADDRESS_2 = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdate1;
|
||||
private IBandIdentifier mIdentifierUpdate2;
|
||||
|
||||
public PatchGroupVoiceChannelGrantUpdate( BinaryMessage message,
|
||||
DataUnitID duid, AliasList aliasList )
|
||||
public PatchGroupVoiceChannelGrantUpdate(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getEventType()
|
||||
{
|
||||
return MotorolaOpcode.PATCH_GROUP_CHANNEL_GRANT_UPDATE.getLabel();
|
||||
return MotorolaOpcode.PATCH_GROUP_CHANNEL_GRANT_UPDATE.getLabel();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
sb.append(getMessageStub());
|
||||
|
||||
|
||||
sb.append( " PATCH GRP1:" );
|
||||
sb.append( getPatchGroupAddress1() );
|
||||
sb.append( " GRP2:" );
|
||||
sb.append( getPatchGroupAddress2() );
|
||||
|
||||
sb.append( " CHAN 1:" );
|
||||
sb.append( getChannel1() );
|
||||
sb.append( " DN:" + getDownlinkFrequency1() );
|
||||
|
||||
sb.append( " CHAN 2:" );
|
||||
sb.append( getChannel2() );
|
||||
sb.append( " DN:" + getDownlinkFrequency2() );
|
||||
|
||||
return sb.toString();
|
||||
sb.append(" PATCH GRP1:");
|
||||
sb.append(getPatchGroupAddress1());
|
||||
sb.append(" GRP2:");
|
||||
sb.append(getPatchGroupAddress2());
|
||||
|
||||
sb.append(" CHAN 1:");
|
||||
sb.append(getChannel1());
|
||||
sb.append(" DN:" + getDownlinkFrequency1());
|
||||
|
||||
sb.append(" CHAN 2:");
|
||||
sb.append(getChannel2());
|
||||
sb.append(" DN:" + getDownlinkFrequency2());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public String getPatchGroupAddress1()
|
||||
{
|
||||
return mMessage.getHex( PATCH_GROUP_ADDRESS_1, 4 );
|
||||
return mMessage.getHex(PATCH_GROUP_ADDRESS_1, 4);
|
||||
}
|
||||
|
||||
|
||||
public String getPatchGroupAddress2()
|
||||
{
|
||||
return mMessage.getHex( PATCH_GROUP_ADDRESS_2, 4 );
|
||||
return mMessage.getHex(PATCH_GROUP_ADDRESS_2, 4);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelIdentifier1()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_1 );
|
||||
return mMessage.getInt(IDENTIFIER_1);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelNumber1()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_1 );
|
||||
return mMessage.getInt(CHANNEL_1);
|
||||
}
|
||||
|
||||
public String getChannel1()
|
||||
{
|
||||
return getChannelIdentifier1() + "-" + getChannelNumber1();
|
||||
return getChannelIdentifier1() + "-" + getChannelNumber1();
|
||||
}
|
||||
|
||||
public int getChannelIdentifier2()
|
||||
{
|
||||
return mMessage.getInt( IDENTIFIER_2 );
|
||||
return mMessage.getInt(IDENTIFIER_2);
|
||||
}
|
||||
|
||||
|
||||
public int getChannelNumber2()
|
||||
{
|
||||
return mMessage.getInt( CHANNEL_2 );
|
||||
return mMessage.getInt(CHANNEL_2);
|
||||
}
|
||||
|
||||
public String getChannel2()
|
||||
{
|
||||
return getChannelIdentifier2() + "-" + getChannelNumber2();
|
||||
return getChannelIdentifier2() + "-" + getChannelNumber2();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if( identifier == getChannelIdentifier1() )
|
||||
{
|
||||
mIdentifierUpdate1 = message;
|
||||
}
|
||||
|
||||
if( identifier == getChannelIdentifier2() )
|
||||
{
|
||||
mIdentifierUpdate2 = message;
|
||||
}
|
||||
if(identifier == getChannelIdentifier1())
|
||||
{
|
||||
mIdentifierUpdate1 = message;
|
||||
}
|
||||
|
||||
if(identifier == getChannelIdentifier2())
|
||||
{
|
||||
mIdentifierUpdate2 = message;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
identifiers[ 0 ] = getChannelIdentifier1();
|
||||
identifiers[ 1 ] = getChannelIdentifier2();
|
||||
|
||||
return identifiers;
|
||||
int[] identifiers = new int[2];
|
||||
identifiers[0] = getChannelIdentifier1();
|
||||
identifiers[1] = getChannelIdentifier2();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency1()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate1, getChannelNumber1() );
|
||||
if(mIdentifierUpdate1 != null)
|
||||
{
|
||||
return mIdentifierUpdate1.getDownlinkFrequency(getChannelNumber1());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTDMAChannel1()
|
||||
{
|
||||
if(mIdentifierUpdate1 != null)
|
||||
{
|
||||
return mIdentifierUpdate1.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency1()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate1, getChannelNumber1() );
|
||||
if(mIdentifierUpdate1 != null)
|
||||
{
|
||||
return mIdentifierUpdate1.getUplinkFrequency(getChannelNumber1());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getDownlinkFrequency2()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdate2, getChannelNumber2() );
|
||||
if(mIdentifierUpdate2 != null)
|
||||
{
|
||||
return mIdentifierUpdate2.getDownlinkFrequency(getChannelNumber2());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public boolean isTDMAChannel2()
|
||||
{
|
||||
if(mIdentifierUpdate2 != null)
|
||||
{
|
||||
return mIdentifierUpdate2.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public long getUplinkFrequency2()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdate2, getChannelNumber2() );
|
||||
if(mIdentifierUpdate2 != null)
|
||||
{
|
||||
return mIdentifierUpdate2.getUplinkFrequency(getChannelNumber2());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
/*******************************************************************************
|
||||
* 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.data;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.tsbk.GroupChannelGrant;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import module.decode.p25.reference.Opcode;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class GroupDataChannelGrant extends GroupChannelGrant
|
||||
|
||||
{
|
||||
public GroupDataChannelGrant( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
public GroupDataChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,151 +1,178 @@
|
||||
/*******************************************************************************
|
||||
* 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.data;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class SNDCPDataChannelAnnouncementExplicit extends SNDCPData implements IdentifierReceiver
|
||||
{
|
||||
public static final int AUTONOMOUS_ACCESS_AVAILABLE_INDICATOR = 88;
|
||||
public static final int REQUESTED_ACCESS_AVAILABLE_INDICATOR = 89;
|
||||
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 96,97,98,99 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 100,101,102,103,104,105,106, 107,108,109,110,111 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 112,113,114,115 };
|
||||
public static final int[] RECEIVE_NUMBER = { 116,117,118,119,120,121,122, 123,124,125,126,127 };
|
||||
public static final int[] DATA_ACCESS_CONTROL = { 128,129,130,131,132,133, 134,135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
public static final int AUTONOMOUS_ACCESS_AVAILABLE_INDICATOR = 88;
|
||||
public static final int REQUESTED_ACCESS_AVAILABLE_INDICATOR = 89;
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {96, 97, 98, 99};
|
||||
public static final int[] TRANSMIT_NUMBER = {100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {112, 113, 114, 115};
|
||||
public static final int[] RECEIVE_NUMBER = {116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127};
|
||||
public static final int[] DATA_ACCESS_CONTROL = {128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdateTransmit;
|
||||
private IBandIdentifier mIdentifierUpdateReceive;
|
||||
|
||||
public SNDCPDataChannelAnnouncementExplicit( BinaryMessage message, DataUnitID duid, AliasList aliasList )
|
||||
public SNDCPDataChannelAnnouncementExplicit(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
if( isAutonomousAccessAvailable() )
|
||||
|
||||
if(isAutonomousAccessAvailable())
|
||||
{
|
||||
sb.append( " AUTONOMOUS ACCESS" );
|
||||
sb.append(" AUTONOMOUS ACCESS");
|
||||
}
|
||||
|
||||
if( isRequestedAccessAvailable() )
|
||||
|
||||
if(isRequestedAccessAvailable())
|
||||
{
|
||||
sb.append( " DOWNLINK:" );
|
||||
sb.append( getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber() );
|
||||
|
||||
sb.append( " " + getUplinkFrequency() );
|
||||
|
||||
sb.append( " UPLINK:" );
|
||||
sb.append( getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber() );
|
||||
|
||||
sb.append( " " + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " DATA ACCESS CONTROL:" );
|
||||
sb.append(" DOWNLINK:");
|
||||
sb.append(getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber());
|
||||
|
||||
sb.append(" " + getUplinkFrequency());
|
||||
|
||||
sb.append(" UPLINK:");
|
||||
sb.append(getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber());
|
||||
|
||||
sb.append(" " + getDownlinkFrequency());
|
||||
|
||||
sb.append(" DATA ACCESS CONTROL:");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.append( " ACCESS DENIED TO DATA ACCESS CONTROL:" );
|
||||
sb.append(" ACCESS DENIED TO DATA ACCESS CONTROL:");
|
||||
}
|
||||
|
||||
sb.append( getDataAccessControl() );
|
||||
|
||||
|
||||
sb.append(getDataAccessControl());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isAutonomousAccessAvailable()
|
||||
{
|
||||
return mMessage.get( AUTONOMOUS_ACCESS_AVAILABLE_INDICATOR );
|
||||
return mMessage.get(AUTONOMOUS_ACCESS_AVAILABLE_INDICATOR);
|
||||
}
|
||||
|
||||
|
||||
public boolean isRequestedAccessAvailable()
|
||||
{
|
||||
return mMessage.get( REQUESTED_ACCESS_AVAILABLE_INDICATOR );
|
||||
return mMessage.get(REQUESTED_ACCESS_AVAILABLE_INDICATOR);
|
||||
}
|
||||
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
|
||||
public String getDataAccessControl()
|
||||
{
|
||||
return mMessage.getHex( DATA_ACCESS_CONTROL, 4 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mIdentifierUpdateTransmit = message;
|
||||
}
|
||||
else if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mIdentifierUpdateReceive = message;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException( "unexpected channel band "
|
||||
+ "identifier [" + identifier + "]" );
|
||||
}
|
||||
return mMessage.getHex(DATA_ACCESS_CONTROL, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mIdentifierUpdateTransmit = message;
|
||||
}
|
||||
else if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mIdentifierUpdateReceive = message;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("unexpected channel band "
|
||||
+ "identifier [" + identifier + "]");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitChannelIdentifier();
|
||||
identifiers[ 1 ] = getReceiveChannelIdentifier();
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
return identifiers;
|
||||
identifiers[0] = getTransmitChannelIdentifier();
|
||||
identifiers[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateTransmit, getTransmitChannelNumber() );
|
||||
if(mIdentifierUpdateTransmit != null)
|
||||
{
|
||||
return mIdentifierUpdateTransmit.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateReceive, getReceiveChannelNumber() );
|
||||
if(mIdentifierUpdateReceive != null)
|
||||
{
|
||||
mIdentifierUpdateReceive.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,131 +1,164 @@
|
||||
/*******************************************************************************
|
||||
* 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.data;
|
||||
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
import module.decode.p25.message.IBandIdentifier;
|
||||
import module.decode.p25.message.IdentifierReceiver;
|
||||
import module.decode.p25.reference.DataUnitID;
|
||||
import alias.AliasList;
|
||||
import bits.BinaryMessage;
|
||||
|
||||
public class SNDCPDataChannelGrant extends SNDCPData implements IdentifierReceiver
|
||||
{
|
||||
public static final int[] TRANSMIT_IDENTIFIER = { 88,89,90,91 };
|
||||
public static final int[] TRANSMIT_NUMBER = { 92,93,94,95,96,97,98,99,100,
|
||||
101,102,103 };
|
||||
public static final int[] RECEIVE_IDENTIFIER = { 104,105,106,107 };
|
||||
public static final int[] RECEIVE_NUMBER = { 108,109,110,111,112,113,114,
|
||||
115,116,117,118,119 };
|
||||
|
||||
public static final int[] TARGET_ADDRESS = { 120,121,122,123,124,125,126,
|
||||
127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143 };
|
||||
|
||||
public static final int[] TRANSMIT_IDENTIFIER = {88, 89, 90, 91};
|
||||
public static final int[] TRANSMIT_NUMBER = {92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103};
|
||||
public static final int[] RECEIVE_IDENTIFIER = {104, 105, 106, 107};
|
||||
public static final int[] RECEIVE_NUMBER = {108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119};
|
||||
public static final int[] TARGET_ADDRESS = {120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
|
||||
134, 135, 136, 137, 138, 139, 140, 141, 142, 143};
|
||||
|
||||
private IBandIdentifier mIdentifierUpdateTransmit;
|
||||
private IBandIdentifier mIdentifierUpdateReceive;
|
||||
|
||||
public SNDCPDataChannelGrant( BinaryMessage message,
|
||||
DataUnitID duid,
|
||||
AliasList aliasList )
|
||||
public SNDCPDataChannelGrant(BinaryMessage message, DataUnitID duid, AliasList aliasList)
|
||||
{
|
||||
super( message, duid, aliasList );
|
||||
super(message, duid, aliasList);
|
||||
}
|
||||
|
||||
|
||||
public boolean isTDMAChannel()
|
||||
{
|
||||
if(mIdentifierUpdateTransmit != null)
|
||||
{
|
||||
return mIdentifierUpdateTransmit.isTDMA();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getMessage()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append( getMessageStub() );
|
||||
|
||||
if( isEmergency() )
|
||||
{
|
||||
sb.append( " EMERGENCY" );
|
||||
}
|
||||
|
||||
sb.append( " UPLINK:" );
|
||||
sb.append( getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber() );
|
||||
|
||||
sb.append( " " + getUplinkFrequency() );
|
||||
|
||||
sb.append( " DOWNLINK:" );
|
||||
sb.append( getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber() );
|
||||
|
||||
sb.append( " " + getDownlinkFrequency() );
|
||||
|
||||
sb.append( " TGT:" );
|
||||
sb.append( getTargetAddress() );
|
||||
|
||||
sb.append(getMessageStub());
|
||||
|
||||
if(isEmergency())
|
||||
{
|
||||
sb.append(" EMERGENCY");
|
||||
}
|
||||
|
||||
sb.append(" UPLINK:");
|
||||
sb.append(getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber());
|
||||
|
||||
sb.append(" " + getUplinkFrequency());
|
||||
|
||||
sb.append(" DOWNLINK:");
|
||||
sb.append(getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber());
|
||||
|
||||
sb.append(" " + getDownlinkFrequency());
|
||||
|
||||
sb.append(" TGT:");
|
||||
sb.append(getTargetAddress());
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public int getTransmitChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_IDENTIFIER );
|
||||
return mMessage.getInt(TRANSMIT_IDENTIFIER);
|
||||
}
|
||||
|
||||
|
||||
public int getTransmitChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( TRANSMIT_NUMBER );
|
||||
return mMessage.getInt(TRANSMIT_NUMBER);
|
||||
}
|
||||
|
||||
|
||||
public String getTransmitChannel()
|
||||
{
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
return getTransmitChannelIdentifier() + "-" + getTransmitChannelNumber();
|
||||
}
|
||||
|
||||
public int getReceiveChannelIdentifier()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_IDENTIFIER );
|
||||
return mMessage.getInt(RECEIVE_IDENTIFIER);
|
||||
}
|
||||
|
||||
|
||||
public int getReceiveChannelNumber()
|
||||
{
|
||||
return mMessage.getInt( RECEIVE_NUMBER );
|
||||
return mMessage.getInt(RECEIVE_NUMBER);
|
||||
}
|
||||
|
||||
|
||||
public String getReceiveChannel()
|
||||
{
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
return getReceiveChannelIdentifier() + "-" + getReceiveChannelNumber();
|
||||
}
|
||||
|
||||
public String getTargetAddress()
|
||||
{
|
||||
return mMessage.getHex( TARGET_ADDRESS, 6 );
|
||||
return mMessage.getHex(TARGET_ADDRESS, 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIdentifierMessage( int identifier, IBandIdentifier message )
|
||||
@Override
|
||||
public void setIdentifierMessage(int identifier, IBandIdentifier message)
|
||||
{
|
||||
if( identifier == getTransmitChannelIdentifier() )
|
||||
{
|
||||
mIdentifierUpdateTransmit = message;
|
||||
}
|
||||
else if( identifier == getReceiveChannelIdentifier() )
|
||||
{
|
||||
mIdentifierUpdateReceive = message;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException( "unexpected channel band "
|
||||
+ "identifier [" + identifier + "]" );
|
||||
}
|
||||
if(identifier == getTransmitChannelIdentifier())
|
||||
{
|
||||
mIdentifierUpdateTransmit = message;
|
||||
}
|
||||
else if(identifier == getReceiveChannelIdentifier())
|
||||
{
|
||||
mIdentifierUpdateReceive = message;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("unexpected channel band "
|
||||
+ "identifier [" + identifier + "]");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public int[] getIdentifiers()
|
||||
{
|
||||
int[] identifiers = new int[ 2 ];
|
||||
|
||||
identifiers[ 0 ] = getTransmitChannelIdentifier();
|
||||
identifiers[ 1 ] = getReceiveChannelIdentifier();
|
||||
int[] identifiers = new int[2];
|
||||
|
||||
return identifiers;
|
||||
identifiers[0] = getTransmitChannelIdentifier();
|
||||
identifiers[1] = getReceiveChannelIdentifier();
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public long getDownlinkFrequency()
|
||||
{
|
||||
return calculateDownlink( mIdentifierUpdateTransmit, getTransmitChannelNumber() );
|
||||
if(mIdentifierUpdateTransmit != null)
|
||||
{
|
||||
return mIdentifierUpdateTransmit.getDownlinkFrequency(getTransmitChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public long getUplinkFrequency()
|
||||
{
|
||||
return calculateUplink( mIdentifierUpdateReceive, getReceiveChannelNumber() );
|
||||
if(mIdentifierUpdateReceive != null)
|
||||
{
|
||||
return mIdentifierUpdateReceive.getUplinkFrequency(getReceiveChannelNumber());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user