mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 17:47:32 -05:00
Add filter button to messages (#1098)
Adds filtering to channel decoded events panel.
This commit is contained in:
@@ -46,13 +46,14 @@ public class FilterSet<T> implements IFilter<T>
|
|||||||
{
|
{
|
||||||
for( IFilter<T> filter: mFilters )
|
for( IFilter<T> filter: mFilters )
|
||||||
{
|
{
|
||||||
if( filter.canProcess( t ) )
|
// Make sure to loop through all filters.
|
||||||
|
// Only return if true or all filters have been evaluated.
|
||||||
|
if( filter.canProcess( t ) && filter.passes( t ))
|
||||||
{
|
{
|
||||||
return filter.passes( t );
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public class DecodeEvent implements IDecodeEvent
|
|||||||
private long mTimeStart;
|
private long mTimeStart;
|
||||||
private long mTimeEnd;
|
private long mTimeEnd;
|
||||||
private String mEventDescription;
|
private String mEventDescription;
|
||||||
|
private DecodeEventType mDecodeEventType;
|
||||||
private IdentifierCollection mIdentifierCollection;
|
private IdentifierCollection mIdentifierCollection;
|
||||||
private IChannelDescriptor mChannelDescriptor;
|
private IChannelDescriptor mChannelDescriptor;
|
||||||
private String mDetails;
|
private String mDetails;
|
||||||
@@ -131,6 +132,21 @@ public class DecodeEvent implements IDecodeEvent
|
|||||||
mEventDescription = description;
|
mEventDescription = description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link DecodeEventType}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DecodeEventType getEventType() {
|
||||||
|
return mDecodeEventType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the {@link DecodeEventType}
|
||||||
|
*/
|
||||||
|
public void setEventType(DecodeEventType eventType) {
|
||||||
|
this.mDecodeEventType = eventType;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identifier collection for this event.
|
* Identifier collection for this event.
|
||||||
*/
|
*/
|
||||||
@@ -252,6 +268,7 @@ public class DecodeEvent implements IDecodeEvent
|
|||||||
protected long mTimeStart;
|
protected long mTimeStart;
|
||||||
protected long mDuration;
|
protected long mDuration;
|
||||||
protected String mEventDescription;
|
protected String mEventDescription;
|
||||||
|
protected DecodeEventType mDecodeEventType;
|
||||||
protected IdentifierCollection mIdentifierCollection;
|
protected IdentifierCollection mIdentifierCollection;
|
||||||
protected IChannelDescriptor mChannelDescriptor;
|
protected IChannelDescriptor mChannelDescriptor;
|
||||||
protected String mDetails;
|
protected String mDetails;
|
||||||
@@ -296,6 +313,11 @@ public class DecodeEvent implements IDecodeEvent
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DecodeEventBuilder eventType(DecodeEventType eventType) {
|
||||||
|
mDecodeEventType = eventType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the event description text
|
* Sets the event description text
|
||||||
* @param description of the event
|
* @param description of the event
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ package io.github.dsheirer.module.decode.event;
|
|||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
import io.github.dsheirer.channel.IChannelDescriptor;
|
import io.github.dsheirer.channel.IChannelDescriptor;
|
||||||
import io.github.dsheirer.eventbus.MyEventBus;
|
import io.github.dsheirer.eventbus.MyEventBus;
|
||||||
|
import io.github.dsheirer.filter.FilterSet;
|
||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
|
import io.github.dsheirer.module.decode.event.filter.DecodeEventFilterSet;
|
||||||
|
import io.github.dsheirer.module.decode.event.filter.EventFilterProvider;
|
||||||
import io.github.dsheirer.preference.PreferenceType;
|
import io.github.dsheirer.preference.PreferenceType;
|
||||||
import io.github.dsheirer.sample.Listener;
|
import io.github.dsheirer.sample.Listener;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -35,7 +38,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class DecodeEventModel extends AbstractTableModel implements Listener<IDecodeEvent>
|
public class DecodeEventModel extends AbstractTableModel implements Listener<IDecodeEvent>, EventFilterProvider<IDecodeEvent>
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private final static Logger mLog = LoggerFactory.getLogger(DecodeEventModel.class);
|
private final static Logger mLog = LoggerFactory.getLogger(DecodeEventModel.class);
|
||||||
@@ -54,6 +57,7 @@ public class DecodeEventModel extends AbstractTableModel implements Listener<IDe
|
|||||||
protected int mMaxMessages = 500;
|
protected int mMaxMessages = 500;
|
||||||
|
|
||||||
protected List<IDecodeEvent> mEvents = new ArrayList<>();
|
protected List<IDecodeEvent> mEvents = new ArrayList<>();
|
||||||
|
protected FilterSet<IDecodeEvent> mEventFilterSet = new DecodeEventFilterSet();
|
||||||
|
|
||||||
protected String[] mHeaders = new String[]{"Time", "Duration", "Event", "From", "Alias", "To", "Alias", "Channel", "Frequency", "Details"};
|
protected String[] mHeaders = new String[]{"Time", "Duration", "Event", "From", "Alias", "To", "Alias", "Channel", "Frequency", "Details"};
|
||||||
|
|
||||||
@@ -105,6 +109,12 @@ public class DecodeEventModel extends AbstractTableModel implements Listener<IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clear()
|
||||||
|
{
|
||||||
|
mEvents.clear();
|
||||||
|
fireTableDataChanged();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears all events from this model and loads the events argument
|
* Clears all events from this model and loads the events argument
|
||||||
*/
|
*/
|
||||||
@@ -139,6 +149,10 @@ public class DecodeEventModel extends AbstractTableModel implements Listener<IDe
|
|||||||
*/
|
*/
|
||||||
public void receive(final IDecodeEvent event)
|
public void receive(final IDecodeEvent event)
|
||||||
{
|
{
|
||||||
|
if (!mEventFilterSet.passes(event))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(!mEvents.contains(event))
|
if(!mEvents.contains(event))
|
||||||
{
|
{
|
||||||
mEvents.add(0, event);
|
mEvents.add(0, event);
|
||||||
@@ -162,6 +176,16 @@ public class DecodeEventModel extends AbstractTableModel implements Listener<IDe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FilterSet<IDecodeEvent> getFilterSet() {
|
||||||
|
return mEventFilterSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setFilterSet(FilterSet<IDecodeEvent> filterSet) {
|
||||||
|
this.mEventFilterSet = filterSet;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRowCount()
|
public int getRowCount()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,12 +28,18 @@ import io.github.dsheirer.alias.AliasList;
|
|||||||
import io.github.dsheirer.alias.AliasModel;
|
import io.github.dsheirer.alias.AliasModel;
|
||||||
import io.github.dsheirer.channel.IChannelDescriptor;
|
import io.github.dsheirer.channel.IChannelDescriptor;
|
||||||
import io.github.dsheirer.eventbus.MyEventBus;
|
import io.github.dsheirer.eventbus.MyEventBus;
|
||||||
|
import io.github.dsheirer.filter.AllPassFilter;
|
||||||
|
import io.github.dsheirer.filter.FilterSet;
|
||||||
import io.github.dsheirer.icon.IconModel;
|
import io.github.dsheirer.icon.IconModel;
|
||||||
import io.github.dsheirer.identifier.Form;
|
import io.github.dsheirer.identifier.Form;
|
||||||
import io.github.dsheirer.identifier.Identifier;
|
import io.github.dsheirer.identifier.Identifier;
|
||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
import io.github.dsheirer.identifier.Role;
|
import io.github.dsheirer.identifier.Role;
|
||||||
import io.github.dsheirer.module.ProcessingChain;
|
import io.github.dsheirer.module.ProcessingChain;
|
||||||
|
import io.github.dsheirer.module.decode.event.filter.EventClearButton;
|
||||||
|
import io.github.dsheirer.module.decode.event.filter.EventClearHandler;
|
||||||
|
import io.github.dsheirer.module.decode.event.filter.EventFilterButton;
|
||||||
|
import io.github.dsheirer.module.decode.event.filter.EventFilterProvider;
|
||||||
import io.github.dsheirer.preference.PreferenceType;
|
import io.github.dsheirer.preference.PreferenceType;
|
||||||
import io.github.dsheirer.preference.UserPreferences;
|
import io.github.dsheirer.preference.UserPreferences;
|
||||||
import io.github.dsheirer.preference.swing.JTableColumnWidthMonitor;
|
import io.github.dsheirer.preference.swing.JTableColumnWidthMonitor;
|
||||||
@@ -42,15 +48,9 @@ import net.miginfocom.swing.MigLayout;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.*;
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.JScrollPane;
|
|
||||||
import javax.swing.JTable;
|
|
||||||
import javax.swing.table.DefaultTableCellRenderer;
|
import javax.swing.table.DefaultTableCellRenderer;
|
||||||
import java.awt.Color;
|
import java.awt.*;
|
||||||
import java.awt.Component;
|
|
||||||
import java.awt.EventQueue;
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -72,6 +72,7 @@ public class DecodeEventPanel extends JPanel implements Listener<ProcessingChain
|
|||||||
private AliasModel mAliasModel;
|
private AliasModel mAliasModel;
|
||||||
private UserPreferences mUserPreferences;
|
private UserPreferences mUserPreferences;
|
||||||
private TimestampCellRenderer mTimestampCellRenderer;
|
private TimestampCellRenderer mTimestampCellRenderer;
|
||||||
|
private EventManagementPanel mEventManagementPanel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View for call event table
|
* View for call event table
|
||||||
@@ -89,9 +90,12 @@ public class DecodeEventPanel extends JPanel implements Listener<ProcessingChain
|
|||||||
mTable = new JTable(mEventModel);
|
mTable = new JTable(mEventModel);
|
||||||
mTable.setAutoCreateRowSorter(true);
|
mTable.setAutoCreateRowSorter(true);
|
||||||
mTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
|
mTable.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
|
||||||
|
mEventManagementPanel = new EventManagementPanel();
|
||||||
mTableColumnWidthMonitor = new JTableColumnWidthMonitor(mUserPreferences, mTable, TABLE_PREFERENCE_KEY);
|
mTableColumnWidthMonitor = new JTableColumnWidthMonitor(mUserPreferences, mTable, TABLE_PREFERENCE_KEY);
|
||||||
updateCellRenderers();
|
updateCellRenderers();
|
||||||
|
|
||||||
|
add(mEventManagementPanel, "span,growx");
|
||||||
|
|
||||||
mEmptyScroller = new JScrollPane(mTable);
|
mEmptyScroller = new JScrollPane(mTable);
|
||||||
add(mEmptyScroller);
|
add(mEmptyScroller);
|
||||||
}
|
}
|
||||||
@@ -148,15 +152,76 @@ public class DecodeEventPanel extends JPanel implements Listener<ProcessingChain
|
|||||||
mCurrentEventHistory = processingChain.getDecodeEventHistory();
|
mCurrentEventHistory = processingChain.getDecodeEventHistory();
|
||||||
mEventModel.clearAndSet(mCurrentEventHistory.getItems());
|
mEventModel.clearAndSet(mCurrentEventHistory.getItems());
|
||||||
processingChain.getDecodeEventHistory().addListener(mEventModel);
|
processingChain.getDecodeEventHistory().addListener(mEventModel);
|
||||||
|
mEventManagementPanel.enableButtons();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mCurrentEventHistory = null;
|
mCurrentEventHistory = null;
|
||||||
mEventModel.clearAndSet(Collections.emptyList());
|
mEventModel.clearAndSet(Collections.emptyList());
|
||||||
|
mEventManagementPanel.disableButtons();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EventManagementPanel extends JPanel
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private EventFilterButton<IDecodeEvent> mFilterButton;
|
||||||
|
private EventClearButton mEventClearButton;
|
||||||
|
|
||||||
|
public EventManagementPanel()
|
||||||
|
{
|
||||||
|
setLayout(new MigLayout("insets 2 2 5 5", "[]5[left,grow]", ""));
|
||||||
|
|
||||||
|
initializeFilterButton();
|
||||||
|
initializeClearButton();
|
||||||
|
disableButtons();
|
||||||
|
|
||||||
|
add(mFilterButton);
|
||||||
|
add(mEventClearButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enableButtons()
|
||||||
|
{
|
||||||
|
mFilterButton.setEnabled(true);
|
||||||
|
mEventClearButton.setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disableButtons()
|
||||||
|
{
|
||||||
|
mFilterButton.setEnabled(false);
|
||||||
|
mEventClearButton.setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializeFilterButton()
|
||||||
|
{
|
||||||
|
EventFilterProvider<IDecodeEvent> filterProvider = (EventFilterProvider<IDecodeEvent>) mTable.getModel();
|
||||||
|
FilterSet<IDecodeEvent> filterSet = new FilterSet<>(new AllPassFilter<>());
|
||||||
|
if (filterProvider != null) {
|
||||||
|
filterSet = filterProvider.getFilterSet();
|
||||||
|
}
|
||||||
|
mFilterButton = new EventFilterButton<>("Message Filter Editor", filterSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializeClearButton() {
|
||||||
|
mEventClearButton = new EventClearButton(
|
||||||
|
((DecodeEventModel) mTable.getModel()).getMaxMessageCount()
|
||||||
|
);
|
||||||
|
mEventClearButton.setEventClearHandler(new EventClearHandler() {
|
||||||
|
@Override
|
||||||
|
public void onHistoryLimitChanged(int newHistoryLimit) {
|
||||||
|
((DecodeEventModel) mTable.getModel()).setMaxMessageCount(newHistoryLimit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClearHistoryClicked() {
|
||||||
|
((DecodeEventModel) mTable.getModel()).clear();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom cell renderer for displaying identifiers from an identifier collection
|
* Custom cell renderer for displaying identifiers from an identifier collection
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ public interface IDecodeEvent
|
|||||||
*/
|
*/
|
||||||
Protocol getProtocol();
|
Protocol getProtocol();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link DecodeEventType} for the event produced
|
||||||
|
*/
|
||||||
|
DecodeEventType getEventType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timeslot for the event.
|
* Timeslot for the event.
|
||||||
* @return timeslot or default of 0
|
* @return timeslot or default of 0
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.filter.FilterSet;
|
||||||
|
import io.github.dsheirer.module.decode.event.IDecodeEvent;
|
||||||
|
|
||||||
|
public class DecodeEventFilterSet extends FilterSet<IDecodeEvent> {
|
||||||
|
public DecodeEventFilterSet() {
|
||||||
|
super ("All Messages");
|
||||||
|
|
||||||
|
addFilter(new DecodedCallEventFilter());
|
||||||
|
addFilter(new DecodedCallEncryptedEventFilter());
|
||||||
|
addFilter(new DecodedDataEventFilter());
|
||||||
|
addFilter(new DecodedCommandEventFilter());
|
||||||
|
addFilter(new DecodedRegistrationEventFilter());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class DecodedCallEncryptedEventFilter extends EventFilter
|
||||||
|
{
|
||||||
|
public DecodedCallEncryptedEventFilter()
|
||||||
|
{
|
||||||
|
super("Voice Calls - Encrypted", Arrays.asList(
|
||||||
|
DecodeEventType.CALL_ENCRYPTED,
|
||||||
|
DecodeEventType.CALL_GROUP_ENCRYPTED,
|
||||||
|
DecodeEventType.CALL_PATCH_GROUP_ENCRYPTED,
|
||||||
|
DecodeEventType.CALL_INTERCONNECT_ENCRYPTED,
|
||||||
|
DecodeEventType.CALL_UNIT_TO_UNIT_ENCRYPTED
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class DecodedCallEventFilter extends EventFilter
|
||||||
|
{
|
||||||
|
public DecodedCallEventFilter()
|
||||||
|
{
|
||||||
|
super("Voice Calls", Arrays.asList(
|
||||||
|
DecodeEventType.CALL_GROUP,
|
||||||
|
DecodeEventType.CALL_PATCH_GROUP,
|
||||||
|
DecodeEventType.CALL_ALERT,
|
||||||
|
DecodeEventType.CALL_DETECT,
|
||||||
|
DecodeEventType.CALL_DO_NOT_MONITOR,
|
||||||
|
DecodeEventType.CALL_END,
|
||||||
|
DecodeEventType.CALL_INTERCONNECT,
|
||||||
|
DecodeEventType.CALL_UNIQUE_ID,
|
||||||
|
DecodeEventType.CALL_UNIT_TO_UNIT,
|
||||||
|
DecodeEventType.CALL_NO_TUNER,
|
||||||
|
DecodeEventType.CALL_TIMEOUT
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class DecodedCommandEventFilter extends EventFilter
|
||||||
|
{
|
||||||
|
public DecodedCommandEventFilter()
|
||||||
|
{
|
||||||
|
super("Commands", Arrays.asList(
|
||||||
|
DecodeEventType.ANNOUNCEMENT,
|
||||||
|
DecodeEventType.STATION_ID,
|
||||||
|
DecodeEventType.PAGE,
|
||||||
|
DecodeEventType.QUERY,
|
||||||
|
DecodeEventType.RADIO_CHECK,
|
||||||
|
DecodeEventType.STATUS,
|
||||||
|
DecodeEventType.COMMAND,
|
||||||
|
DecodeEventType.EMERGENCY,
|
||||||
|
DecodeEventType.NOTIFICATION,
|
||||||
|
DecodeEventType.FUNCTION
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class DecodedDataEventFilter extends EventFilter
|
||||||
|
{
|
||||||
|
public DecodedDataEventFilter()
|
||||||
|
{
|
||||||
|
super("Data Calls", Arrays.asList(
|
||||||
|
DecodeEventType.DATA_CALL,
|
||||||
|
DecodeEventType.DATA_CALL_ENCRYPTED,
|
||||||
|
DecodeEventType.DATA_PACKET,
|
||||||
|
DecodeEventType.GPS,
|
||||||
|
DecodeEventType.IP_PACKET,
|
||||||
|
DecodeEventType.UDP_PACKET,
|
||||||
|
DecodeEventType.SDM,
|
||||||
|
DecodeEventType.ID_ANI,
|
||||||
|
DecodeEventType.ID_UNIQUE
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
public class DecodedRegistrationEventFilter extends EventFilter
|
||||||
|
{
|
||||||
|
public DecodedRegistrationEventFilter()
|
||||||
|
{
|
||||||
|
super("Registrations", Arrays.asList(
|
||||||
|
DecodeEventType.AFFILIATE,
|
||||||
|
DecodeEventType.AUTOMATIC_REGISTRATION_SERVICE,
|
||||||
|
DecodeEventType.REGISTER,
|
||||||
|
DecodeEventType.REGISTER_ESN,
|
||||||
|
DecodeEventType.DEREGISTER,
|
||||||
|
DecodeEventType.REQUEST,
|
||||||
|
DecodeEventType.RESPONSE,
|
||||||
|
DecodeEventType.RESPONSE_PACKET
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import com.jidesoft.swing.JideSplitButton;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.event.ChangeEvent;
|
||||||
|
import javax.swing.event.ChangeListener;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.awt.event.MouseListener;
|
||||||
|
|
||||||
|
public class EventClearButton extends JideSplitButton
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
private EventClearHandler mEventClearHandler;
|
||||||
|
|
||||||
|
public EventClearButton(int maxHistoryCount)
|
||||||
|
{
|
||||||
|
super("Clear");
|
||||||
|
|
||||||
|
JPanel historyPanel = new JPanel();
|
||||||
|
|
||||||
|
historyPanel.add(new JLabel("History Entries:"));
|
||||||
|
|
||||||
|
final JSlider historySlider = initializeHistorySlider();
|
||||||
|
|
||||||
|
historySlider.setValue(maxHistoryCount);
|
||||||
|
historySlider.addChangeListener(new ChangeListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void stateChanged(ChangeEvent arg0)
|
||||||
|
{
|
||||||
|
if (mEventClearHandler != null)
|
||||||
|
{
|
||||||
|
mEventClearHandler.onHistoryLimitChanged(historySlider.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
historyPanel.add(historySlider);
|
||||||
|
|
||||||
|
add(historyPanel);
|
||||||
|
|
||||||
|
/* This handles the click action on the main button. Clear messages */
|
||||||
|
addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
if (mEventClearHandler != null)
|
||||||
|
{
|
||||||
|
mEventClearHandler.onClearHistoryClicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEventClearHandler(EventClearHandler eventClearHandler) {
|
||||||
|
this.mEventClearHandler = eventClearHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSlider initializeHistorySlider()
|
||||||
|
{
|
||||||
|
final JSlider slider = new JSlider();
|
||||||
|
slider.setMinimum(0);
|
||||||
|
slider.setMaximum(2000);
|
||||||
|
slider.setMajorTickSpacing(500);
|
||||||
|
slider.setPaintTicks(true);
|
||||||
|
slider.setPaintLabels(true);
|
||||||
|
|
||||||
|
slider.addMouseListener(new MouseListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent arg0)
|
||||||
|
{
|
||||||
|
if(SwingUtilities.isLeftMouseButton(arg0) && arg0.getClickCount() == 2)
|
||||||
|
{
|
||||||
|
slider.setValue(500); //default
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseEntered(MouseEvent arg0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseExited(MouseEvent arg0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mousePressed(MouseEvent arg0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mouseReleased(MouseEvent arg0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return slider;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
public interface EventClearHandler {
|
||||||
|
void onHistoryLimitChanged(int newHistoryLimit);
|
||||||
|
void onClearHistoryClicked();
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.filter.Filter;
|
||||||
|
import io.github.dsheirer.filter.FilterElement;
|
||||||
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
|
import io.github.dsheirer.module.decode.event.IDecodeEvent;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is used as a base for {@link IDecodeEvent} types.
|
||||||
|
* This will take a list of {@link IDecodeEvent}s and generate filters for the list.
|
||||||
|
* This will default canProcess to TRUE. Override if other value or evaluation is needed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class EventFilter extends Filter<IDecodeEvent>
|
||||||
|
{
|
||||||
|
private Map<DecodeEventType, FilterElement<DecodeEventType>> mElements = new EnumMap<>(DecodeEventType.class);
|
||||||
|
|
||||||
|
public EventFilter(String name, List<DecodeEventType> eventTypes)
|
||||||
|
{
|
||||||
|
super(name);
|
||||||
|
|
||||||
|
for (DecodeEventType eventType : eventTypes) {
|
||||||
|
mElements.put(eventType, new FilterElement<>(eventType));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean passes(IDecodeEvent iDecodeEvent)
|
||||||
|
{
|
||||||
|
if (mEnabled && canProcess(iDecodeEvent))
|
||||||
|
{
|
||||||
|
if (mElements.containsKey(iDecodeEvent.getEventType()))
|
||||||
|
{
|
||||||
|
return mElements.get(iDecodeEvent.getEventType()).isEnabled();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canProcess(IDecodeEvent iDecodeEvent)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FilterElement<?>> getFilterElements()
|
||||||
|
{
|
||||||
|
return new ArrayList<>(mElements.values());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import com.jidesoft.swing.JideButton;
|
||||||
|
import io.github.dsheirer.filter.FilterEditorPanel;
|
||||||
|
import io.github.dsheirer.filter.FilterSet;
|
||||||
|
import net.miginfocom.swing.MigLayout;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
|
public class EventFilterButton<T> extends JideButton
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public EventFilterButton(String dialogTitle, FilterSet<T> filterSet)
|
||||||
|
{
|
||||||
|
this("Filter", dialogTitle, filterSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EventFilterButton(String buttonLabel, String dialogTitle, FilterSet<T> filterSet)
|
||||||
|
{
|
||||||
|
super(buttonLabel);
|
||||||
|
|
||||||
|
addActionListener(
|
||||||
|
new EventFilterActionHandler(dialogTitle, filterSet)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EventFilterActionHandler implements ActionListener
|
||||||
|
{
|
||||||
|
private String title;
|
||||||
|
private FilterSet<T> filterSet;
|
||||||
|
|
||||||
|
public EventFilterActionHandler( String title, FilterSet<T> filterSet)
|
||||||
|
{
|
||||||
|
this.title = title;
|
||||||
|
this.filterSet = filterSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
final JFrame editor = new JFrame();
|
||||||
|
|
||||||
|
editor.setTitle(title);
|
||||||
|
editor.setLocationRelativeTo(EventFilterButton.this);
|
||||||
|
editor.setSize(600, 400);
|
||||||
|
editor.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||||
|
editor.setLayout(new MigLayout("", "[grow,fill]",
|
||||||
|
"[grow,fill][][]"));
|
||||||
|
|
||||||
|
FilterEditorPanel<T> panel = new FilterEditorPanel<T>(filterSet);
|
||||||
|
|
||||||
|
JScrollPane scroller = new JScrollPane(panel);
|
||||||
|
scroller.setViewportView(panel);
|
||||||
|
|
||||||
|
editor.add(scroller, "wrap");
|
||||||
|
|
||||||
|
editor.add(new JLabel("Right-click to select/deselect all nodes"), "wrap");
|
||||||
|
|
||||||
|
JButton close = new JButton("Close");
|
||||||
|
close.addActionListener(new ActionListener()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e)
|
||||||
|
{
|
||||||
|
editor.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.add(close);
|
||||||
|
|
||||||
|
EventQueue.invokeLater(new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
editor.setVisible(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package io.github.dsheirer.module.decode.event.filter;
|
||||||
|
|
||||||
|
import io.github.dsheirer.filter.FilterSet;
|
||||||
|
|
||||||
|
public interface EventFilterProvider<T> {
|
||||||
|
FilterSet<T> getFilterSet();
|
||||||
|
void setFilterSet(FilterSet<T> filterSet);
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ package io.github.dsheirer.module.decode.p25;
|
|||||||
|
|
||||||
import io.github.dsheirer.channel.IChannelDescriptor;
|
import io.github.dsheirer.channel.IChannelDescriptor;
|
||||||
import io.github.dsheirer.identifier.IdentifierCollection;
|
import io.github.dsheirer.identifier.IdentifierCollection;
|
||||||
|
import io.github.dsheirer.module.decode.event.DecodeEventType;
|
||||||
import io.github.dsheirer.module.decode.p25.reference.ServiceOptions;
|
import io.github.dsheirer.module.decode.p25.reference.ServiceOptions;
|
||||||
import io.github.dsheirer.protocol.Protocol;
|
import io.github.dsheirer.protocol.Protocol;
|
||||||
|
|
||||||
@@ -76,6 +77,7 @@ public class P25ChannelGrantEvent extends P25DecodeEvent
|
|||||||
protected long mTimeStart;
|
protected long mTimeStart;
|
||||||
protected long mDuration;
|
protected long mDuration;
|
||||||
protected String mEventDescription;
|
protected String mEventDescription;
|
||||||
|
protected DecodeEventType mDecodeEventType;
|
||||||
protected IdentifierCollection mIdentifierCollection;
|
protected IdentifierCollection mIdentifierCollection;
|
||||||
protected IChannelDescriptor mChannelDescriptor;
|
protected IChannelDescriptor mChannelDescriptor;
|
||||||
protected String mDetails;
|
protected String mDetails;
|
||||||
@@ -132,6 +134,16 @@ public class P25ChannelGrantEvent extends P25DecodeEvent
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the {@link DecodeEventType}
|
||||||
|
* @param decodeEventType of the event
|
||||||
|
*/
|
||||||
|
public P25ChannelGrantDecodeEventBuilder eventType(DecodeEventType decodeEventType)
|
||||||
|
{
|
||||||
|
mDecodeEventType = decodeEventType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the identifier collection.
|
* Sets the identifier collection.
|
||||||
* @param identifierCollection containing optional identifiers like TO, FROM, frequency and
|
* @param identifierCollection containing optional identifiers like TO, FROM, frequency and
|
||||||
@@ -163,6 +175,7 @@ public class P25ChannelGrantEvent extends P25DecodeEvent
|
|||||||
decodeEvent.setChannelDescriptor(mChannelDescriptor);
|
decodeEvent.setChannelDescriptor(mChannelDescriptor);
|
||||||
decodeEvent.setDetails(mDetails);
|
decodeEvent.setDetails(mDetails);
|
||||||
decodeEvent.setDuration(mDuration);
|
decodeEvent.setDuration(mDuration);
|
||||||
|
decodeEvent.setEventType(mDecodeEventType);
|
||||||
decodeEvent.setEventDescription(mEventDescription);
|
decodeEvent.setEventDescription(mEventDescription);
|
||||||
decodeEvent.setIdentifierCollection(mIdentifierCollection);
|
decodeEvent.setIdentifierCollection(mIdentifierCollection);
|
||||||
decodeEvent.setServiceOptions(mServiceOptions);
|
decodeEvent.setServiceOptions(mServiceOptions);
|
||||||
|
|||||||
@@ -268,6 +268,7 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
{
|
{
|
||||||
long frequency = apco25Channel.getDownlinkFrequency();
|
long frequency = apco25Channel.getDownlinkFrequency();
|
||||||
|
|
||||||
|
DecodeEventType decodeEventType = getEventType(opcode, serviceOptions);
|
||||||
P25ChannelGrantEvent event = mTS0ChannelGrantEventMap.get(frequency);
|
P25ChannelGrantEvent event = mTS0ChannelGrantEventMap.get(frequency);
|
||||||
|
|
||||||
if(event != null && isSameCall(identifierCollection, event.getIdentifierCollection()))
|
if(event != null && isSameCall(identifierCollection, event.getIdentifierCollection()))
|
||||||
@@ -283,7 +284,8 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
|
|
||||||
P25ChannelGrantEvent continuationGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
P25ChannelGrantEvent continuationGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
||||||
.channel(apco25Channel)
|
.channel(apco25Channel)
|
||||||
.eventDescription(getEventType(opcode, serviceOptions).toString() + " - Continue")
|
.eventType(decodeEventType)
|
||||||
|
.eventDescription(decodeEventType.toString() + " - Continue")
|
||||||
.details("PHASE 1 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
.details("PHASE 1 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
||||||
.identifiers(identifierCollection)
|
.identifiers(identifierCollection)
|
||||||
.build();
|
.build();
|
||||||
@@ -305,7 +307,7 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
|
|
||||||
if(trafficChannel != null)
|
if(trafficChannel != null)
|
||||||
{
|
{
|
||||||
event.setEventDescription(getEventType(opcode, serviceOptions).toString());
|
event.setEventDescription(decodeEventType.toString());
|
||||||
event.setDetails("PHASE 1 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""));
|
event.setDetails("PHASE 1 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""));
|
||||||
event.setChannelDescriptor(apco25Channel);
|
event.setChannelDescriptor(apco25Channel);
|
||||||
broadcast(event);
|
broadcast(event);
|
||||||
@@ -328,7 +330,8 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
{
|
{
|
||||||
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
||||||
.channel(apco25Channel)
|
.channel(apco25Channel)
|
||||||
.eventDescription(getEventType(opcode, serviceOptions).toString() + " - Ignored")
|
.eventType(decodeEventType)
|
||||||
|
.eventDescription(decodeEventType.toString() + " - Ignored")
|
||||||
.details("DATA CALL IGNORED: " + (serviceOptions != null ? serviceOptions : ""))
|
.details("DATA CALL IGNORED: " + (serviceOptions != null ? serviceOptions : ""))
|
||||||
.identifiers(identifierCollection)
|
.identifiers(identifierCollection)
|
||||||
.build();
|
.build();
|
||||||
@@ -340,7 +343,8 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
|
|
||||||
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
||||||
.channel(apco25Channel)
|
.channel(apco25Channel)
|
||||||
.eventDescription(getEventType(opcode, serviceOptions).toString())
|
.eventType(decodeEventType)
|
||||||
|
.eventDescription(decodeEventType.toString())
|
||||||
.details("PHASE 1 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
.details("PHASE 1 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
||||||
.identifiers(identifierCollection)
|
.identifiers(identifierCollection)
|
||||||
.build();
|
.build();
|
||||||
@@ -411,6 +415,7 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
}
|
}
|
||||||
|
|
||||||
identifierCollection.setTimeslot(timeslot);
|
identifierCollection.setTimeslot(timeslot);
|
||||||
|
DecodeEventType decodeEventType = getEventType(opcode, serviceOptions);
|
||||||
|
|
||||||
if(event != null && isSameCall(identifierCollection, event.getIdentifierCollection()))
|
if(event != null && isSameCall(identifierCollection, event.getIdentifierCollection()))
|
||||||
{
|
{
|
||||||
@@ -425,7 +430,8 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
|
|
||||||
P25ChannelGrantEvent continuationGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
P25ChannelGrantEvent continuationGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
||||||
.channel(apco25Channel)
|
.channel(apco25Channel)
|
||||||
.eventDescription(getEventType(opcode, serviceOptions).toString() + " - Continue")
|
.eventType(decodeEventType)
|
||||||
|
.eventDescription(decodeEventType.toString() + " - Continue")
|
||||||
.details("PHASE 2 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
.details("PHASE 2 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
||||||
.identifiers(identifierCollection)
|
.identifiers(identifierCollection)
|
||||||
.build();
|
.build();
|
||||||
@@ -455,7 +461,7 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
|
|
||||||
if(trafficChannel != null)
|
if(trafficChannel != null)
|
||||||
{
|
{
|
||||||
event.setEventDescription(getEventType(opcode, serviceOptions).toString());
|
event.setEventDescription(decodeEventType.toString());
|
||||||
event.setDetails("PHASE 2 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""));
|
event.setDetails("PHASE 2 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""));
|
||||||
event.setChannelDescriptor(apco25Channel);
|
event.setChannelDescriptor(apco25Channel);
|
||||||
broadcast(event);
|
broadcast(event);
|
||||||
@@ -485,7 +491,8 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
{
|
{
|
||||||
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
||||||
.channel(apco25Channel)
|
.channel(apco25Channel)
|
||||||
.eventDescription(getEventType(opcode, serviceOptions).toString() + " - Ignored")
|
.eventType(decodeEventType)
|
||||||
|
.eventDescription(decodeEventType.toString() + " - Ignored")
|
||||||
.details("PHASE 2 DATA CALL IGNORED: " + (serviceOptions != null ? serviceOptions : ""))
|
.details("PHASE 2 DATA CALL IGNORED: " + (serviceOptions != null ? serviceOptions : ""))
|
||||||
.identifiers(identifierCollection)
|
.identifiers(identifierCollection)
|
||||||
.build();
|
.build();
|
||||||
@@ -498,7 +505,8 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
|
|
||||||
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
P25ChannelGrantEvent channelGrantEvent = P25ChannelGrantEvent.builder(timestamp, serviceOptions)
|
||||||
.channel(apco25Channel)
|
.channel(apco25Channel)
|
||||||
.eventDescription(getEventType(opcode, serviceOptions).toString())
|
.eventType(decodeEventType)
|
||||||
|
.eventDescription(decodeEventType.toString())
|
||||||
.details("PHASE 2 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
.details("PHASE 2 CHANNEL GRANT " + (serviceOptions != null ? serviceOptions : ""))
|
||||||
.identifiers(identifierCollection)
|
.identifiers(identifierCollection)
|
||||||
.build();
|
.build();
|
||||||
|
|||||||
@@ -502,17 +502,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(ambtc instanceof AMBTCStatusUpdate)
|
if(ambtc instanceof AMBTCStatusUpdate)
|
||||||
{
|
{
|
||||||
AMBTCStatusUpdate su = (AMBTCStatusUpdate)ambtc;
|
AMBTCStatusUpdate su = (AMBTCStatusUpdate)ambtc;
|
||||||
|
processBroadcast(ambtc, DecodeEventType.STATUS,
|
||||||
MutableIdentifierCollection icStatusUpdate = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
"UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus());
|
||||||
icStatusUpdate.remove(IdentifierClass.USER);
|
|
||||||
icStatusUpdate.update(ambtc.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(ambtc.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.STATUS.toString())
|
|
||||||
.details("UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus())
|
|
||||||
.identifiers(icStatusUpdate)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,19 +511,9 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(ambtc instanceof AMBTCProtectionParameterBroadcast)
|
if(ambtc instanceof AMBTCProtectionParameterBroadcast)
|
||||||
{
|
{
|
||||||
AMBTCProtectionParameterBroadcast ppb = (AMBTCProtectionParameterBroadcast)ambtc;
|
AMBTCProtectionParameterBroadcast ppb = (AMBTCProtectionParameterBroadcast)ambtc;
|
||||||
|
processBroadcast(ambtc, DecodeEventType.RESPONSE, "USE ENCRYPTION " + ppb.getEncryptionKey() +
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(ambtc.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(ambtc.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("USE ENCRYPTION " + ppb.getEncryptionKey() +
|
|
||||||
" OUTBOUND MI:" + ppb.getOutboundMessageIndicator() +
|
" OUTBOUND MI:" + ppb.getOutboundMessageIndicator() +
|
||||||
" INBOUND MI:" + ppb.getInboundMessageIndicator())
|
" INBOUND MI:" + ppb.getInboundMessageIndicator());
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -540,18 +521,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(ambtc instanceof AMBTCGroupAffiliationResponse)
|
if(ambtc instanceof AMBTCGroupAffiliationResponse)
|
||||||
{
|
{
|
||||||
AMBTCGroupAffiliationResponse gar = (AMBTCGroupAffiliationResponse)ambtc;
|
AMBTCGroupAffiliationResponse gar = (AMBTCGroupAffiliationResponse)ambtc;
|
||||||
|
processBroadcast(ambtc, DecodeEventType.RESPONSE, "AFFILIATION GROUP:" + gar.getGroupId() +
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
" ANNOUNCEMENT GROUP:" + gar.getAnnouncementGroupId());
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(ambtc.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(ambtc.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("AFFILIATION GROUP:" + gar.getGroupId() +
|
|
||||||
" ANNOUNCEMENT GROUP:" + gar.getAnnouncementGroupId())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,9 +531,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
{
|
{
|
||||||
AMBTCUnitToUnitVoiceServiceChannelGrantUpdate uuvscgu = (AMBTCUnitToUnitVoiceServiceChannelGrantUpdate)ambtc;
|
AMBTCUnitToUnitVoiceServiceChannelGrantUpdate uuvscgu = (AMBTCUnitToUnitVoiceServiceChannelGrantUpdate)ambtc;
|
||||||
|
|
||||||
MutableIdentifierCollection identifierCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifierCollection = getMutableIdentifierCollection(uuvscgu.getIdentifiers());
|
||||||
identifierCollection.remove(IdentifierClass.USER);
|
|
||||||
identifierCollection.update(uuvscgu.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(uuvscgu.getChannel(), uuvscgu.getVoiceServiceOptions(),
|
processChannelGrant(uuvscgu.getChannel(), uuvscgu.getVoiceServiceOptions(),
|
||||||
identifierCollection, ambtc.getHeader().getOpcode(),
|
identifierCollection, ambtc.getHeader().getOpcode(),
|
||||||
@@ -575,9 +544,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
{
|
{
|
||||||
AMBTCUnitToUnitVoiceServiceChannelGrant uuvscg = (AMBTCUnitToUnitVoiceServiceChannelGrant)ambtc;
|
AMBTCUnitToUnitVoiceServiceChannelGrant uuvscg = (AMBTCUnitToUnitVoiceServiceChannelGrant)ambtc;
|
||||||
|
|
||||||
MutableIdentifierCollection identifierCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifierCollection = getMutableIdentifierCollection(uuvscg.getIdentifiers());
|
||||||
identifierCollection.remove(IdentifierClass.USER);
|
|
||||||
identifierCollection.update(uuvscg.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(uuvscg.getChannel(), uuvscg.getVoiceServiceOptions(),
|
processChannelGrant(uuvscg.getChannel(), uuvscg.getVoiceServiceOptions(),
|
||||||
identifierCollection, ambtc.getHeader().getOpcode(),
|
identifierCollection, ambtc.getHeader().getOpcode(),
|
||||||
@@ -590,9 +557,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
{
|
{
|
||||||
AMBTCTelephoneInterconnectChannelGrantUpdate ticgu = (AMBTCTelephoneInterconnectChannelGrantUpdate)ambtc;
|
AMBTCTelephoneInterconnectChannelGrantUpdate ticgu = (AMBTCTelephoneInterconnectChannelGrantUpdate)ambtc;
|
||||||
|
|
||||||
MutableIdentifierCollection identifierCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifierCollection = getMutableIdentifierCollection(ticgu.getIdentifiers());
|
||||||
identifierCollection.remove(IdentifierClass.USER);
|
|
||||||
identifierCollection.update(ticgu.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(ticgu.getChannel(), ticgu.getVoiceServiceOptions(),
|
processChannelGrant(ticgu.getChannel(), ticgu.getVoiceServiceOptions(),
|
||||||
identifierCollection, ambtc.getHeader().getOpcode(),
|
identifierCollection, ambtc.getHeader().getOpcode(),
|
||||||
@@ -605,9 +570,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
{
|
{
|
||||||
AMBTCTelephoneInterconnectChannelGrant ticg = (AMBTCTelephoneInterconnectChannelGrant)ambtc;
|
AMBTCTelephoneInterconnectChannelGrant ticg = (AMBTCTelephoneInterconnectChannelGrant)ambtc;
|
||||||
|
|
||||||
MutableIdentifierCollection identifierCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifierCollection = getMutableIdentifierCollection(ticg.getIdentifiers());
|
||||||
identifierCollection.remove(IdentifierClass.USER);
|
|
||||||
identifierCollection.update(ticg.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(ticg.getChannel(), ticg.getVoiceServiceOptions(),
|
processChannelGrant(ticg.getChannel(), ticg.getVoiceServiceOptions(),
|
||||||
identifierCollection, ambtc.getHeader().getOpcode(),
|
identifierCollection, ambtc.getHeader().getOpcode(),
|
||||||
@@ -620,9 +583,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
{
|
{
|
||||||
AMBTCIndividualDataChannelGrant idcg = (AMBTCIndividualDataChannelGrant)ambtc;
|
AMBTCIndividualDataChannelGrant idcg = (AMBTCIndividualDataChannelGrant)ambtc;
|
||||||
|
|
||||||
MutableIdentifierCollection identifierCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifierCollection = getMutableIdentifierCollection(idcg.getIdentifiers());
|
||||||
identifierCollection.remove(IdentifierClass.USER);
|
|
||||||
identifierCollection.update(idcg.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(idcg.getChannel(), idcg.getDataServiceOptions(),
|
processChannelGrant(idcg.getChannel(), idcg.getDataServiceOptions(),
|
||||||
identifierCollection, ambtc.getHeader().getOpcode(),
|
identifierCollection, ambtc.getHeader().getOpcode(),
|
||||||
@@ -635,9 +596,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
{
|
{
|
||||||
AMBTCGroupVoiceChannelGrant gvcg = (AMBTCGroupVoiceChannelGrant)ambtc;
|
AMBTCGroupVoiceChannelGrant gvcg = (AMBTCGroupVoiceChannelGrant)ambtc;
|
||||||
|
|
||||||
MutableIdentifierCollection identifierCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifierCollection = getMutableIdentifierCollection(gvcg.getIdentifiers());
|
||||||
identifierCollection.remove(IdentifierClass.USER);
|
|
||||||
identifierCollection.update(gvcg.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(gvcg.getChannel(), gvcg.getVoiceServiceOptions(),
|
processChannelGrant(gvcg.getChannel(), gvcg.getVoiceServiceOptions(),
|
||||||
identifierCollection, ambtc.getHeader().getOpcode(),
|
identifierCollection, ambtc.getHeader().getOpcode(),
|
||||||
@@ -650,9 +609,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
{
|
{
|
||||||
AMBTCGroupDataChannelGrant gdcg = (AMBTCGroupDataChannelGrant)ambtc;
|
AMBTCGroupDataChannelGrant gdcg = (AMBTCGroupDataChannelGrant)ambtc;
|
||||||
|
|
||||||
MutableIdentifierCollection identifierCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifierCollection = getMutableIdentifierCollection(gdcg.getIdentifiers());
|
||||||
identifierCollection.remove(IdentifierClass.USER);
|
|
||||||
identifierCollection.update(gdcg.getIdentifiers());
|
|
||||||
processChannelGrant(gdcg.getChannel(), gdcg.getDataServiceOptions(),
|
processChannelGrant(gdcg.getChannel(), gdcg.getDataServiceOptions(),
|
||||||
identifierCollection, ambtc.getHeader().getOpcode(),
|
identifierCollection, ambtc.getHeader().getOpcode(),
|
||||||
ambtc.getTimestamp());
|
ambtc.getTimestamp());
|
||||||
@@ -663,18 +620,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(ambtc instanceof AMBTCUnitToUnitVoiceServiceAnswerResponse)
|
if(ambtc instanceof AMBTCUnitToUnitVoiceServiceAnswerResponse)
|
||||||
{
|
{
|
||||||
AMBTCUnitToUnitVoiceServiceAnswerResponse uuvsar = (AMBTCUnitToUnitVoiceServiceAnswerResponse)ambtc;
|
AMBTCUnitToUnitVoiceServiceAnswerResponse uuvsar = (AMBTCUnitToUnitVoiceServiceAnswerResponse)ambtc;
|
||||||
|
processBroadcast(ambtc, DecodeEventType.RESPONSE,
|
||||||
MutableIdentifierCollection icUnitAnswerResponse = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
uuvsar.getAnswerResponse() + " UNIT-2-UNIT VOICE SERVICE " + uuvsar.getVoiceServiceOptions());
|
||||||
icUnitAnswerResponse.remove(IdentifierClass.USER);
|
|
||||||
icUnitAnswerResponse.update(ambtc.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(ambtc.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details(uuvsar.getAnswerResponse() + " UNIT-2-UNIT VOICE SERVICE " +
|
|
||||||
uuvsar.getVoiceServiceOptions())
|
|
||||||
.identifiers(icUnitAnswerResponse)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,56 +629,52 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(ambtc instanceof AMBTCStatusUpdateRequest)
|
if(ambtc instanceof AMBTCStatusUpdateRequest)
|
||||||
{
|
{
|
||||||
AMBTCStatusUpdateRequest sur = (AMBTCStatusUpdateRequest)ambtc;
|
AMBTCStatusUpdateRequest sur = (AMBTCStatusUpdateRequest)ambtc;
|
||||||
|
processBroadcast(ambtc, DecodeEventType.STATUS,
|
||||||
MutableIdentifierCollection icStatusUpdateRequest = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
"UNIT:" + sur.getUnitStatus() + " USER:" + sur.getUserStatus());
|
||||||
icStatusUpdateRequest.remove(IdentifierClass.USER);
|
|
||||||
icStatusUpdateRequest.update(ambtc.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(ambtc.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.STATUS.toString())
|
|
||||||
.details("UNIT:" + sur.getUnitStatus() + " USER:" + sur.getUserStatus())
|
|
||||||
.identifiers(icStatusUpdateRequest)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processAMBTCStatusQueryResponse(AMBTCMessage ambtc) {
|
private void processAMBTCStatusQueryResponse(AMBTCMessage ambtc) {
|
||||||
if(ambtc instanceof AMBTCStatusQueryResponse)
|
if(ambtc instanceof AMBTCStatusQueryResponse)
|
||||||
{
|
{
|
||||||
MutableIdentifierCollection icStatusQueryResponse = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
|
||||||
icStatusQueryResponse.remove(IdentifierClass.USER);
|
|
||||||
icStatusQueryResponse.update(ambtc.getIdentifiers());
|
|
||||||
|
|
||||||
AMBTCStatusQueryResponse sqr = (AMBTCStatusQueryResponse)ambtc;
|
AMBTCStatusQueryResponse sqr = (AMBTCStatusQueryResponse)ambtc;
|
||||||
broadcast(P25DecodeEvent.builder(ambtc.getTimestamp())
|
processBroadcast(ambtc, DecodeEventType.STATUS,
|
||||||
.channel(getCurrentChannel())
|
"UNIT:" + sqr.getUnitStatus() + " USER:" + sqr.getUserStatus());
|
||||||
.eventDescription(DecodeEventType.STATUS.toString())
|
|
||||||
.details("UNIT:" + sqr.getUnitStatus() + " USER:" + sqr.getUserStatus())
|
|
||||||
.identifiers(icStatusQueryResponse)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void processBroadcast(AMBTCMessage ambtcMessage, DecodeEventType request, String details) {
|
||||||
|
processBroadcast(ambtcMessage.getIdentifiers(), ambtcMessage.getTimestamp(), request, details);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processBroadcast(TSBKMessage tsbkMessage, DecodeEventType request, String details) {
|
||||||
|
processBroadcast(tsbkMessage.getIdentifiers(), tsbkMessage.getTimestamp(), request, details);
|
||||||
|
}
|
||||||
|
|
||||||
private void processBroadcast(List<Identifier> identifiers, long timestamp, DecodeEventType request, String s) {
|
private void processBroadcast(List<Identifier> identifiers, long timestamp, DecodeEventType request, String s) {
|
||||||
MutableIdentifierCollection requestCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection requestCollection = getMutableIdentifierCollection(identifiers);
|
||||||
requestCollection.remove(IdentifierClass.USER);
|
|
||||||
requestCollection.update(identifiers);
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(timestamp)
|
broadcast(P25DecodeEvent.builder(timestamp)
|
||||||
.channel(getCurrentChannel())
|
.channel(getCurrentChannel())
|
||||||
|
.eventType(request)
|
||||||
.eventDescription(request.toString())
|
.eventDescription(request.toString())
|
||||||
.details(s)
|
.details(s)
|
||||||
.identifiers(requestCollection)
|
.identifiers(requestCollection)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private MutableIdentifierCollection getMutableIdentifierCollection(List<Identifier> identifiers) {
|
||||||
|
MutableIdentifierCollection requestCollection = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
||||||
|
requestCollection.remove(IdentifierClass.USER);
|
||||||
|
requestCollection.update(identifiers);
|
||||||
|
return requestCollection;
|
||||||
|
}
|
||||||
|
|
||||||
private void processAMBTCIspAuthenticationResponse(P25Message message, AMBTCMessage ambtc) {
|
private void processAMBTCIspAuthenticationResponse(P25Message message, AMBTCMessage ambtc) {
|
||||||
if(message instanceof AMBTCAuthenticationResponse)
|
if(message instanceof AMBTCAuthenticationResponse)
|
||||||
{
|
{
|
||||||
AMBTCAuthenticationResponse ar = (AMBTCAuthenticationResponse)ambtc;
|
AMBTCAuthenticationResponse ar = (AMBTCAuthenticationResponse)ambtc;
|
||||||
|
processBroadcast(ambtc, DecodeEventType.RESPONSE, "AUTHENTICATION:" + ar.getAuthenticationValue());
|
||||||
processBroadcast(ambtc.getIdentifiers(), ambtc.getTimestamp(), DecodeEventType.RESPONSE, "AUTHENTICATION:" + ar.getAuthenticationValue());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1061,67 +1004,37 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
|
|
||||||
SNDCPMessage sndcpMessage = sndcpPacket.getSNDCPMessage();
|
SNDCPMessage sndcpMessage = sndcpPacket.getSNDCPMessage();
|
||||||
|
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection ic = getMutableIdentifierCollection(sndcpPacket.getIdentifiers());
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(sndcpPacket.getIdentifiers());
|
|
||||||
|
|
||||||
switch(sndcpPacket.getSNDCPPacketHeader().getPDUType())
|
switch(sndcpPacket.getSNDCPPacketHeader().getPDUType())
|
||||||
{
|
{
|
||||||
case OUTBOUND_SNDCP_ACTIVATE_TDS_CONTEXT_ACCEPT:
|
case OUTBOUND_SNDCP_ACTIVATE_TDS_CONTEXT_ACCEPT:
|
||||||
broadcast(P25DecodeEvent.builder(message.getTimestamp())
|
processBroadcast(sndcpPacket.getIdentifiers(), message.getTimestamp(),
|
||||||
.channel(getCurrentChannel())
|
DecodeEventType.RESPONSE, "SNDCP ACTIVATE TDS CONTEXT ACCEPT");
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("SNDCP ACTIVATE TDS CONTEXT ACCEPT")
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
break;
|
break;
|
||||||
case OUTBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_ACCEPT:
|
case OUTBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_ACCEPT:
|
||||||
broadcast(P25DecodeEvent.builder(message.getTimestamp())
|
processBroadcast(sndcpPacket.getIdentifiers(), message.getTimestamp(),
|
||||||
.channel(getCurrentChannel())
|
DecodeEventType.RESPONSE, "SNDCP DEACTIVATE TDS CONTEXT ACCEPT");
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("SNDCP DEACTIVATE TDS CONTEXT ACCEPT")
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
break;
|
break;
|
||||||
case OUTBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_REQUEST:
|
case OUTBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_REQUEST:
|
||||||
broadcast(P25DecodeEvent.builder(message.getTimestamp())
|
processBroadcast(sndcpPacket.getIdentifiers(), message.getTimestamp(),
|
||||||
.channel(getCurrentChannel())
|
DecodeEventType.REQUEST, "SNDCP DEACTIVATE TDS CONTEXT");
|
||||||
.eventDescription(DecodeEventType.REQUEST.toString())
|
|
||||||
.details("SNDCP DEACTIVATE TDS CONTEXT")
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
break;
|
break;
|
||||||
case OUTBOUND_SNDCP_ACTIVATE_TDS_CONTEXT_REJECT:
|
case OUTBOUND_SNDCP_ACTIVATE_TDS_CONTEXT_REJECT:
|
||||||
broadcast(P25DecodeEvent.builder(message.getTimestamp())
|
processBroadcast(sndcpPacket.getIdentifiers(), message.getTimestamp(),
|
||||||
.channel(getCurrentChannel())
|
DecodeEventType.RESPONSE, "SNDCP ACTIVATE TDS CONTEXT REJECT");
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("SNDCP ACTIVATE TDS CONTEXT REJECT")
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
break;
|
break;
|
||||||
case INBOUND_SNDCP_ACTIVATE_TDS_CONTEXT_REQUEST:
|
case INBOUND_SNDCP_ACTIVATE_TDS_CONTEXT_REQUEST:
|
||||||
broadcast(P25DecodeEvent.builder(message.getTimestamp())
|
processBroadcast(sndcpPacket.getIdentifiers(), message.getTimestamp(),
|
||||||
.channel(getCurrentChannel())
|
DecodeEventType.REQUEST, "SNDCP ACTIVATE TDS CONTEXT");
|
||||||
.eventDescription(DecodeEventType.REQUEST.toString())
|
|
||||||
.details("SNDCP ACTIVATE TDS CONTEXT")
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
break;
|
break;
|
||||||
case INBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_ACCEPT:
|
case INBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_ACCEPT:
|
||||||
broadcast(P25DecodeEvent.builder(message.getTimestamp())
|
processBroadcast(sndcpPacket.getIdentifiers(), message.getTimestamp(),
|
||||||
.channel(getCurrentChannel())
|
DecodeEventType.RESPONSE, "SNDCP DEACTIVATE TDS CONTEXT ACCEPT");
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("SNDCP DEACTIVATE TDS CONTEXT ACCEPT")
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
break;
|
break;
|
||||||
case INBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_REQUEST:
|
case INBOUND_SNDCP_DEACTIVATE_TDS_CONTEXT_REQUEST:
|
||||||
broadcast(P25DecodeEvent.builder(message.getTimestamp())
|
processBroadcast(sndcpPacket.getIdentifiers(), message.getTimestamp(),
|
||||||
.channel(getCurrentChannel())
|
DecodeEventType.REQUEST, "SNDCP DEACTIVATE TDS CONTEXT");
|
||||||
.eventDescription(DecodeEventType.REQUEST.toString())
|
|
||||||
.details("SNDCP DEACTIVATE TDS CONTEXT")
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1408,49 +1321,30 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof MotorolaDenyResponse)
|
if(tsbk instanceof MotorolaDenyResponse)
|
||||||
{
|
{
|
||||||
MotorolaDenyResponse dr = (MotorolaDenyResponse)tsbk;
|
MotorolaDenyResponse dr = (MotorolaDenyResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
"DENY: " + dr.getDeniedServiceType().getDescription() +
|
||||||
ic.update(tsbk.getIdentifiers());
|
" REASON: " + dr.getDenyReason() + " - INFO: " + dr.getAdditionalInfo());
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("DENY: " + dr.getDeniedServiceType().getDescription() +
|
|
||||||
" REASON: " + dr.getDenyReason() + " - INFO: " + dr.getAdditionalInfo())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processTSBKRoamingAddressRequest(TSBKMessage tsbk) {
|
private void processTSBKRoamingAddressRequest(TSBKMessage tsbk) {
|
||||||
MutableIdentifierCollection icRoamingRequest = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
//TODO: not sure if this should be used or not.
|
||||||
icRoamingRequest.remove(IdentifierClass.USER);
|
|
||||||
icRoamingRequest.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
||||||
.channel(getCurrentChannel())
|
.channel(getCurrentChannel())
|
||||||
.eventDescription(DecodeEventType.REQUEST.toString())
|
.eventDescription(DecodeEventType.REQUEST.toString())
|
||||||
.details("ROAMING ADDRESS")
|
.details("ROAMING ADDRESS")
|
||||||
|
// TODO: This identifierCollection is different from all the others.
|
||||||
.identifiers(new IdentifierCollection(tsbk.getIdentifiers()))
|
.identifiers(new IdentifierCollection(tsbk.getIdentifiers()))
|
||||||
.build());
|
.build());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processTSBKLocationRegistrationRequest(TSBKMessage tsbk) {
|
private void processTSBKLocationRegistrationRequest(TSBKMessage tsbk) {
|
||||||
if(tsbk instanceof LocationRegistrationRequest)
|
if(tsbk instanceof LocationRegistrationRequest)
|
||||||
{
|
{
|
||||||
LocationRegistrationRequest lrr = (LocationRegistrationRequest)tsbk;
|
LocationRegistrationRequest lrr = (LocationRegistrationRequest)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.REGISTER,
|
||||||
ic.remove(IdentifierClass.USER);
|
(lrr.isEmergency() ? "EMERGENCY " : "") +
|
||||||
ic.update(tsbk.getIdentifiers());
|
"LOCATION REGISTRATION REQUEST - CAPABILITY:" + lrr.getCapability());
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.REGISTER.toString())
|
|
||||||
.details((lrr.isEmergency() ? "EMERGENCY " : "") +
|
|
||||||
"LOCATION REGISTRATION REQUEST - CAPABILITY:" + lrr.getCapability())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1458,17 +1352,9 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof UnitRegistrationRequest)
|
if(tsbk instanceof UnitRegistrationRequest)
|
||||||
{
|
{
|
||||||
UnitRegistrationRequest urr = (UnitRegistrationRequest)tsbk;
|
UnitRegistrationRequest urr = (UnitRegistrationRequest)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.REGISTER,
|
||||||
ic.remove(IdentifierClass.USER);
|
(urr.isEmergency() ? "EMERGENCY " : "") +
|
||||||
ic.update(tsbk.getIdentifiers());
|
"UNIT REGISTRATION REQUEST - CAPABILITY:" + urr.getCapability());
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.REGISTER.toString())
|
|
||||||
.details((urr.isEmergency() ? "EMERGENCY " : "") +
|
|
||||||
"UNIT REGISTRATION REQUEST - CAPABILITY:" + urr.getCapability())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1476,17 +1362,9 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof GroupAffiliationQueryResponse)
|
if(tsbk instanceof GroupAffiliationQueryResponse)
|
||||||
{
|
{
|
||||||
GroupAffiliationQueryResponse gaqr = (GroupAffiliationQueryResponse)tsbk;
|
GroupAffiliationQueryResponse gaqr = (GroupAffiliationQueryResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
"AFFILIATION - GROUP:" + gaqr.getGroupAddress() +
|
||||||
ic.update(tsbk.getIdentifiers());
|
" ANNOUNCEMENT GROUP:" + gaqr.getAnnouncementGroupAddress());
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("AFFILIATION - GROUP:" + gaqr.getGroupAddress() +
|
|
||||||
" ANNOUNCEMENT GROUP:" + gaqr.getAnnouncementGroupAddress())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1494,17 +1372,9 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof ExtendedFunctionResponse)
|
if(tsbk instanceof ExtendedFunctionResponse)
|
||||||
{
|
{
|
||||||
ExtendedFunctionResponse efr = (ExtendedFunctionResponse)tsbk;
|
ExtendedFunctionResponse efr = (ExtendedFunctionResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
"EXTENDED FUNCTION:" + efr.getExtendedFunction() +
|
||||||
ic.update(tsbk.getIdentifiers());
|
" ARGUMENTS:" + efr.getArguments());
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("EXTENDED FUNCTION:" + efr.getExtendedFunction() +
|
|
||||||
" ARGUMENTS:" + efr.getArguments())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1512,18 +1382,10 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof CancelServiceRequest)
|
if(tsbk instanceof CancelServiceRequest)
|
||||||
{
|
{
|
||||||
CancelServiceRequest csr = (CancelServiceRequest)tsbk;
|
CancelServiceRequest csr = (CancelServiceRequest)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.REQUEST,
|
||||||
ic.remove(IdentifierClass.USER);
|
"CANCEL SERVICE:" + csr.getServiceType() +
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.REQUEST.toString())
|
|
||||||
.details("CANCEL SERVICE:" + csr.getServiceType() +
|
|
||||||
" REASON:" + csr.getCancelReason() + (csr.hasAdditionalInformation() ?
|
" REASON:" + csr.getCancelReason() + (csr.hasAdditionalInformation() ?
|
||||||
" INFO:" + csr.getAdditionalInformation() : ""))
|
" INFO:" + csr.getAdditionalInformation() : ""));
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1531,16 +1393,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof StatusQueryResponse)
|
if(tsbk instanceof StatusQueryResponse)
|
||||||
{
|
{
|
||||||
StatusQueryResponse sqr = (StatusQueryResponse)tsbk;
|
StatusQueryResponse sqr = (StatusQueryResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.STATUS,
|
||||||
ic.remove(IdentifierClass.USER);
|
"UNIT:" + sqr.getUnitStatus() + " USER:" + sqr.getUserStatus());
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.STATUS.toString())
|
|
||||||
.details("UNIT:" + sqr.getUnitStatus() + " USER:" + sqr.getUserStatus())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1548,16 +1402,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof StatusUpdateRequest)
|
if(tsbk instanceof StatusUpdateRequest)
|
||||||
{
|
{
|
||||||
StatusUpdateRequest sur = (StatusUpdateRequest)tsbk;
|
StatusUpdateRequest sur = (StatusUpdateRequest)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.STATUS,
|
||||||
ic.remove(IdentifierClass.USER);
|
"UNIT:" + sur.getUnitStatus() + " USER:" + sur.getUserStatus());
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.STATUS.toString())
|
|
||||||
.details("UNIT:" + sur.getUnitStatus() + " USER:" + sur.getUserStatus())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1565,17 +1411,10 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof SNDCPReconnectRequest)
|
if(tsbk instanceof SNDCPReconnectRequest)
|
||||||
{
|
{
|
||||||
SNDCPReconnectRequest srr = (SNDCPReconnectRequest)tsbk;
|
SNDCPReconnectRequest srr = (SNDCPReconnectRequest)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.REQUEST,
|
||||||
ic.remove(IdentifierClass.USER);
|
"SNDCP RECONNECT " + (srr.hasDataToSend() ? "- DATA TO SEND " : "")
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.REQUEST.toString())
|
|
||||||
.details("SNDCP RECONNECT " + (srr.hasDataToSend() ? "- DATA TO SEND " : "")
|
|
||||||
+ srr.getDataServiceOptions())
|
+ srr.getDataServiceOptions())
|
||||||
.identifiers(ic)
|
;
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1583,16 +1422,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof SNDCPDataPageResponse)
|
if(tsbk instanceof SNDCPDataPageResponse)
|
||||||
{
|
{
|
||||||
SNDCPDataPageResponse sdpr = (SNDCPDataPageResponse)tsbk;
|
SNDCPDataPageResponse sdpr = (SNDCPDataPageResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
sdpr.getAnswerResponse() + " SNDCP DATA " + sdpr.getDataServiceOptions());
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details(sdpr.getAnswerResponse() + " SNDCP DATA " + sdpr.getDataServiceOptions())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1600,16 +1431,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof TelephoneInterconnectAnswerResponse)
|
if(tsbk instanceof TelephoneInterconnectAnswerResponse)
|
||||||
{
|
{
|
||||||
TelephoneInterconnectAnswerResponse tiar = (TelephoneInterconnectAnswerResponse)tsbk;
|
TelephoneInterconnectAnswerResponse tiar = (TelephoneInterconnectAnswerResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
tiar.getAnswerResponse() + " TELEPHONE INTERCONNECT " + tiar.getVoiceServiceOptions());
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details(tiar.getAnswerResponse() + " TELEPHONE INTERCONNECT " + tiar.getVoiceServiceOptions())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1617,16 +1440,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof UnitToUnitVoiceServiceAnswerResponse)
|
if(tsbk instanceof UnitToUnitVoiceServiceAnswerResponse)
|
||||||
{
|
{
|
||||||
UnitToUnitVoiceServiceAnswerResponse uuvsar = (UnitToUnitVoiceServiceAnswerResponse)tsbk;
|
UnitToUnitVoiceServiceAnswerResponse uuvsar = (UnitToUnitVoiceServiceAnswerResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
uuvsar.getAnswerResponse() + " UNIT-2-UNIT VOICE SERVICE " + uuvsar.getVoiceServiceOptions());
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details(uuvsar.getAnswerResponse() + " UNIT-2-UNIT VOICE SERVICE " + uuvsar.getVoiceServiceOptions())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1634,16 +1449,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof UnitRegistrationResponse)
|
if(tsbk instanceof UnitRegistrationResponse)
|
||||||
{
|
{
|
||||||
UnitRegistrationResponse urr = (UnitRegistrationResponse)tsbk;
|
UnitRegistrationResponse urr = (UnitRegistrationResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.REGISTER,
|
||||||
ic.remove(IdentifierClass.USER);
|
urr.getResponse() + " UNIT REGISTRATION - UNIT ID:" + urr.getTargetUniqueId());
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.REGISTER.toString())
|
|
||||||
.details(urr.getResponse() + " UNIT REGISTRATION - UNIT ID:" + urr.getTargetUniqueId())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1651,16 +1458,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof LocationRegistrationResponse)
|
if(tsbk instanceof LocationRegistrationResponse)
|
||||||
{
|
{
|
||||||
LocationRegistrationResponse lrr = (LocationRegistrationResponse)tsbk;
|
LocationRegistrationResponse lrr = (LocationRegistrationResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.REGISTER,
|
||||||
ic.remove(IdentifierClass.USER);
|
lrr.getResponse() + " LOCATION REGISTRATION - GROUP:" + lrr.getGroupAddress());
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.REGISTER.toString())
|
|
||||||
.details(lrr.getResponse() + " LOCATION REGISTRATION - GROUP:" + lrr.getGroupAddress())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1668,19 +1467,10 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof GroupAffiliationResponse)
|
if(tsbk instanceof GroupAffiliationResponse)
|
||||||
{
|
{
|
||||||
GroupAffiliationResponse gar = (GroupAffiliationResponse)tsbk;
|
GroupAffiliationResponse gar = (GroupAffiliationResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE, gar.getAffiliationResponse() +
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details(gar.getAffiliationResponse() +
|
|
||||||
" AFFILIATION GROUP: " + gar.getGroupAddress() +
|
" AFFILIATION GROUP: " + gar.getGroupAddress() +
|
||||||
(gar.isGlobalAffiliation() ? " (GLOBAL)" : " (LOCAL)") +
|
(gar.isGlobalAffiliation() ? " (GLOBAL)" : " (LOCAL)") +
|
||||||
" ANNOUNCEMENT GROUP:" + gar.getAnnouncementGroupAddress())
|
" ANNOUNCEMENT GROUP:" + gar.getAnnouncementGroupAddress());
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1688,35 +1478,19 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof DenyResponse)
|
if(tsbk instanceof DenyResponse)
|
||||||
{
|
{
|
||||||
DenyResponse dr = (DenyResponse)tsbk;
|
DenyResponse dr = (DenyResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
"DENY: " + dr.getDeniedServiceType().getDescription() +
|
||||||
ic.update(tsbk.getIdentifiers());
|
" REASON: " + dr.getDenyReason() + " - INFO: " + dr.getAdditionalInfo());
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("DENY: " + dr.getDeniedServiceType().getDescription() +
|
|
||||||
" REASON: " + dr.getDenyReason() + " - INFO: " + dr.getAdditionalInfo())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processTSBKExtendedFunctionCommand(TSBKMessage tsbk) {
|
private void processTSBKExtendedFunctionCommand(TSBKMessage tsbk) {
|
||||||
if(tsbk instanceof ExtendedFunctionCommand)
|
if(tsbk instanceof ExtendedFunctionCommand)
|
||||||
{
|
{
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
ExtendedFunctionCommand efc = (ExtendedFunctionCommand)tsbk;
|
ExtendedFunctionCommand efc = (ExtendedFunctionCommand)tsbk;
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
processBroadcast(tsbk, DecodeEventType.COMMAND,
|
||||||
.channel(getCurrentChannel())
|
"EXTENDED FUNCTION: " + efc.getExtendedFunction() +
|
||||||
.eventDescription(DecodeEventType.COMMAND.toString())
|
" ARGUMENTS:" + efc.getArguments());
|
||||||
.details("EXTENDED FUNCTION: " + efc.getExtendedFunction() +
|
|
||||||
" ARGUMENTS:" + efc.getArguments())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1724,35 +1498,19 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof QueuedResponse)
|
if(tsbk instanceof QueuedResponse)
|
||||||
{
|
{
|
||||||
QueuedResponse qr = (QueuedResponse)tsbk;
|
QueuedResponse qr = (QueuedResponse)tsbk;
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
ic.remove(IdentifierClass.USER);
|
"QUEUED: " + qr.getQueuedResponseServiceType().getDescription() +
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("QUEUED: " + qr.getQueuedResponseServiceType().getDescription() +
|
|
||||||
" REASON: " + qr.getQueuedResponseReason() +
|
" REASON: " + qr.getQueuedResponseReason() +
|
||||||
" INFO: " + qr.getAdditionalInfo())
|
" INFO: " + qr.getAdditionalInfo());
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processTSBKAcknowledgeResponse(TSBKMessage tsbk) {
|
private void processTSBKAcknowledgeResponse(TSBKMessage tsbk) {
|
||||||
if(tsbk instanceof AcknowledgeResponse)
|
if(tsbk instanceof AcknowledgeResponse)
|
||||||
{
|
{
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
AcknowledgeResponse ar = (AcknowledgeResponse)tsbk;
|
AcknowledgeResponse ar = (AcknowledgeResponse)tsbk;
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
processBroadcast(tsbk, DecodeEventType.RESPONSE,
|
||||||
.channel(getCurrentChannel())
|
"ACKNOWLEDGE " + ar.getAcknowledgedServiceType().getDescription());
|
||||||
.eventDescription(DecodeEventType.RESPONSE.toString())
|
|
||||||
.details("ACKNOWLEDGE " + ar.getAcknowledgedServiceType().getDescription())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1760,34 +1518,17 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(tsbk instanceof StatusUpdate)
|
if(tsbk instanceof StatusUpdate)
|
||||||
{
|
{
|
||||||
StatusUpdate su = (StatusUpdate)tsbk;
|
StatusUpdate su = (StatusUpdate)tsbk;
|
||||||
|
processBroadcast(tsbk, DecodeEventType.STATUS,
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
"UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus());
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.STATUS.toString())
|
|
||||||
.details("UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void processTSBKTelephoneInterconnectAnswerRequest(TSBKMessage tsbk) {
|
private void processTSBKTelephoneInterconnectAnswerRequest(TSBKMessage tsbk) {
|
||||||
if(tsbk instanceof TelephoneInterconnectAnswerRequest)
|
if(tsbk instanceof TelephoneInterconnectAnswerRequest)
|
||||||
{
|
{
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(tsbk.getIdentifiers());
|
|
||||||
|
|
||||||
TelephoneInterconnectAnswerRequest tiar = (TelephoneInterconnectAnswerRequest)tsbk;
|
TelephoneInterconnectAnswerRequest tiar = (TelephoneInterconnectAnswerRequest)tsbk;
|
||||||
broadcast(P25DecodeEvent.builder(tsbk.getTimestamp())
|
processBroadcast(tsbk, DecodeEventType.PAGE,
|
||||||
.channel(getCurrentChannel())
|
"TELEPHONE ANSWER REQUEST: " + tiar.getTelephoneNumber());
|
||||||
.eventDescription(DecodeEventType.PAGE.toString())
|
|
||||||
.details("TELEPHONE ANSWER REQUEST: " + tiar.getTelephoneNumber())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1841,9 +1582,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
TelephoneInterconnectVoiceChannelGrantUpdate tivcgu = (TelephoneInterconnectVoiceChannelGrantUpdate)tsbk;
|
TelephoneInterconnectVoiceChannelGrantUpdate tivcgu = (TelephoneInterconnectVoiceChannelGrantUpdate)tsbk;
|
||||||
|
|
||||||
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
||||||
MutableIdentifierCollection identifiers = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifiers = getMutableIdentifierCollection(tivcgu.getIdentifiers());
|
||||||
identifiers.remove(IdentifierClass.USER);
|
|
||||||
identifiers.update(tivcgu.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(tivcgu.getChannel(), tivcgu.getVoiceServiceOptions(),
|
processChannelGrant(tivcgu.getChannel(), tivcgu.getVoiceServiceOptions(),
|
||||||
identifiers, tsbk.getOpcode(), tivcgu.getTimestamp());
|
identifiers, tsbk.getOpcode(), tivcgu.getTimestamp());
|
||||||
@@ -1856,9 +1595,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
SNDCPDataChannelGrant dcg = (SNDCPDataChannelGrant)tsbk;
|
SNDCPDataChannelGrant dcg = (SNDCPDataChannelGrant)tsbk;
|
||||||
|
|
||||||
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
||||||
MutableIdentifierCollection identifiers = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifiers = getMutableIdentifierCollection(dcg.getIdentifiers());
|
||||||
identifiers.remove(IdentifierClass.USER);
|
|
||||||
identifiers.update(dcg.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(dcg.getChannel(), dcg.getServiceOptions(),
|
processChannelGrant(dcg.getChannel(), dcg.getServiceOptions(),
|
||||||
identifiers, tsbk.getOpcode(), dcg.getTimestamp());
|
identifiers, tsbk.getOpcode(), dcg.getTimestamp());
|
||||||
@@ -1871,9 +1608,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
TelephoneInterconnectVoiceChannelGrant tivcg = (TelephoneInterconnectVoiceChannelGrant)tsbk;
|
TelephoneInterconnectVoiceChannelGrant tivcg = (TelephoneInterconnectVoiceChannelGrant)tsbk;
|
||||||
|
|
||||||
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
||||||
MutableIdentifierCollection identifiers = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifiers = getMutableIdentifierCollection(tivcg.getIdentifiers());
|
||||||
identifiers.remove(IdentifierClass.USER);
|
|
||||||
identifiers.update(tivcg.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(tivcg.getChannel(), tivcg.getVoiceServiceOptions(),
|
processChannelGrant(tivcg.getChannel(), tivcg.getVoiceServiceOptions(),
|
||||||
identifiers, tsbk.getOpcode(), tivcg.getTimestamp());
|
identifiers, tsbk.getOpcode(), tivcg.getTimestamp());
|
||||||
@@ -1886,9 +1621,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
UnitToUnitVoiceChannelGrantUpdate uuvcgu = (UnitToUnitVoiceChannelGrantUpdate)tsbk;
|
UnitToUnitVoiceChannelGrantUpdate uuvcgu = (UnitToUnitVoiceChannelGrantUpdate)tsbk;
|
||||||
|
|
||||||
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
||||||
MutableIdentifierCollection identifiers = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifiers = getMutableIdentifierCollection(uuvcgu.getIdentifiers());
|
||||||
identifiers.remove(IdentifierClass.USER);
|
|
||||||
identifiers.update(uuvcgu.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(uuvcgu.getChannel(), null, identifiers,
|
processChannelGrant(uuvcgu.getChannel(), null, identifiers,
|
||||||
tsbk.getOpcode(), uuvcgu.getTimestamp());
|
tsbk.getOpcode(), uuvcgu.getTimestamp());
|
||||||
@@ -1901,9 +1634,7 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
UnitToUnitVoiceChannelGrant uuvcg = (UnitToUnitVoiceChannelGrant)tsbk;
|
UnitToUnitVoiceChannelGrant uuvcg = (UnitToUnitVoiceChannelGrant)tsbk;
|
||||||
|
|
||||||
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
//Make a copy of current identifiers and remove current user identifiers and replace from message
|
||||||
MutableIdentifierCollection identifiers = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
MutableIdentifierCollection identifiers = getMutableIdentifierCollection(uuvcg.getIdentifiers());
|
||||||
identifiers.remove(IdentifierClass.USER);
|
|
||||||
identifiers.update(uuvcg.getIdentifiers());
|
|
||||||
|
|
||||||
processChannelGrant(uuvcg.getChannel(), null, identifiers,
|
processChannelGrant(uuvcg.getChannel(), null, identifiers,
|
||||||
tsbk.getOpcode(), uuvcg.getTimestamp());
|
tsbk.getOpcode(), uuvcg.getTimestamp());
|
||||||
@@ -2080,18 +1811,9 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(lcw instanceof LCExtendedFunctionCommand)
|
if(lcw instanceof LCExtendedFunctionCommand)
|
||||||
{
|
{
|
||||||
LCExtendedFunctionCommand efc = (LCExtendedFunctionCommand)lcw;
|
LCExtendedFunctionCommand efc = (LCExtendedFunctionCommand)lcw;
|
||||||
|
processBroadcast(lcw.getIdentifiers(), timestamp, DecodeEventType.COMMAND,
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
"Extended Function: " + efc.getExtendedFunction() +
|
||||||
ic.remove(IdentifierClass.USER);
|
" Arguments:" + efc.getExtendedFunctionArguments());
|
||||||
ic.update(lcw.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(timestamp)
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.COMMAND.toString())
|
|
||||||
.details("Extended Function: " + efc.getExtendedFunction() +
|
|
||||||
" Arguments:" + efc.getExtendedFunctionArguments())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GROUP_AFFILIATION_QUERY:
|
case GROUP_AFFILIATION_QUERY:
|
||||||
@@ -2100,17 +1822,9 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
case MESSAGE_UPDATE:
|
case MESSAGE_UPDATE:
|
||||||
if(lcw instanceof LCMessageUpdate)
|
if(lcw instanceof LCMessageUpdate)
|
||||||
{
|
{
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(lcw.getIdentifiers());
|
|
||||||
|
|
||||||
LCMessageUpdate mu = (LCMessageUpdate)lcw;
|
LCMessageUpdate mu = (LCMessageUpdate)lcw;
|
||||||
broadcast(P25DecodeEvent.builder(timestamp)
|
processBroadcast(lcw.getIdentifiers(), timestamp, DecodeEventType.SDM,
|
||||||
.channel(getCurrentChannel())
|
"MSG:" + mu.getShortDataMessage());
|
||||||
.eventDescription(DecodeEventType.SDM.toString())
|
|
||||||
.details("MSG:" + mu.getShortDataMessage())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATUS_QUERY:
|
case STATUS_QUERY:
|
||||||
@@ -2120,17 +1834,8 @@ public class P25P1DecoderState extends DecoderState implements IChannelEventList
|
|||||||
if(lcw instanceof LCStatusUpdate)
|
if(lcw instanceof LCStatusUpdate)
|
||||||
{
|
{
|
||||||
LCStatusUpdate su = (LCStatusUpdate)lcw;
|
LCStatusUpdate su = (LCStatusUpdate)lcw;
|
||||||
|
processBroadcast(lcw.getIdentifiers(), timestamp, DecodeEventType.STATUS,
|
||||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
"UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus());
|
||||||
ic.remove(IdentifierClass.USER);
|
|
||||||
ic.update(lcw.getIdentifiers());
|
|
||||||
|
|
||||||
broadcast(P25DecodeEvent.builder(timestamp)
|
|
||||||
.channel(getCurrentChannel())
|
|
||||||
.eventDescription(DecodeEventType.STATUS.toString())
|
|
||||||
.details("UNIT:" + su.getUnitStatus() + " USER:" + su.getUserStatus())
|
|
||||||
.identifiers(ic)
|
|
||||||
.build());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TELEPHONE_INTERCONNECT_ANSWER_REQUEST:
|
case TELEPHONE_INTERCONNECT_ANSWER_REQUEST:
|
||||||
|
|||||||
Reference in New Issue
Block a user