Skip to content

Commit

Permalink
#1914 cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Sheirer committed May 12, 2024
1 parent a43e76d commit 59e12af
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ public void update(RadioIdentifier identifier, TalkerAliasIdentifier alias)
}
}

/**
* Indicates if an alias exists for the identifier
* @param radioIdentifier to test
* @return true if an alias exists.
*/
public boolean hasAlias(RadioIdentifier radioIdentifier)
{
return mAliasMap.containsKey(radioIdentifier.getValue());
}

/**
* Enriches the immutable identifier collection by detecting a radio identifier with the FROM role, lookup a
* matching alias, and insert the alias into a new mutable identifier collection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public String getPatchGroupSummary()

if(trackers.isEmpty())
{
sb.append("None\n");
sb.append(" None\n");
}
else
{
for(PatchGroupTracker tracker : trackers)
{
sb.append(" ").append(tracker.mPatchGroupIdentifier).append("\n");
sb.append(" ").append(tracker.mPatchGroupIdentifier).append("\n");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@
*/
public class P25P1DecoderState extends DecoderState implements IChannelEventListener
{
private static final Logger mLog = LoggerFactory.getLogger(P25P1DecoderState.class);
private static final LoggingSuppressor LOGGING_SUPPRESSOR = new LoggingSuppressor(mLog);
private static final Logger LOGGER = LoggerFactory.getLogger(P25P1DecoderState.class);
private static final LoggingSuppressor LOGGING_SUPPRESSOR = new LoggingSuppressor(LOGGER);
private final Channel mChannel;
private final P25P1Decoder.Modulation mModulation;
private final PatchGroupManager mPatchGroupManager = new PatchGroupManager();
Expand Down Expand Up @@ -320,7 +320,11 @@ public void receive(IMessage iMessage)
}
else if(iMessage instanceof MotorolaTalkerAliasComplete tac)
{
getIdentifierCollection().update(tac.getAlias());
//Debug
if(!mTrafficChannelManager.getTalkerAliasManager().hasAlias(tac.getRadio()))
{
System.out.println(tac);
}
mTrafficChannelManager.getTalkerAliasManager().update(tac.getRadio(), tac.getAlias());
}
}
Expand Down Expand Up @@ -684,7 +688,7 @@ private void processAMBTC(P25P1Message message)
}
break;
default:
mLog.debug("Unrecognized AMBTC Opcode: " + ambtc.getHeader().getOpcode().name());
LOGGER.debug("Unrecognized AMBTC Opcode: " + ambtc.getHeader().getOpcode().name());
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ public MotorolaTalkerAliasComplete assemble() throws IllegalStateException

mHeader = null;
mDataBlocks.clear();

System.out.println(complete);
return complete;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ else if(message instanceof EncryptionSynchronizationSequence ess)
}
else if(message instanceof MotorolaTalkerAliasComplete tac)
{
getIdentifierCollection().update(tac.getAlias());
//Debug
if(!mTrafficChannelManager.getTalkerAliasManager().hasAlias(tac.getRadio()))
{
System.out.println(tac);
}
mTrafficChannelManager.getTalkerAliasManager().update(tac.getRadio(), tac.getAlias());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ public MotorolaTalkerAliasComplete assemble() throws IllegalStateException

mHeader = null;
mDataBlocks.clear();

System.out.println(complete);
return complete;
}
}

0 comments on commit 59e12af

Please sign in to comment.