Skip to content

Commit

Permalink
Update the P25 Reed-Solomon FEC to be the same as the DVMM project.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Sep 30, 2024
1 parent b1ac8cc commit bc43db1
Show file tree
Hide file tree
Showing 14 changed files with 1,249 additions and 312 deletions.
5 changes: 3 additions & 2 deletions MMDVMHost.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@
<ClInclude Include="QR1676.h" />
<ClInclude Include="RemoteControl.h" />
<ClInclude Include="RingBuffer.h" />
<ClInclude Include="RS.h" />
<ClInclude Include="RS129.h" />
<ClInclude Include="RS241213.h" />
<ClInclude Include="RS634717.h" />
<ClInclude Include="RSSIInterpolator.h" />
<ClInclude Include="NXDNSACCH.h" />
<ClInclude Include="UARTController.h" />
Expand Down Expand Up @@ -359,7 +360,7 @@
<ClCompile Include="QR1676.cpp" />
<ClCompile Include="RemoteControl.cpp" />
<ClCompile Include="RS129.cpp" />
<ClCompile Include="RS241213.cpp" />
<ClCompile Include="RS634717.cpp" />
<ClCompile Include="RSSIInterpolator.cpp" />
<ClCompile Include="UARTController.cpp" />
<ClCompile Include="Modem.cpp" />
Expand Down
15 changes: 9 additions & 6 deletions MMDVMHost.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,6 @@
<ClInclude Include="BCH.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RS241213.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="SerialPort.h">
<Filter>Header Files</Filter>
</ClInclude>
Expand Down Expand Up @@ -350,6 +347,12 @@
<ClInclude Include="SMeter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RS634717.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RS.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="BPTC19696.cpp">
Expand Down Expand Up @@ -511,9 +514,6 @@
<ClCompile Include="BCH.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RS241213.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SerialPort.cpp">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -658,5 +658,8 @@
<ClCompile Include="SMeter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RS634717.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OBJECTS = \
Modem.o ModemPort.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullController.o NullDisplay.o NXDNAudio.o NXDNControl.o \
NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o \
NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o \
POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \
POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS634717.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \
Timer.o UARTController.o UDPController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o

all: MMDVMHost RemoteCommand
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Pi.Adafruit
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OBJECTS = \
MMDVMHost.o Modem.o ModemPort.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullController.o NullDisplay.o NXDNAudio.o \
NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o \
NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS634717.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
TFTSurenoo.o Thread.o Timer.o UARTController.o UDPController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o \
YSFNetwork.o YSFPayload.o

Expand Down
2 changes: 1 addition & 1 deletion Makefile.Pi.HD44780
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OBJECTS = \
MMDVMHost.o Modem.o ModemPort.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullController.o NullDisplay.o NXDNAudio.o \
NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o \
NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS634717.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
TFTSurenoo.o Thread.o Timer.o UARTController.o UDPController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o \
YSFNetwork.o YSFPayload.o

Expand Down
2 changes: 1 addition & 1 deletion Makefile.Pi.I2C
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OBJECTS = \
Modem.o ModemPort.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullController.o NullDisplay.o NXDNAudio.o NXDNControl.o \
NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o \
NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o POCSAGControl.o \
POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \
POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS634717.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o TFTSurenoo.o Thread.o \
Timer.o UARTController.o UDPController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o

all: MMDVMHost RemoteCommand
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Pi.OLED
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OBJECTS = \
Modem.o ModemPort.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullController.o NullDisplay.o NXDNAudio.o NXDNControl.o \
NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o \
NXDNUDCH.o OLED.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS634717.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
TFTSurenoo.o Thread.o Timer.o UARTController.o UDPController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o \
YSFNetwork.o YSFPayload.o

Expand Down
2 changes: 1 addition & 1 deletion Makefile.Pi.PCF8574
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ OBJECTS = \
MMDVMHost.o Modem.o ModemPort.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o NullController.o NullDisplay.o NXDNAudio.o \
NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o \
NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o P25Utils.o PseudoTTYController.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS634717.o RSSIInterpolator.o SerialPort.o SMeter.o StopWatch.o Sync.o SHA256.o \
TFTSurenoo.o Thread.o Timer.o UARTController.o UDPController.o UDPSocket.o UserDB.o UserDBentry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o \
YSFNetwork.o YSFPayload.o

Expand Down
16 changes: 8 additions & 8 deletions P25Data.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017,2023 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2023,2024 by Jonathan Naylor G4KLX
* Copyright (C) 2018 by Bryan Biedenkapp <[email protected]> N2PLL
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -44,7 +44,7 @@ m_lcf(0x00U),
m_emergency(false),
m_srcId(0U),
m_dstId(0U),
m_rs241213(),
m_rs(),
m_trellis()
{
m_mi = new unsigned char[P25_MI_LENGTH_BYTES];
Expand Down Expand Up @@ -89,7 +89,7 @@ bool CP25Data::decodeHeader(const unsigned char* data)

// decode RS (36,20,17) FEC
try {
bool ret = m_rs241213.decode362017(rs);
bool ret = m_rs.decode362017(rs);
if (!ret)
return false;
} catch (...) {
Expand Down Expand Up @@ -133,7 +133,7 @@ void CP25Data::encodeHeader(unsigned char* data)
rs[14U] = (m_dstId >> 0) & 0xFFU; // Talkgroup Address LSB

// encode RS (36,20,17) FEC
m_rs241213.encode362017(rs);
m_rs.encode362017(rs);

unsigned char raw[81U];
::memset(raw, 0x00U, 81U);
Expand Down Expand Up @@ -171,7 +171,7 @@ bool CP25Data::decodeLDU1(const unsigned char* data)
decodeLDUHamming(raw, rs + 15U);

try {
bool ret = m_rs241213.decode(rs);
bool ret = m_rs.decode241213(rs);
if (!ret)
return false;
} catch (...) {
Expand Down Expand Up @@ -234,7 +234,7 @@ void CP25Data::encodeLDU1(unsigned char* data)
break;
}

m_rs241213.encode(rs);
m_rs.encode241213(rs);

unsigned char raw[5U];
encodeLDUHamming(raw, rs + 0U);
Expand Down Expand Up @@ -284,7 +284,7 @@ bool CP25Data::decodeLDU2(const unsigned char* data)

// decode RS (24,16,9) FEC
try {
bool ret = m_rs241213.decode24169(rs);
bool ret = m_rs.decode24169(rs);
if (!ret)
return false;
} catch (...) {
Expand Down Expand Up @@ -324,7 +324,7 @@ void CP25Data::encodeLDU2(unsigned char* data)
rs[11U] = (m_kId >> 0) & 0xFFU; // Key ID LSB

// encode RS (24,16,9) FEC
m_rs241213.encode24169(rs);
m_rs.encode24169(rs);

// encode Hamming (10,6,3) FEC and interleave for LC data
unsigned char raw[5U];
Expand Down
6 changes: 3 additions & 3 deletions P25Data.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2024 by Jonathan Naylor G4KLX
* Copyright (C) 2018 by Bryan Biedenkapp <[email protected]> N2PLL
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -20,7 +20,7 @@
#if !defined(P25Data_H)
#define P25Data_H

#include "RS241213.h"
#include "RS634717.h"
#include "P25Trellis.h"

class CP25Data {
Expand Down Expand Up @@ -81,7 +81,7 @@ class CP25Data {
unsigned int m_srcId;
unsigned int m_dstId;
unsigned char m_serviceType;
CRS241213 m_rs241213;
CRS634717 m_rs;
CP25Trellis m_trellis;

void decodeLDUHamming(const unsigned char* raw, unsigned char* data);
Expand Down
Loading

0 comments on commit bc43db1

Please sign in to comment.