From aeeed71231cbb5d869071b487294703aa224981c Mon Sep 17 00:00:00 2001 From: Denny Sheirer Date: Sat, 10 Feb 2024 04:42:50 -0500 Subject: [PATCH] #1834 DMR CapMax Adv mode call events can have 'No Frequency'. Updated 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/module/decode/dmr/DMRDecoderState.java | 8 +++++++- .../CapacityMaxAdvantageModeVoiceChannelUpdate.java | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/dsheirer/module/decode/dmr/DMRDecoderState.java b/src/main/java/io/github/dsheirer/module/decode/dmr/DMRDecoderState.java index dd088695a..2334294f4 100644 --- a/src/main/java/io/github/dsheirer/module/decode/dmr/DMRDecoderState.java +++ b/src/main/java/io/github/dsheirer/module/decode/dmr/DMRDecoderState.java @@ -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; @@ -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: diff --git a/src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/motorola/CapacityMaxAdvantageModeVoiceChannelUpdate.java b/src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/motorola/CapacityMaxAdvantageModeVoiceChannelUpdate.java index 92249ef1e..f0b10fc95 100644 --- a/src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/motorola/CapacityMaxAdvantageModeVoiceChannelUpdate.java +++ b/src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/motorola/CapacityMaxAdvantageModeVoiceChannelUpdate.java @@ -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 @@ -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; @@ -281,18 +280,19 @@ public void apply(List 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(); }