Skip to content

Commit 3df8d60

Browse files
wedgef5Matthew Foster
andauthored
#1507 Resolves issue with Cap+ LSN parsing. Updates Cap+ Site Status and adds RAS bit handling. (#1536)
Co-authored-by: Matthew Foster <[email protected]>
1 parent b39dd1a commit 3df8d60

File tree

66 files changed

+794
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+794
-250
lines changed

src/main/java/io/github/dsheirer/edac/BPTC_196_96.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
1+
/*
2+
* *****************************************************************************
3+
* Copyright (C) 2014-2023 Dennis Sheirer
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>
17+
* ****************************************************************************
18+
*/
19+
120
package io.github.dsheirer.edac;
221

322
import io.github.dsheirer.bits.BinaryMessage;
423
import io.github.dsheirer.bits.BitSetFullException;
524
import io.github.dsheirer.bits.CorrectedBinaryMessage;
6-
725
import java.util.ArrayList;
826
import java.util.Collections;
927
import java.util.List;
@@ -14,7 +32,7 @@
1432
public class BPTC_196_96
1533
{
1634
public static final int BPTC_LENGTH = 196;
17-
public static final int EXTRACTED_LENGTH = 96;
35+
public static final int EXTRACTED_LENGTH = 96; //However, we set the 3x reserved bits in 96, 97, and 98 making the length 99
1836
public static final int MAX_ORIGINAL_INDEX = 136;
1937
public static final int COLUMN_COUNT = 15;
2038
public static final int MESSAGE_COLUMN_COUNT = 12; //Should be 11, but adjusted for the first pad bit
@@ -99,6 +117,11 @@ public static CorrectedBinaryMessage extract(CorrectedBinaryMessage original)
99117
}
100118
}
101119

120+
//Transfer bits R2, R1, and R0 to the end - RAS bits
121+
extracted.set(96, message.get(0));
122+
extracted.set(97, message.get(1));
123+
extracted.set(98, message.get(2));
124+
102125
return extracted;
103126
}
104127

src/main/java/io/github/dsheirer/module/decode/dmr/DMRDecoderState.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import io.github.dsheirer.module.decode.dmr.message.data.csbk.CSBKMessage;
4545
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityMaxAloha;
4646
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusNeighbors;
47-
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusSystemStatus;
47+
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusSiteStatus;
4848
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.ConnectPlusDataChannelGrant;
4949
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.ConnectPlusVoiceChannelUser;
5050
import io.github.dsheirer.module.decode.dmr.message.data.csbk.standard.Aloha;
@@ -673,10 +673,10 @@ private void processCSBK(CSBKMessage csbk)
673673
updateRestChannel(((CapacityPlusNeighbors)csbk).getRestChannel());
674674
}
675675
break;
676-
case MOTOROLA_CAPPLUS_SYSTEM_STATUS:
677-
if(csbk instanceof CapacityPlusSystemStatus)
676+
case MOTOROLA_CAPPLUS_SITE_STATUS:
677+
if(csbk instanceof CapacityPlusSiteStatus)
678678
{
679-
CapacityPlusSystemStatus cpss = (CapacityPlusSystemStatus)csbk;
679+
CapacityPlusSiteStatus cpss = (CapacityPlusSiteStatus)csbk;
680680

681681
//Channel rotation monitor normally uses only CONTROL state, so when we detect that we're a
682682
//Capacity plus system, add ACTIVE as an active state to the monitor. This can be requested repeatedly.

src/main/java/io/github/dsheirer/module/decode/dmr/DMRMessageFramer.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,15 @@ private static Identity getIdentity(LRRPPacket packet)
377377

378378
public static void main(String[] args)
379379
{
380-
String path = "/media/denny/Lexar/Recordings/DMR/";
380+
String path = "/media/denny/T7 Shield/Recordings/DMR/";
381381

382382
//Con+ Traffic + Voice
383383
// String file = path + "20200513_143340_9600BPS_DMR_SaiaNet_Onondaga_Control.bits"; //Enh GPS Revert Window Annce
384384
// String file = path + "20200514_062135_9600BPS_DMR_SaiaNet_Onondaga_LCN_3_Control.bits"; //Neighbor only
385385
// String file = path + "20200514_063507_9600BPS_DMR_SaiaNet_Onondaga_LCN_3_Control.bits"; //GPS Window Grant 2579
386386
// String file = path + "20200514_064224_9600BPS_DMR_SaiaNet_Onondaga_LCN_3_Control.bits"; //GPS Window Grant 5056035
387387
// String file = path + "20200514_131623_9600BPS_DMR_SaiaNet_Onondaga_LCN_3_Control.bits"; //GPS Grant: 5074193
388-
String file = path + "20200514_133947_9600BPS_DMR_SaiaNet_Onondaga_LCN_4.bits"; //<<<<<<<------ Basic Encryption
388+
// String file = path + "SaiaNet/20200514_133947_9600BPS_DMR_SaiaNet_Onondaga_LCN_4.bits"; //<<<<<<<------ Basic Encryption
389389
// String file = path + "20200514_142249_9600BPS_DMR_SaiaNet_Onondaga_LCN_4.bits";
390390
// String file = path + "20200514_144534_9600BPS_DMR_SaiaNet_Onondaga_LCN_3_Control.bits"; //Con+ Control w/GPS Window Announce
391391

@@ -395,12 +395,16 @@ public static void main(String[] args)
395395
//Cap-Max Tier III CC
396396
// String file = path + "20200710_053632_9600BPS_DMR_Niles_Radio_Coconino_Control.bits";
397397

398-
//Cap+ Multi-Site 1 - Traffic LCN 2
399-
// String file = path + "20200716_210133_9600BPS_DMR_Aerowave_Technologies_Dallas_LCN_2.bits";
400-
// String file = path + "20200716_212309_9600BPS_DMR_Aerowave_Technologies_Dallas_LCN_2.bits";
398+
//Cap+ Multi-Site 1 - Data Revert LSN1/2 with CSBKO 62 Site status
399+
// String file = path + "Texas_Dallas_Aerowave_Capacity_Plus_Multi_Site/20200716_210133_9600BPS_DMR_Aerowave_Technologies_Dallas_LCN_2.bits";
400+
// String file = path + "Texas_Dallas_Aerowave_Capacity_Plus_Multi_Site/20200716_210845_9600BPS_DMR_Aerowave_Technologies_Dallas_LCN_2.bits";
401+
// String file = path + "Texas_Dallas_Aerowave_Capacity_Plus_Multi_Site/20200716_212309_9600BPS_DMR_Aerowave_Technologies_Dallas_LCN_2.bits";
401402

402-
//Cap+ Multi-Site Enhanced GPS Channel
403-
// String file = path + "20200714_224018_9600BPS_DMR_Farmers_Electric_Cooperative_Hunt_LCN_3.bits"; //This may have PLL mis-align issues
403+
//Cap+ Multi-Site Enhanced Data Revert Channel (no CSBKO 62)
404+
// String file = path + "Texas_Hunt_Farmers_Electric_Capacity_Plus_Multi_Site/20200714_224018_9600BPS_DMR_Farmers_Electric_Cooperative_Hunt_LCN_3.bits"; //This may have PLL mis-align issues
405+
406+
//Cap+ Multi-Site - Dallas Unknown
407+
String file = path + "Texas_Dallas_Unknown_1_Capacity_Plus_Multi_Site/20200716_211233_9600BPS_DMR_Dallas_Unk_Dallas_Unk.bits";
404408

405409
//Hytera Short Data = Proprietary (encrypted)
406410
// String file = path + "20200716_222839_9600BPS_DMR_SystemUnk_SiteUnk_Unk.bits"; //Hytera short data packets

src/main/java/io/github/dsheirer/module/decode/dmr/DMRMessageProcessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ public void receive(IMessage message)
111111
}
112112
}
113113

114+
//Now that the message has been (potentially) enriched, dispatch it to the modules
115+
dispatch(message);
116+
114117
//Extract the Full Link Control message fragment from the Voice with embedded signalling message
115118
if(message instanceof VoiceEMBMessage)
116119
{
@@ -202,9 +205,6 @@ else if((message instanceof IDLEMessage || message instanceof Aloha || message i
202205
{
203206
dispatch(mTalkerAliasAssembler.process(flc));
204207
}
205-
206-
//Now that the message has been (potentially) enriched, dispatch it to the modules
207-
dispatch(message);
208208
}
209209

210210
/**

src/main/java/io/github/dsheirer/module/decode/dmr/channel/DMRLogicalChannel.java

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
/*
2+
* *****************************************************************************
3+
* Copyright (C) 2014-2023 Dennis Sheirer
24
*
3-
* * ******************************************************************************
4-
* * Copyright (C) 2014-2019 Dennis Sheirer
5-
* *
6-
* * This program is free software: you can redistribute it and/or modify
7-
* * it under the terms of the GNU General Public License as published by
8-
* * the Free Software Foundation, either version 3 of the License, or
9-
* * (at your option) any later version.
10-
* *
11-
* * This program is distributed in the hope that it will be useful,
12-
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
* * GNU General Public License for more details.
15-
* *
16-
* * You should have received a copy of the GNU General Public License
17-
* * along with this program. If not, see <http://www.gnu.org/licenses/>
18-
* * *****************************************************************************
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
199
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
2014
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>
17+
* ****************************************************************************
2118
*/
2219

2320
package io.github.dsheirer.module.decode.dmr.channel;
@@ -87,7 +84,7 @@ public String toString()
8784
{
8885
StringBuilder sb = new StringBuilder();
8986
sb.append("LSN:").append(getLogicalSlotNumber());
90-
sb.append(" LCN:").append(getValue());
87+
// sb.append(" LCN:").append(getValue());
9188
return sb.toString();
9289
}
9390
}

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/DataMessage.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2022 Dennis Sheirer
3+
* Copyright (C) 2014-2023 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -28,6 +28,9 @@
2828
*/
2929
public abstract class DataMessage extends DMRBurst
3030
{
31+
//R2, R1, R0 extracted from the BPTC extraction process. Note: message length remains at 96, even though these 3x bits
32+
//are set at the end of the message.
33+
private static final int[] BPTC_RESERVED_BITS = new int[]{96, 97, 98};
3134
private SlotType mSlotType;
3235

3336
/**
@@ -54,4 +57,24 @@ public SlotType getSlotType()
5457
{
5558
return mSlotType;
5659
}
60+
61+
/**
62+
* 3x reserved bits that are left-over from the BPTC encode/decode process that can be used to hold values like
63+
* Moto RAS indicator. The message length from the BPTC decoder is set to 96 and these 3x bits are appended to
64+
* the end as overage. However, to keep the message.toString() correct, we specify the length as 96.
65+
* @return reserved value.
66+
*/
67+
public int getBPTCReservedBits()
68+
{
69+
return getMessage().getInt(BPTC_RESERVED_BITS);
70+
}
71+
72+
/**
73+
* Indicates if the BPTC reserved bits value is anything other than 0.
74+
* @return true if non-zero.
75+
*/
76+
public boolean hasRAS()
77+
{
78+
return getBPTCReservedBits() != 0;
79+
}
5780
}

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/DataMessageWithLinkControl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2020 Dennis Sheirer
3+
* Copyright (C) 2014-2023 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -26,7 +26,6 @@
2626
import io.github.dsheirer.module.decode.dmr.message.data.lc.LCMessage;
2727
import io.github.dsheirer.module.decode.dmr.message.data.lc.LCMessageFactory;
2828
import io.github.dsheirer.module.decode.dmr.message.type.DataType;
29-
3029
import java.util.Collections;
3130
import java.util.List;
3231

@@ -71,6 +70,10 @@ public LCMessage getLCMessage()
7170
public String toString()
7271
{
7372
StringBuilder sb = new StringBuilder();
73+
if(hasRAS())
74+
{
75+
sb.append(" RAS:").append(getBPTCReservedBits());
76+
}
7477
sb.append(getSlotType());
7578
sb.append(" ").append(getLCMessage());
7679
return sb.toString();

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/IDLEMessage.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
2-
* ******************************************************************************
3-
* sdrtrunk
4-
* Copyright (C) 2014-2020 Zhenyu Mao
2+
* *****************************************************************************
3+
* Copyright (C) 2014-2023 Dennis Sheirer
54
*
65
* This program is free software: you can redistribute it and/or modify
76
* it under the terms of the GNU General Public License as published by
@@ -15,15 +14,14 @@
1514
*
1615
* You should have received a copy of the GNU General Public License
1716
* along with this program. If not, see <http://www.gnu.org/licenses/>
18-
* *****************************************************************************
17+
* ****************************************************************************
1918
*/
2019
package io.github.dsheirer.module.decode.dmr.message.data;
2120

2221
import io.github.dsheirer.bits.CorrectedBinaryMessage;
2322
import io.github.dsheirer.identifier.Identifier;
2423
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
2524
import io.github.dsheirer.module.decode.dmr.message.CACH;
26-
2725
import java.util.Collections;
2826
import java.util.List;
2927

@@ -50,6 +48,12 @@ public String toString()
5048
{
5149
StringBuilder sb = new StringBuilder();
5250
sb.append("CC:").append(getSlotType().getColorCode());
51+
52+
if(hasRAS())
53+
{
54+
sb.append(" RAS:").append(getBPTCReservedBits());
55+
}
56+
5357
sb.append(" IDLE");
5458
return sb.toString();
5559
}

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/UnknownDataMessage.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2020 Dennis Sheirer
3+
* Copyright (C) 2014-2023 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -23,7 +23,6 @@
2323
import io.github.dsheirer.identifier.Identifier;
2424
import io.github.dsheirer.module.decode.dmr.DMRSyncPattern;
2525
import io.github.dsheirer.module.decode.dmr.message.CACH;
26-
2726
import java.util.Collections;
2827
import java.util.List;
2928

@@ -61,6 +60,11 @@ public String toString()
6160
sb.append("TS").append(getTimeslot());
6261
}
6362

63+
if(hasRAS())
64+
{
65+
sb.append(" RAS:").append(getBPTCReservedBits());
66+
}
67+
6468
sb.append(" ").append(getSlotType());
6569
sb.append(" ").append(getMessage().toHexString());
6670

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/block/DataBlock.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ public String toString()
7575
{
7676
StringBuilder sb = new StringBuilder();
7777

78+
if(hasRAS())
79+
{
80+
sb.append(" RAS:").append(getBPTCReservedBits());
81+
}
82+
7883
sb.append(" ").append(getSlotType());
7984
sb.append(" ").append(getMessage().toHexString());
8085

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/CSBKMessageFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusDataRevertWindowGrant;
4040
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusNeighbors;
4141
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusPreamble;
42-
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusSystemStatus;
42+
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.CapacityPlusSiteStatus;
4343
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.ConnectPlusCSBKO_16;
4444
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.ConnectPlusDataChannelGrant;
4545
import io.github.dsheirer.module.decode.dmr.message.data.csbk.motorola.ConnectPlusDataRevertWindowAnnouncement;
@@ -268,8 +268,8 @@ public static CSBKMessage create(DMRSyncPattern pattern, CorrectedBinaryMessage
268268
case MOTOROLA_CAPPLUS_PREAMBLE:
269269
csbk = new CapacityPlusPreamble(pattern, message, cach, slotType, timestamp, timeslot);
270270
break;
271-
case MOTOROLA_CAPPLUS_SYSTEM_STATUS:
272-
csbk = new CapacityPlusSystemStatus(pattern, message, cach, slotType, timestamp, timeslot);
271+
case MOTOROLA_CAPPLUS_SITE_STATUS:
272+
csbk = new CapacityPlusSiteStatus(pattern, message, cach, slotType, timestamp, timeslot);
273273
break;
274274
case MOTOROLA_CAPPLUS_DATA_WINDOW_ANNOUNCEMENT:
275275
csbk = new CapacityPlusDataRevertWindowAnnouncement(pattern, message, cach, slotType, timestamp, timeslot);

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/Opcode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public enum Opcode
8787
MOTOROLA_CAPPLUS_NEIGHBOR_REPORT(Vendor.MOTOROLA_CAPACITY_PLUS, 59, "NEIGHBOR REPORT"),
8888
MOTOROLA_CAPPLUS_CSBKO_60(Vendor.MOTOROLA_CAPACITY_PLUS, 60, "CSBKO 60"),
8989
MOTOROLA_CAPPLUS_PREAMBLE(Vendor.MOTOROLA_CAPACITY_PLUS, 61, "PREAMBLE"),
90-
MOTOROLA_CAPPLUS_SYSTEM_STATUS(Vendor.MOTOROLA_CAPACITY_PLUS, 62, "SYSTEM STATUS"),
90+
MOTOROLA_CAPPLUS_SITE_STATUS(Vendor.MOTOROLA_CAPACITY_PLUS, 62, "SITE STATUS"),
9191

9292
HYTERA_08_ACKNOWLEDGE(Vendor.HYTERA_8, 32, "HYTERA 08 ACKNOWLEDGE"),
9393
HYTERA_08_ANNOUNCEMENT(Vendor.HYTERA_8, 40, "HYTERA 08 ANNOUNCEMENT"),

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/UnknownCSBKMessage.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2020 Dennis Sheirer
3+
* Copyright (C) 2014-2023 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
2525
import io.github.dsheirer.module.decode.dmr.message.CACH;
2626
import io.github.dsheirer.module.decode.dmr.message.data.SlotType;
2727
import io.github.dsheirer.module.decode.dmr.message.type.Vendor;
28-
2928
import java.util.Collections;
3029
import java.util.List;
3130

@@ -60,6 +59,10 @@ public String toString()
6059
}
6160

6261
sb.append("CC:").append(getSlotType().getColorCode());
62+
if(hasRAS())
63+
{
64+
sb.append(" RAS:").append(getBPTCReservedBits());
65+
}
6366
sb.append(" CSBK *UNKNOWN*");
6467

6568
Vendor vendor = getVendor();

src/main/java/io/github/dsheirer/module/decode/dmr/message/data/csbk/hytera/Hytera08Acknowledge.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ public String toString()
8383
}
8484

8585
sb.append("CC:").append(getSlotType().getColorCode());
86+
if(hasRAS())
87+
{
88+
sb.append(" RAS:").append(getBPTCReservedBits());
89+
}
8690
sb.append(" HYTERA 08 ").append(getAcknowledgeType());
8791
sb.append(" REASON:");
8892

0 commit comments

Comments
 (0)