mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user