Skip to content

Commit

Permalink
Amalgamate the two Trellis implementations and small cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Oct 2, 2024
1 parent bc43db1 commit ec9f7d7
Show file tree
Hide file tree
Showing 20 changed files with 134 additions and 538 deletions.
16 changes: 8 additions & 8 deletions DMRSlot.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2021,2023 Jonathan Naylor, G4KLX
* Copyright (C) 2015-2021,2023,2024 Jonathan Naylor, G4KLX
*
* 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 All @@ -15,10 +15,10 @@
#include "DMRDataHeader.h"
#include "DMRSlotType.h"
#include "DMRShortLC.h"
#include "DMRTrellis.h"
#include "DMRFullLC.h"
#include "BPTC19696.h"
#include "DMRSlot.h"
#include "Trellis.h"
#include "DMRCSBK.h"
#include "DMREMB.h"
#include "Utils.h"
Expand Down Expand Up @@ -541,13 +541,13 @@ bool CDMRSlot::writeModem(unsigned char *data, unsigned int len)
CUtils::dump(1U, title, payload, 12U);
bptc.encode(payload, data + 2U);
} else if (dataType == DT_RATE_34_DATA) {
CDMRTrellis trellis;
CTrellis trellis;
unsigned char payload[18U];
bool ret = trellis.decode(data + 2U, payload);
bool ret = trellis.decode34(data + 2U, payload);
if (ret) {
::sprintf(title, "DMR Slot %u, Data 3/4", m_slotNo);
CUtils::dump(1U, title, payload, 18U);
trellis.encode(payload, data + 2U);
trellis.encode34(payload, data + 2U);
} else {
LogMessage("DMR Slot %u, unfixable RF rate 3/4 data", m_slotNo);
CUtils::dump(1U, "Data", data + 2U, DMR_FRAME_LENGTH_BYTES);
Expand Down Expand Up @@ -1734,13 +1734,13 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
CUtils::dump(1U, title, payload, 12U);
bptc.encode(payload, data + 2U);
} else if (dataType == DT_RATE_34_DATA) {
CDMRTrellis trellis;
CTrellis trellis;
unsigned char payload[18U];
bool ret = trellis.decode(data + 2U, payload);
bool ret = trellis.decode34(data + 2U, payload);
if (ret) {
::sprintf(title, "DMR Slot %u, Data 3/4", m_slotNo);
CUtils::dump(1U, title, payload, 18U);
trellis.encode(payload, data + 2U);
trellis.encode34(payload, data + 2U);
} else {
LogMessage("DMR Slot %u, unfixable network rate 3/4 data", m_slotNo);
CUtils::dump(1U, "Data", data + 2U, DMR_FRAME_LENGTH_BYTES);
Expand Down
Loading

0 comments on commit ec9f7d7

Please sign in to comment.