mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-21 05:05:38 -05:00
NXDN: Misc #299
Fix Perpetual Sync Bug unless Squelch Break; Add DCR MFID 30 F.C.R Data Preamble and Precoded Message PDU; Misc Payload Tweaks;
This commit is contained in:
@@ -542,7 +542,7 @@ void nxdn_deperm_sacch2(dsd_opts * opts, dsd_state * state, uint8_t bits[60])
|
|||||||
else if (crc != check)
|
else if (crc != check)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s", KRED);
|
fprintf (stderr, "%s", KRED);
|
||||||
fprintf (stderr, "(CRC ERR)");
|
fprintf (stderr, "SACCH (CRC ERR)");
|
||||||
fprintf (stderr, "%s", KNRM);
|
fprintf (stderr, "%s", KNRM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,33 +745,58 @@ void nxdn_deperm_pich_tch(dsd_opts * opts, dsd_state * state, uint8_t bits[144])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//need more data points, but thinking this is probably similar to facch3
|
//STD-T98 DCR suggests TCH1 has data, and TCH2 will be zero fill
|
||||||
//or udch2 where we need to put two tch (facch1) messages together
|
//could vary by PDU, but limited data points suggests the same
|
||||||
// if (crc == check)
|
if (crc == check)
|
||||||
// {
|
{
|
||||||
// uint8_t opcode = (uint8_t)ConvertBitIntoBytes(&trellis_buf[0], 8);
|
uint8_t opcode = (uint8_t)ConvertBitIntoBytes(&trellis_buf[0], 8);
|
||||||
// uint8_t gi = trellis_buf[16];
|
uint8_t gi = trellis_buf[16];
|
||||||
// uint16_t source = (uint16_t)ConvertBitIntoBytes(&trellis_buf[24], 16);
|
uint16_t source = (uint16_t)ConvertBitIntoBytes(&trellis_buf[24], 16);
|
||||||
// uint16_t target = (uint16_t)ConvertBitIntoBytes(&trellis_buf[40], 16);
|
uint16_t target = (uint16_t)ConvertBitIntoBytes(&trellis_buf[40], 16);
|
||||||
|
|
||||||
// if (opcode != 0)
|
//may only be relevant on MFID 0x30 "F.R.C." Radios
|
||||||
// {
|
if (opcode == 0x0F)
|
||||||
// fprintf (stderr, "\n ");
|
{
|
||||||
// fprintf (stderr, "OP: %02X; ", opcode);
|
fprintf (stderr, "\n ");
|
||||||
// fprintf (stderr, "Source: %d; Target: %d; ", source, target);
|
fprintf (stderr, "Source: %d; Target: %d; ", source, target);
|
||||||
// if (gi)
|
if (gi)
|
||||||
// fprintf (stderr, "Private; ");
|
fprintf (stderr, "Private; ");
|
||||||
// else fprintf (stderr, "Group; ");
|
else fprintf (stderr, "Group; ");
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
fprintf (stderr, "Data Preamble; ");
|
||||||
// else
|
uint8_t countdown = (uint8_t)ConvertBitIntoBytes(&trellis_buf[64], 8);
|
||||||
// {
|
fprintf (stderr, "Countdown: %d; ", countdown);
|
||||||
// fprintf (stderr, "\n ");
|
|
||||||
// fprintf (stderr, "%s", KRED);
|
}
|
||||||
// fprintf (stderr, " (CRC ERR)");
|
|
||||||
// fprintf (stderr, "%s", KNRM);
|
//may only be relevant on MFID 0x30 "F.R.C." Radios
|
||||||
// }
|
if (opcode == 0x32)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "\n ");
|
||||||
|
fprintf (stderr, "Source: %d; Target: %d; ", source, target);
|
||||||
|
if (gi)
|
||||||
|
fprintf (stderr, "Private; ");
|
||||||
|
else fprintf (stderr, "Group; ");
|
||||||
|
|
||||||
|
fprintf (stderr, "Precoded Message; ");
|
||||||
|
uint8_t idx = (uint8_t)ConvertBitIntoBytes(&trellis_buf[64], 8);
|
||||||
|
fprintf (stderr, "Index#: %d;", idx);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (opcode == 0x00)
|
||||||
|
// {
|
||||||
|
// fprintf (stderr, "\n NULL TCH; ");
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (opts->payload == 0)
|
||||||
|
{
|
||||||
|
fprintf (stderr, "\n ");
|
||||||
|
fprintf (stderr, "%s", KRED);
|
||||||
|
fprintf (stderr, "TCH (CRC ERR)");
|
||||||
|
fprintf (stderr, "%s", KNRM);
|
||||||
|
}
|
||||||
|
|
||||||
if (opts->payload == 1)
|
if (opts->payload == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ void nxdn_frame (dsd_opts * opts, dsd_state * state)
|
|||||||
if (opts->payload == 1)
|
if (opts->payload == 1)
|
||||||
fprintf(stderr, " Lich Off Bit Fill Error: %d / 8; \n", lich_off_hex);
|
fprintf(stderr, " Lich Off Bit Fill Error: %d / 8; \n", lich_off_hex);
|
||||||
#endif
|
#endif
|
||||||
// state->lastsynctype = -1; //set to -1 so we don't jump back here too quickly
|
state->lastsynctype = -1; //set to -1 so we don't jump back here too quickly
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -137,7 +137,7 @@ void nxdn_frame (dsd_opts * opts, dsd_state * state)
|
|||||||
if (opts->payload == 1)
|
if (opts->payload == 1)
|
||||||
fprintf(stderr, " Lich Parity Error %02X / %04X\n", lich_full, lich_bits_hex);
|
fprintf(stderr, " Lich Parity Error %02X / %04X\n", lich_full, lich_bits_hex);
|
||||||
#endif
|
#endif
|
||||||
// state->lastsynctype = -1;
|
state->lastsynctype = -1;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ void nxdn_frame (dsd_opts * opts, dsd_state * state)
|
|||||||
if (opts->payload == 1)
|
if (opts->payload == 1)
|
||||||
fprintf(stderr, " Simplex/Inbound NXDN lich on trunking system - type 0x%02X\n", lich);
|
fprintf(stderr, " Simplex/Inbound NXDN lich on trunking system - type 0x%02X\n", lich);
|
||||||
#endif
|
#endif
|
||||||
// state->lastsynctype = -1; //set to -1 so we don't jump back here too quickly
|
state->lastsynctype = -1; //set to -1 so we don't jump back here too quickly
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ void nxdn_frame (dsd_opts * opts, dsd_state * state)
|
|||||||
//reset the sacch field, we probably got a false sync and need to wipe or give a bad crc
|
//reset the sacch field, we probably got a false sync and need to wipe or give a bad crc
|
||||||
memset (state->nxdn_sacch_frame_segment, 1, sizeof(state->nxdn_sacch_frame_segment));
|
memset (state->nxdn_sacch_frame_segment, 1, sizeof(state->nxdn_sacch_frame_segment));
|
||||||
memset (state->nxdn_sacch_frame_segcrc, 1, sizeof(state->nxdn_sacch_frame_segcrc));
|
memset (state->nxdn_sacch_frame_segcrc, 1, sizeof(state->nxdn_sacch_frame_segcrc));
|
||||||
// state->lastsynctype = -1; //set to -1 so we don't jump back here too quickly
|
state->lastsynctype = -1; //set to -1 so we don't jump back here too quickly
|
||||||
voice = 0;
|
voice = 0;
|
||||||
goto END;
|
goto END;
|
||||||
break;
|
break;
|
||||||
@@ -623,5 +623,12 @@ void nxdn_frame (dsd_opts * opts, dsd_state * state)
|
|||||||
if (opts->payload == 1 && !voice) fprintf (stderr, "\n");
|
if (opts->payload == 1 && !voice) fprintf (stderr, "\n");
|
||||||
else if (opts->payload == 0) fprintf (stderr, "\n");
|
else if (opts->payload == 0) fprintf (stderr, "\n");
|
||||||
|
|
||||||
END: ; //do nothing
|
END:
|
||||||
|
|
||||||
|
//if rejected sync, reset carrier and synctype as well
|
||||||
|
if (state->lastsynctype == -1)
|
||||||
|
{
|
||||||
|
state->carrier = 0;
|
||||||
|
state->synctype = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user