Skip to content

Commit

Permalink
#1834 DMR CapMax Adv mode call events can have 'No Frequency'. Update…
Browse files Browse the repository at this point in the history
…d message class to ensure all 4x channels get nominated for timeslot frequency enrichment where previously the timeslot 2 channels might not receive a frequency enrichment. Also protected against bad logging for an UnknownCSBKMessage that gets constructed and CRC correction causing the message to have a valid channel grant opcode. (#1835)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
  • Loading branch information
DSheirer and Dennis Sheirer committed Feb 10, 2024
1 parent f6c4cc8 commit aeeed71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Expand Up @@ -46,6 +46,7 @@
import io.github.dsheirer.module.decode.dmr.message.DMRMessage;
import io.github.dsheirer.module.decode.dmr.message.data.DataMessage;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.UnknownCSBKMessage;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.hytera.HyteraTrafficChannelTalkerStatus;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityMaxAdvantageModeVoiceChannelUpdate;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityMaxAloha;
Expand Down Expand Up @@ -886,7 +887,12 @@ private void processCSBK(CSBKMessage csbk)
}
else
{
mLog.error("Unrecognized DMR channel grant CSBK ignored: " + csbk.getClass());
//Log when a CSBK that is not the Unknown CSBK is processed, to detect when new opcodes are added
//that are not ChannelGrant subclass implementations.
if(!(csbk instanceof UnknownCSBKMessage))
{
mLog.error("Unrecognized DMR channel grant CSBK ignored: " + csbk.getClass());
}
}
break;
case MOTOROLA_CAPMAX_ALOHA:
Expand Down
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -30,7 +30,6 @@
import io.github.dsheirer.module.decode.dmr.message.CACH;
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;

import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -281,18 +280,19 @@ public void apply(List<TimeslotFrequency> timeslotFrequencies)
public int[] getLogicalChannelNumbers()
{
//Since both timeslots share the same LCN, we use just TS1's channel for both channel 1 and channel 2
if(hasChannel1Timeslot1() && hasChannel2Timeslot1())
if((hasChannel1Timeslot1() || hasChannel1Timeslot2()) && (hasChannel2Timeslot1() || hasChannel2Timeslot2()))
{
return new int[]{getChannel1TS1().getChannelId(), getChannel2TS1().getChannelId()};
}
else if(hasChannel1Timeslot1())
else if((hasChannel1Timeslot1() || hasChannel1Timeslot2()))
{
return new int[]{getChannel1TS1().getChannelId()};
}
else if(hasChannel2Timeslot1())
else if((hasChannel2Timeslot1() || hasChannel2Timeslot2()))
{
return new int[]{getChannel2TS1().getChannelId()};
}

return getChannel1TS1().getLogicalChannelNumbers();
}

Expand Down

0 comments on commit aeeed71

Please sign in to comment.