From 26197e433c8bb28f54e1317500eef566eb99cefd Mon Sep 17 00:00:00 2001 From: Denny Sheirer Date: Sat, 11 Jan 2020 05:33:38 -0500 Subject: [PATCH] #576 P25 Activity Summary Hex and Decimal Network Values (#638) * #576 Updates P25 activity summaries to list values in hex and decimal. Resolves issue with P25 explicit channel uplink frequency calculations. Resolves issue with Motorola base station id messages and traffic channel messages. Resolves issue with RFSS link control message control channel frequency calculations. Resolves issue with error when using recording tuners. --- .../channel/P25ExplicitChannel.java | 5 +- .../decode/p25/phase1/P25P1DecoderState.java | 4 +- .../P25P1NetworkConfigurationMonitor.java | 2 +- .../LCRFSSStatusBroadcastExplicit.java | 10 ++-- .../p25/phase1/message/tsbk/Opcode.java | 8 +-- .../message/tsbk/TSBKMessageFactory.java | 2 +- .../motorola/osp/MotorolaTrafficChannel.java | 53 +++++++++++++++++++ .../manager/PassThroughSourceManager.java | 39 ++++++++------ .../tuner/recording/RecordingTuner.java | 5 +- .../recording/RecordingTunerController.java | 4 +- 10 files changed, 95 insertions(+), 37 deletions(-) create mode 100644 src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/motorola/osp/MotorolaTrafficChannel.java diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/identifier/channel/P25ExplicitChannel.java b/src/main/java/io/github/dsheirer/module/decode/p25/identifier/channel/P25ExplicitChannel.java index 1c28cb3b..ba733158 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/identifier/channel/P25ExplicitChannel.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/identifier/channel/P25ExplicitChannel.java @@ -1,7 +1,7 @@ /* * * * ****************************************************************************** - * * Copyright (C) 2014-2019 Dennis Sheirer + * * Copyright (C) 2014-2020 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 @@ -55,7 +55,8 @@ public class P25ExplicitChannel extends P25Channel implements Comparable mIdentifiers; diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/Opcode.java b/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/Opcode.java index 3bd6f21a..f3ecd0d6 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/Opcode.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/Opcode.java @@ -1,7 +1,7 @@ /* * * * ****************************************************************************** - * * Copyright (C) 2014-2019 Dennis Sheirer + * * Copyright (C) 2014-2020 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 @@ -171,10 +171,10 @@ public enum Opcode MOTOROLA_OSP_PATCH_GROUP_DELETE(1, "PATCH GROUP DELE", "MOTOROLA PATCH GROUP DELETE"), MOTOROLA_OSP_PATCH_GROUP_CHANNEL_GRANT(2, "PTCH GRP VCHN GR", "MOTOROLA PATCH GROUP CHANNEL GRANT"), MOTOROLA_OSP_PATCH_GROUP_CHANNEL_GRANT_UPDATE(3, "PTCH GRP VCH UPD", "MOTOROLA PATCH GROUP CHANNEL GRANT UPDATE"), - MOTOROLA_OSP_TRAFFIC_CHANNEL_ID(5, "CHANNEL CWID", "CHANNEL CWID"), + MOTOROLA_OSP_TRAFFIC_CHANNEL_ID(5, "TRAFFIC CHANNEL", "TRAFFIC CHANNEL"), MOTOROLA_OSP_DENY_RESPONSE(7, "DENY RESPONSE", "MOTOROLA DENY RESPONSE"), MOTOROLA_OSP_SYSTEM_LOADING(9, "SYSTEM LOADING", "SYSTEM LOADING"), - MOTOROLA_OSP_CONTROL_CHANNEL_ID(11, "CCH BASE STAT ID", "CONTROL CHANNEL BASE STATION ID"), + MOTOROLA_OSP_BASE_STATION_ID(11, "CCH BASE STAT ID", "CONTROL CHANNEL BASE STATION ID"), MOTOROLA_OSP_CONTROL_CHANNEL_PLANNED_SHUTDOWN(14, "CCH PLND SHUTDWN", "CONTROL CHANNEL PLANNED SHUTDOWN"), MOTOROLA_OSP_UNKNOWN(-1, "MOTOROLA OSP UNKNOWN OPCODE", "MOTOROLA OSP UNKNOWN OPCODE"), @@ -332,7 +332,7 @@ public enum Opcode case 0x09: return MOTOROLA_OSP_SYSTEM_LOADING; case 0x0B: - return MOTOROLA_OSP_CONTROL_CHANNEL_ID; + return MOTOROLA_OSP_BASE_STATION_ID; case 0x0E: return MOTOROLA_OSP_CONTROL_CHANNEL_PLANNED_SHUTDOWN; default: diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/TSBKMessageFactory.java b/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/TSBKMessageFactory.java index 75cb23af..9a9f7106 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/TSBKMessageFactory.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/TSBKMessageFactory.java @@ -305,7 +305,7 @@ public class TSBKMessageFactory case MOTOROLA_ISP_UNKNOWN: return new UnknownMotorolaISPMessage(dataUnitID, message, nac, timestamp); - case MOTOROLA_OSP_CONTROL_CHANNEL_ID: + case MOTOROLA_OSP_BASE_STATION_ID: return new MotorolaBaseStationId(dataUnitID, message, nac, timestamp); case MOTOROLA_OSP_CONTROL_CHANNEL_PLANNED_SHUTDOWN: return new PlannedChannelShutdown(dataUnitID, message, nac, timestamp); diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/motorola/osp/MotorolaTrafficChannel.java b/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/motorola/osp/MotorolaTrafficChannel.java new file mode 100644 index 00000000..6dfdb8d9 --- /dev/null +++ b/src/main/java/io/github/dsheirer/module/decode/p25/phase1/message/tsbk/motorola/osp/MotorolaTrafficChannel.java @@ -0,0 +1,53 @@ +/* + * + * * ****************************************************************************** + * * Copyright (C) 2014-2020 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 + * * the Free Software Foundation, either version 3 of the License, or + * * (at your option) any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program. If not, see + * * ***************************************************************************** + * + * + */ +package io.github.dsheirer.module.decode.p25.phase1.message.tsbk.motorola.osp; + +import io.github.dsheirer.bits.CorrectedBinaryMessage; +import io.github.dsheirer.identifier.Identifier; +import io.github.dsheirer.module.decode.p25.phase1.P25P1DataUnitID; +import io.github.dsheirer.module.decode.p25.phase1.message.tsbk.OSPMessage; + +import java.util.Collections; +import java.util.List; + +public class MotorolaTrafficChannel extends OSPMessage +{ + public MotorolaTrafficChannel(P25P1DataUnitID dataUnitID, CorrectedBinaryMessage message, int nac, long timestamp) + { + super(dataUnitID, message, nac, timestamp); + } + + public String toString() + { + StringBuilder sb = new StringBuilder(); + sb.append(getMessageStub()); + sb.append(" TRAFFIC CHANNEL "); + sb.append(getMessage().toHexString()); + return sb.toString(); + } + + @Override + public List getIdentifiers() + { + return Collections.EMPTY_LIST; + } +} diff --git a/src/main/java/io/github/dsheirer/source/tuner/manager/PassThroughSourceManager.java b/src/main/java/io/github/dsheirer/source/tuner/manager/PassThroughSourceManager.java index 549c956e..1b4ebe1b 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/manager/PassThroughSourceManager.java +++ b/src/main/java/io/github/dsheirer/source/tuner/manager/PassThroughSourceManager.java @@ -1,18 +1,24 @@ -/******************************************************************************* - * sdr-trunk - * Copyright (C) 2014-2019 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 the Free Software Foundation, either version 3 of the License, or (at your option) any - * later version. + * * ****************************************************************************** + * * Copyright (C) 2014-2020 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 + * * the Free Software Foundation, either version 3 of the License, or + * * (at your option) any later version. + * * + * * This program is distributed in the hope that it will be useful, + * * but WITHOUT ANY WARRANTY; without even the implied warranty of + * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * * GNU General Public License for more details. + * * + * * You should have received a copy of the GNU General Public License + * * along with this program. If not, see + * * ***************************************************************************** * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with this program. - * If not, see - * - ******************************************************************************/ + */ package io.github.dsheirer.source.tuner.manager; @@ -62,7 +68,6 @@ public class PassThroughSourceManager extends ChannelSourceManager PassThroughChannelSource channelSource = new PassThroughChannelSource(new SourceEventProxy(), mTunerController, tunerChannel); - mLog.debug("Returning a pass through channel"); mTunerChannels.add(tunerChannel); return channelSource; @@ -77,16 +82,18 @@ public class PassThroughSourceManager extends ChannelSourceManager if(event.hasSource() && event.getSource() instanceof PassThroughChannelSource) { mTunerController.addBufferListener((PassThroughChannelSource)event.getSource()); + broadcast(SourceEvent.channelCountChange(mTunerChannels.size())); } break; case REQUEST_STOP_SAMPLE_STREAM: if(event.hasSource() && event.getSource() instanceof PassThroughChannelSource) { - mTunerController.removeBufferListener((PassThroughChannelSource)event.getSource()); + PassThroughChannelSource source = (PassThroughChannelSource)event.getSource(); + mTunerController.removeBufferListener(source); + mTunerChannels.remove(source.getTunerChannel()); + broadcast(SourceEvent.channelCountChange(mTunerChannels.size())); } break; - default: - mLog.debug("Got source event: " + event); } } diff --git a/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTuner.java b/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTuner.java index ba7d5e6e..e521d701 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTuner.java +++ b/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTuner.java @@ -1,7 +1,7 @@ /* * * * ****************************************************************************** - * * Copyright (C) 2014-2019 Dennis Sheirer + * * Copyright (C) 2014-2020 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 @@ -27,7 +27,6 @@ import io.github.dsheirer.source.SourceEvent; import io.github.dsheirer.source.tuner.Tuner; import io.github.dsheirer.source.tuner.TunerClass; import io.github.dsheirer.source.tuner.TunerType; -import io.github.dsheirer.source.tuner.manager.ChannelSourceManager; import io.github.dsheirer.source.tuner.manager.HeterodyneChannelSourceManager; import io.github.dsheirer.source.tuner.manager.PassThroughSourceManager; import io.github.dsheirer.source.tuner.manager.PolyphaseChannelSourceManager; @@ -50,8 +49,6 @@ public class RecordingTuner extends Tuner mUserPreferences = userPreferences; - ChannelSourceManager channelSourceManager = null; - if(getTunerController().getCurrentSampleRate() < 100000.0d) { setChannelSourceManager(new PassThroughSourceManager(getTunerController())); diff --git a/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTunerController.java b/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTunerController.java index 94e689c2..89089e1b 100644 --- a/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTunerController.java +++ b/src/main/java/io/github/dsheirer/source/tuner/recording/RecordingTunerController.java @@ -1,7 +1,7 @@ /* * * * ****************************************************************************** - * * Copyright (C) 2014-2019 Dennis Sheirer + * * Copyright (C) 2014-2020 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 @@ -177,7 +177,7 @@ public class RecordingTunerController extends TunerController } catch(IOException ioe) { - mLog.debug("Error loading recording tuner baseband recording: " + rtc.getPath(), ioe); + mLog.debug("Error loading recording tuner baseband recording [" + rtc.getPath() + "] Error: " + ioe.getLocalizedMessage()); } } }