mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
#1974 P25 Fully Qualified Talkgroup/Radio values shouldn't replace local ID/address, when the value is zero, with the fully qualified ID, which causes incorrect aliasing. (#1975)
Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
@@ -41,7 +41,7 @@ public abstract class FullyQualifiedRadioIdentifier extends RadioIdentifier
|
||||
*/
|
||||
public FullyQualifiedRadioIdentifier(int localAddress, int wacn, int system, int id, Role role)
|
||||
{
|
||||
super(localAddress > 0 ? localAddress : id, role);
|
||||
super(localAddress, role);
|
||||
mWacn = wacn;
|
||||
mSystem = system;
|
||||
mRadio = id;
|
||||
@@ -92,4 +92,23 @@ public abstract class FullyQualifiedRadioIdentifier extends RadioIdentifier
|
||||
return getFullyQualifiedRadioAddress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
//Attempt to match as a fully qualified radio match first
|
||||
if(o instanceof FullyQualifiedRadioIdentifier fqri)
|
||||
{
|
||||
return getWacn() == fqri.getWacn() &&
|
||||
getSystem() == fqri.getSystem() &&
|
||||
getRadio() == fqri.getRadio();
|
||||
}
|
||||
//Attempt to match the local address against a simple radio version
|
||||
else if(o instanceof RadioIdentifier ri)
|
||||
{
|
||||
return getValue() != 0 && ri.getValue() != 0 && getValue().equals(ri.getValue());
|
||||
}
|
||||
|
||||
return super.equals(o);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public abstract class FullyQualifiedTalkgroupIdentifier extends TalkgroupIdentif
|
||||
*/
|
||||
public FullyQualifiedTalkgroupIdentifier(int localAddress, int wacn, int system, int id, Role role)
|
||||
{
|
||||
super(localAddress > 0 ? localAddress : id, role);
|
||||
super(localAddress, role);
|
||||
mWacn = wacn;
|
||||
mSystem = system;
|
||||
mTalkgroup = id;
|
||||
@@ -91,4 +91,23 @@ public abstract class FullyQualifiedTalkgroupIdentifier extends TalkgroupIdentif
|
||||
return getFullyQualifiedTalkgroupAddress();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
//Attempt to match as a fully qualified talkgroup match first
|
||||
if(o instanceof FullyQualifiedTalkgroupIdentifier fqti)
|
||||
{
|
||||
return getWacn() == fqti.getWacn() &&
|
||||
getSystem() == fqti.getSystem() &&
|
||||
getTalkgroup() == fqti.getTalkgroup();
|
||||
}
|
||||
//Attempt to match the local address against a simple talkgroup version
|
||||
else if(o instanceof TalkgroupIdentifier ti)
|
||||
{
|
||||
return getValue() != 0 && ti.getValue() != 0 && getValue().equals(ti.getValue());
|
||||
}
|
||||
|
||||
return super.equals(o);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user