Skip to content

Commit 971c9b9

Browse files
committed
Remove unused code and fix a small bug in UDCH processing.
1 parent 1346462 commit 971c9b9

File tree

5 files changed

+2
-45
lines changed

5 files changed

+2
-45
lines changed

NXDNCRC.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool CNXDNCRC::checkCRC15(const unsigned char* in, unsigned int length)
104104
temp1[0U] = (crc >> 8) & 0xFFU;
105105
temp1[1U] = (crc >> 0) & 0xFFU;
106106

107-
uint16_t temp2[2U];
107+
uint8_t temp2[2U];
108108
temp2[0U] = 0x00U;
109109
temp2[1U] = 0x00U;
110110
unsigned int j = length;

NXDNFACCH1.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "NXDNConvolution.h"
2222
#include "NXDNDefines.h"
2323
#include "NXDNCRC.h"
24-
#include "Utils.h"
2524

2625
#include <cstdio>
2726
#include <cassert>
@@ -71,8 +70,6 @@ bool CNXDNFACCH1::decode(const unsigned char* data, unsigned int offset)
7170
{
7271
assert(data != NULL);
7372

74-
// CUtils::dump("NXDN, FACCH1 input", data, 18U);
75-
7673
unsigned char temp1[18U];
7774

7875
for (unsigned int i = 0U; i < NXDN_FACCH1_LENGTH_BITS; i++) {
@@ -81,8 +78,6 @@ bool CNXDNFACCH1::decode(const unsigned char* data, unsigned int offset)
8178
WRITE_BIT1(temp1, i, b);
8279
}
8380

84-
// CUtils::dump("NXDN, FACCH1 de-interleaved", temp1, 18U);
85-
8681
uint8_t temp2[210U];
8782

8883
unsigned int n = 0U;
@@ -114,8 +109,6 @@ bool CNXDNFACCH1::decode(const unsigned char* data, unsigned int offset)
114109

115110
conv.chainback(m_data, 96U);
116111

117-
// CUtils::dump("NXDN, FACCH1 decoded", m_data, 12U);
118-
119112
return CNXDNCRC::checkCRC12(m_data, 80U);
120113
}
121114

@@ -129,15 +122,11 @@ void CNXDNFACCH1::encode(unsigned char* data, unsigned int offset) const
129122

130123
CNXDNCRC::encodeCRC12(temp1, 80U);
131124

132-
// CUtils::dump("NXDN, FACCH1 encoded with CRC", temp1, 12U);
133-
134125
unsigned char temp2[24U];
135126

136127
CNXDNConvolution conv;
137128
conv.encode(temp1, temp2, 96U);
138129

139-
// CUtils::dump("NXDN, FACCH1 convolved", temp2, 24U);
140-
141130
unsigned char temp3[18U];
142131

143132
unsigned int n = 0U;
@@ -152,8 +141,6 @@ void CNXDNFACCH1::encode(unsigned char* data, unsigned int offset) const
152141
}
153142
}
154143

155-
// CUtils::dump("NXDN, FACCH1 punctured", temp3, 18U);
156-
157144
for (unsigned int i = 0U; i < NXDN_FACCH1_LENGTH_BITS; i++) {
158145
unsigned int n = INTERLEAVE_TABLE[i] + offset;
159146
bool b = READ_BIT1(temp3, i);

NXDNLICH.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include "NXDNDefines.h"
2020
#include "NXDNLICH.h"
21-
#include "Log.h"
2221

2322
#include <cstdio>
2423
#include <cassert>
@@ -61,8 +60,6 @@ bool CNXDNLICH::decode(const unsigned char* bytes)
6160

6261
bool parity = b[7U] ^ b[6U] ^ b[5U] ^ b[4U];
6362

64-
// LogMessage("NXDN, LICH bits: %d%d %d%d %d%d %d - %d, parity: %d", b[7U] ? 1 : 0, b[6U] ? 1 : 0, b[5U] ? 1 : 0, b[4U] ? 1 : 0, b[3U] ? 1 : 0, b[2U] ? 1 : 0, b[1U] ? 1 : 0, b[0U] ? 1 : 0, parity ? 1 : 0);
65-
6663
if (parity != b[0U])
6764
return false;
6865

NXDNSACCH.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "NXDNConvolution.h"
2222
#include "NXDNDefines.h"
2323
#include "NXDNCRC.h"
24-
#include "Utils.h"
2524

2625
#include <cstdio>
2726
#include <cassert>
@@ -64,8 +63,6 @@ bool CNXDNSACCH::decode(const unsigned char* data)
6463
{
6564
assert(data != NULL);
6665

67-
// CUtils::dump("NXDN, SACCH input", data, 12U);
68-
6966
unsigned char temp1[8U];
7067

7168
for (unsigned int i = 0U; i < NXDN_SACCH_LENGTH_BITS; i++) {
@@ -74,8 +71,6 @@ bool CNXDNSACCH::decode(const unsigned char* data)
7471
WRITE_BIT1(temp1, i, b);
7572
}
7673

77-
// CUtils::dump("NXDN, SACCH de-interleaved", temp1, 8U);
78-
7974
uint8_t temp2[90U];
8075

8176
unsigned int n = 0U;
@@ -107,8 +102,6 @@ bool CNXDNSACCH::decode(const unsigned char* data)
107102

108103
conv.chainback(m_data, 36U);
109104

110-
// CUtils::dump("NXDN, SACCH decoded", m_data, 4U);
111-
112105
return CNXDNCRC::checkCRC6(m_data, 26U);
113106
}
114107

@@ -126,15 +119,11 @@ void CNXDNSACCH::encode(unsigned char* data) const
126119

127120
CNXDNCRC::encodeCRC6(temp1, 26U);
128121

129-
// CUtils::dump("NXDN, SACCH encoded with CRC", temp1, 4U);
130-
131122
unsigned char temp2[9U];
132123

133124
CNXDNConvolution conv;
134125
conv.encode(temp1, temp2, 36U);
135126

136-
// CUtils::dump("NXDN, SACCH convolved", temp2, 9U);
137-
138127
unsigned char temp3[8U];
139128

140129
unsigned int n = 0U;
@@ -149,8 +138,6 @@ void CNXDNSACCH::encode(unsigned char* data) const
149138
}
150139
}
151140

152-
// CUtils::dump("NXDN, SACCH punctured", temp3, 8U);
153-
154141
for (unsigned int i = 0U; i < NXDN_SACCH_LENGTH_BITS; i++) {
155142
unsigned int n = INTERLEAVE_TABLE[i] + NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS;
156143
bool b = READ_BIT1(temp3, i);

NXDNUDCH.cpp

+1-15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "NXDNConvolution.h"
2222
#include "NXDNDefines.h"
2323
#include "NXDNCRC.h"
24-
#include "Utils.h"
2524

2625
#include <cstdio>
2726
#include <cassert>
@@ -92,8 +91,6 @@ bool CNXDNUDCH::decode(const unsigned char* data)
9291
{
9392
assert(data != NULL);
9493

95-
// CUtils::dump("NXDN, UDCH/FACCH2 input", data, 44U);
96-
9794
unsigned char temp1[44U];
9895

9996
for (unsigned int i = 0U; i < NXDN_FACCH2_LENGTH_BITS; i++) {
@@ -102,8 +99,6 @@ bool CNXDNUDCH::decode(const unsigned char* data)
10299
WRITE_BIT1(temp1, i, b);
103100
}
104101

105-
// CUtils::dump("NXDN, UDCH/FACCH2 de-interleaved", temp1, 44U);
106-
107102
uint8_t temp2[420U];
108103

109104
unsigned int n = 0U;
@@ -135,8 +130,6 @@ bool CNXDNUDCH::decode(const unsigned char* data)
135130

136131
conv.chainback(m_data, 203U);
137132

138-
// CUtils::dump("NXDN, UDCH/FACCH2 decoded", m_data, 25U);
139-
140133
return CNXDNCRC::checkCRC15(m_data, 184U);
141134
}
142135

@@ -150,15 +143,11 @@ void CNXDNUDCH::encode(unsigned char* data) const
150143

151144
CNXDNCRC::encodeCRC15(temp1, 184U);
152145

153-
// CUtils::dump("NXDN, UDCH/FACCH2 encoded with CRC", temp1, 25U);
154-
155146
unsigned char temp2[51U];
156147

157148
CNXDNConvolution conv;
158149
conv.encode(temp1, temp2, 203U);
159150

160-
// CUtils::dump("NXDN, UDCH/FACCH2 convolved", temp2, 51U);
161-
162151
unsigned char temp3[44U];
163152

164153
unsigned int n = 0U;
@@ -173,8 +162,6 @@ void CNXDNUDCH::encode(unsigned char* data) const
173162
}
174163
}
175164

176-
// CUtils::dump("NXDN, UDCH/FACCH2 punctured", temp3, 44U);
177-
178165
for (unsigned int i = 0U; i < NXDN_FACCH2_LENGTH_BITS; i++) {
179166
unsigned int n = INTERLEAVE_TABLE[i] + NXDN_FSW_LENGTH_BITS + NXDN_LICH_LENGTH_BITS;
180167
bool b = READ_BIT1(temp3, i);
@@ -196,8 +183,7 @@ void CNXDNUDCH::getData(unsigned char* data) const
196183

197184
void CNXDNUDCH::setRAN(unsigned char ran)
198185
{
199-
m_data[0U] &= 0xC0U;
200-
m_data[0U] |= ran;
186+
m_data[0U] = ran;
201187
}
202188

203189
void CNXDNUDCH::setData(const unsigned char* data)

0 commit comments

Comments
 (0)