mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-12 16:57:23 -05:00
DMR: Set CC on MS Voice; QR Correction Limit;
This commit is contained in:
@@ -203,7 +203,7 @@ void dmrMS (dsd_opts * opts, dsd_state * state)
|
||||
if(QR_16_7_6_decode(EmbeddedSignalling))
|
||||
{
|
||||
EmbeddedSignallingOk = 1;
|
||||
cc = ((EmbeddedSignalling[0] << 3) + (EmbeddedSignalling[1] << 2) + (EmbeddedSignalling[2] << 1) + EmbeddedSignalling[3]);
|
||||
state->dmr_color_code = cc = ((EmbeddedSignalling[0] << 3) + (EmbeddedSignalling[1] << 2) + (EmbeddedSignalling[2] << 1) + EmbeddedSignalling[3]);
|
||||
power = EmbeddedSignalling[4];
|
||||
lcss = ((EmbeddedSignalling[5] << 1) + EmbeddedSignalling[6]);
|
||||
|
||||
|
||||
@@ -1475,10 +1475,11 @@ void QR_16_7_6_encode(unsigned char *origBits, unsigned char *encodedBits)
|
||||
|
||||
bool QR_16_7_6_decode(unsigned char *rxBits)
|
||||
{
|
||||
//2 bit errors or less
|
||||
unsigned int syndromeI = 0; // syndrome index
|
||||
int is = 0;
|
||||
int i = 0;
|
||||
|
||||
int corrections = 0;
|
||||
for (is = 0; is < 9; is++)
|
||||
{
|
||||
syndromeI += (((rxBits[0] * QR_16_7_6_m_H[16*is + 0])
|
||||
@@ -1512,6 +1513,7 @@ bool QR_16_7_6_decode(unsigned char *rxBits)
|
||||
else
|
||||
{
|
||||
rxBits[QR_16_7_6_m_corr[syndromeI][i]] ^= 1; // flip bit
|
||||
corrections++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1519,6 +1521,10 @@ bool QR_16_7_6_decode(unsigned char *rxBits)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (corrections > 1) //no more than 1-bit error, else consider failure
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user