mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
467 Alias List Update On Alias Delete/Change (#470)
* Updates playlist to fully clean aliases from the alias list when deleted and to perform a delete and re-add on any alias that changes, to ensure that the alias list is kept fully up to date. Removed site id as an alias identifier. Add support for converting ltr-net uid's to talkgroups in playlist updater and updated playlist to version 3 to ensure anyone using current codebase will have their playlists fully updated. Moved MIN, UniqueID and Site ID to the legacy package and updated label descriptions to signify that they are no longer supported.
This commit is contained in:
@@ -37,7 +37,7 @@ import io.github.dsheirer.message.MessageDirection;
|
||||
import io.github.dsheirer.module.decode.DecoderType;
|
||||
import io.github.dsheirer.module.decode.event.DecodeEvent;
|
||||
import io.github.dsheirer.module.decode.ltrnet.channel.LtrNetChannel;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.UniqueIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrNetRadioIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.message.LtrNetMessage;
|
||||
import io.github.dsheirer.module.decode.ltrnet.message.isw.IswCallEnd;
|
||||
import io.github.dsheirer.module.decode.ltrnet.message.isw.IswCallStart;
|
||||
@@ -82,7 +82,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
private SiteId mCurrentSite;
|
||||
private int mCurrentChannelNumber;
|
||||
private Set<LTRTalkgroup> mTalkgroups = new TreeSet<>();
|
||||
private Set<UniqueIdentifier> mUniqueIdentifiers = new TreeSet<>();
|
||||
private Set<LtrNetRadioIdentifier> mLtrNetRadioIdentifiers = new TreeSet<>();
|
||||
private Set<ESNIdentifier> mESNIdentifiers = new TreeSet<>();
|
||||
private DecodeEvent mCurrentCallEvent;
|
||||
private LTRTalkgroup mCurrentCallTalkgroup;
|
||||
@@ -121,7 +121,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
mCurrentSite = null;
|
||||
mCurrentChannelNumber = 0;
|
||||
mTalkgroups.clear();
|
||||
mUniqueIdentifiers.clear();
|
||||
mLtrNetRadioIdentifiers.clear();
|
||||
mESNIdentifiers.clear();
|
||||
resetState();
|
||||
}
|
||||
@@ -388,7 +388,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
{
|
||||
IswUniqueId iswUniqueId = (IswUniqueId)message;
|
||||
getIdentifierCollection().update(iswUniqueId.getUniqueID());
|
||||
mUniqueIdentifiers.add(iswUniqueId.getUniqueID());
|
||||
mLtrNetRadioIdentifiers.add(iswUniqueId.getUniqueID());
|
||||
updateCurrentCallIdentifiers();
|
||||
broadcast(new DecoderStateEvent(this, Event.CONTINUATION, State.DATA));
|
||||
}
|
||||
@@ -462,7 +462,7 @@ public class LTRNetDecoderState extends DecoderState
|
||||
if(message instanceof RegistrationAccept)
|
||||
{
|
||||
RegistrationAccept registrationAccept = (RegistrationAccept)message;
|
||||
mUniqueIdentifiers.add(registrationAccept.getUniqueID());
|
||||
mLtrNetRadioIdentifiers.add(registrationAccept.getUniqueID());
|
||||
MutableIdentifierCollection ic = new MutableIdentifierCollection(getIdentifierCollection().getIdentifiers());
|
||||
ic.remove(IdentifierClass.USER);
|
||||
ic.update(message.getIdentifiers());
|
||||
@@ -580,18 +580,18 @@ public class LTRNetDecoderState extends DecoderState
|
||||
|
||||
sb.append("\nActive Radio Unique IDs\n");
|
||||
|
||||
if(mUniqueIdentifiers.isEmpty())
|
||||
if(mLtrNetRadioIdentifiers.isEmpty())
|
||||
{
|
||||
sb.append(" None\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
List<UniqueIdentifier> uniqueIdentifiers = new ArrayList<>(mUniqueIdentifiers);
|
||||
Collections.sort(uniqueIdentifiers, Comparator.comparingInt(Identifier::getValue));
|
||||
List<LtrNetRadioIdentifier> ltrNetRadioIdentifiers = new ArrayList<>(mLtrNetRadioIdentifiers);
|
||||
Collections.sort(ltrNetRadioIdentifiers, Comparator.comparingInt(Identifier::getValue));
|
||||
|
||||
for(UniqueIdentifier uniqueIdentifier: uniqueIdentifiers)
|
||||
for(LtrNetRadioIdentifier ltrNetRadioIdentifier : ltrNetRadioIdentifiers)
|
||||
{
|
||||
sb.append(" ").append(uniqueIdentifier).append("\n");
|
||||
sb.append(" ").append(ltrNetRadioIdentifier).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,20 +20,18 @@
|
||||
|
||||
package io.github.dsheirer.module.decode.ltrnet.identifier;
|
||||
|
||||
import io.github.dsheirer.identifier.Form;
|
||||
import io.github.dsheirer.identifier.IdentifierClass;
|
||||
import io.github.dsheirer.identifier.Role;
|
||||
import io.github.dsheirer.identifier.integer.IntegerIdentifier;
|
||||
import io.github.dsheirer.identifier.talkgroup.TalkgroupIdentifier;
|
||||
import io.github.dsheirer.protocol.Protocol;
|
||||
|
||||
/**
|
||||
* Unique ID or radio ID for LTR-Net radios is a 16-bit logical network radio identifier value.
|
||||
*/
|
||||
public class UniqueIdentifier extends IntegerIdentifier implements Comparable<UniqueIdentifier>
|
||||
public class LtrNetRadioIdentifier extends TalkgroupIdentifier implements Comparable<LtrNetRadioIdentifier>
|
||||
{
|
||||
public UniqueIdentifier(int value, Role role)
|
||||
public LtrNetRadioIdentifier(int value, Role role)
|
||||
{
|
||||
super(value, IdentifierClass.USER, Form.UNIQUE_ID, role);
|
||||
super(value, role, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,21 +43,21 @@ public class UniqueIdentifier extends IntegerIdentifier implements Comparable<Un
|
||||
/**
|
||||
* Creates a unique identifier for the FROM radio role
|
||||
*/
|
||||
public static UniqueIdentifier createFrom(int value)
|
||||
public static LtrNetRadioIdentifier createFrom(int value)
|
||||
{
|
||||
return new UniqueIdentifier(value, Role.FROM);
|
||||
return new LtrNetRadioIdentifier(value, Role.FROM);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a unique identifier for the TO radio role
|
||||
*/
|
||||
public static UniqueIdentifier createTo(int value)
|
||||
public static LtrNetRadioIdentifier createTo(int value)
|
||||
{
|
||||
return new UniqueIdentifier(value, Role.TO);
|
||||
return new LtrNetRadioIdentifier(value, Role.TO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(UniqueIdentifier o)
|
||||
public int compareTo(LtrNetRadioIdentifier o)
|
||||
{
|
||||
return getValue().compareTo(o.getValue());
|
||||
}
|
||||
@@ -22,7 +22,7 @@ package io.github.dsheirer.module.decode.ltrnet.message.isw;
|
||||
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
||||
import io.github.dsheirer.identifier.Identifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.UniqueIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrNetRadioIdentifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
public class IswUniqueId extends LtrNetIswMessage
|
||||
{
|
||||
private UniqueIdentifier mUniqueIdentifier;
|
||||
private LtrNetRadioIdentifier mLtrNetRadioIdentifier;
|
||||
private List<Identifier> mIdentifiers;
|
||||
|
||||
/**
|
||||
@@ -50,14 +50,14 @@ public class IswUniqueId extends LtrNetIswMessage
|
||||
return LtrNetMessageType.ISW_UNIQUE_ID;
|
||||
}
|
||||
|
||||
public UniqueIdentifier getUniqueID()
|
||||
public LtrNetRadioIdentifier getUniqueID()
|
||||
{
|
||||
if(mUniqueIdentifier == null)
|
||||
if(mLtrNetRadioIdentifier == null)
|
||||
{
|
||||
mUniqueIdentifier = UniqueIdentifier.createFrom(getMessage().getInt(SIXTEEN_BITS));
|
||||
mLtrNetRadioIdentifier = LtrNetRadioIdentifier.createFrom(getMessage().getInt(SIXTEEN_BITS));
|
||||
}
|
||||
|
||||
return mUniqueIdentifier;
|
||||
return mLtrNetRadioIdentifier;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ package io.github.dsheirer.module.decode.ltrnet.message.osw;
|
||||
import io.github.dsheirer.bits.CorrectedBinaryMessage;
|
||||
import io.github.dsheirer.identifier.Identifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.LtrNetMessageType;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.UniqueIdentifier;
|
||||
import io.github.dsheirer.module.decode.ltrnet.identifier.LtrNetRadioIdentifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
*/
|
||||
public class RegistrationAccept extends LtrNetOswMessage
|
||||
{
|
||||
private UniqueIdentifier mUniqueIdentifier;
|
||||
private LtrNetRadioIdentifier mLtrNetRadioIdentifier;
|
||||
private List<Identifier> mIdentifiers;
|
||||
|
||||
/**
|
||||
@@ -49,14 +49,14 @@ public class RegistrationAccept extends LtrNetOswMessage
|
||||
return LtrNetMessageType.OSW_REGISTRATION_ACCEPT;
|
||||
}
|
||||
|
||||
public UniqueIdentifier getUniqueID()
|
||||
public LtrNetRadioIdentifier getUniqueID()
|
||||
{
|
||||
if(mUniqueIdentifier == null)
|
||||
if(mLtrNetRadioIdentifier == null)
|
||||
{
|
||||
mUniqueIdentifier = UniqueIdentifier.createTo(getMessage().getInt(SIXTEEN_BITS));
|
||||
mLtrNetRadioIdentifier = LtrNetRadioIdentifier.createTo(getMessage().getInt(SIXTEEN_BITS));
|
||||
}
|
||||
|
||||
return mUniqueIdentifier;
|
||||
return mLtrNetRadioIdentifier;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user