mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 12:45:40 -05:00
DMR increase BF and block storage; R1 Pad Bit Fix;
This commit is contained in:
@@ -599,7 +599,7 @@ typedef struct
|
|||||||
|
|
||||||
//new stuff below here
|
//new stuff below here
|
||||||
uint8_t data_conf_data[2]; //flag for confirmed data blocks per slot
|
uint8_t data_conf_data[2]; //flag for confirmed data blocks per slot
|
||||||
uint8_t dmr_pdu_sf[2][288]; //unified pdu 'superframe' //[slot][byte]
|
uint8_t dmr_pdu_sf[2][24*128]; //unified pdu 'superframe' //[slot][byte] -- increased capacity to 127(+1) full rate blocks
|
||||||
uint8_t cap_plus_csbk_bits[2][12*8*8]; //CSBK Cap+ FL initial and appended block bit storage, by slot
|
uint8_t cap_plus_csbk_bits[2][12*8*8]; //CSBK Cap+ FL initial and appended block bit storage, by slot
|
||||||
uint8_t cap_plus_block_num[2]; //received block number storage -- per timeslot
|
uint8_t cap_plus_block_num[2]; //received block number storage -- per timeslot
|
||||||
uint8_t data_block_crc_valid[2][25]; //flag each individual block as good crc on confirmed data
|
uint8_t data_block_crc_valid[2][25]; //flag each individual block as good crc on confirmed data
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint8_t
|
|||||||
uint8_t slot = state->currentslot;
|
uint8_t slot = state->currentslot;
|
||||||
|
|
||||||
//clear out unified pdu 'superframe' slot
|
//clear out unified pdu 'superframe' slot
|
||||||
for (short int i = 0; i < 288; i++) state->dmr_pdu_sf[slot][i] = 0;
|
for (int i = 0; i < 24*127; i++) state->dmr_pdu_sf[slot][i] = 0;
|
||||||
|
|
||||||
//reset block counter to 1
|
//reset block counter to 1
|
||||||
state->data_block_counter[slot] = 1;
|
state->data_block_counter[slot] = 1;
|
||||||
@@ -320,7 +320,7 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint8_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
//block storage sanity
|
//block storage sanity
|
||||||
if (state->data_header_blocks[slot] > 9) state->data_header_blocks[slot] = 9;
|
if (state->data_header_blocks[slot] > 127) state->data_header_blocks[slot] = 127;
|
||||||
//assuming we didn't receive the initial data header block on a p_head and then decremented it
|
//assuming we didn't receive the initial data header block on a p_head and then decremented it
|
||||||
//3 or 4 seems to be the average safe value
|
//3 or 4 seems to be the average safe value
|
||||||
if (state->data_header_blocks[slot] < 1) state->data_header_blocks[slot] = 4;
|
if (state->data_header_blocks[slot] < 1) state->data_header_blocks[slot] = 4;
|
||||||
@@ -442,7 +442,7 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte
|
|||||||
|
|
||||||
//sanity check, setting block_len and block values to sane numbers in case of missing header, else could overload array (crash) or print out
|
//sanity check, setting block_len and block values to sane numbers in case of missing header, else could overload array (crash) or print out
|
||||||
if (blocks < 1) blocks = 1; //changed blocks from uint8_t to int
|
if (blocks < 1) blocks = 1; //changed blocks from uint8_t to int
|
||||||
if (blocks > 9) blocks = 9;
|
if (blocks > 127) blocks = 127;
|
||||||
if (block_len == 0) block_len = 18;
|
if (block_len == 0) block_len = 18;
|
||||||
if (block_len > 24) block_len = 24;
|
if (block_len > 24) block_len = 24;
|
||||||
|
|
||||||
@@ -549,11 +549,8 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte
|
|||||||
fprintf (stderr, "\n Slot %d - Multi Block PDU Message\n ", slot+1);
|
fprintf (stderr, "\n Slot %d - Multi Block PDU Message\n ", slot+1);
|
||||||
for (i = 0; i < ((blocks+1)*block_len); i++)
|
for (i = 0; i < ((blocks+1)*block_len); i++)
|
||||||
{
|
{
|
||||||
|
if ( (i != 0) && (i % 12 == 0) ) fprintf (stderr, "\n ");
|
||||||
fprintf (stderr, "[%02X]", state->dmr_pdu_sf[slot][i]);
|
fprintf (stderr, "[%02X]", state->dmr_pdu_sf[slot][i]);
|
||||||
if (i == 11 || i == 23 || i == 35 || i == 47 || i == 59 || i == 71 || i == 83 || i == 95)
|
|
||||||
{
|
|
||||||
fprintf (stderr, "\n ");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//debug print
|
//debug print
|
||||||
@@ -719,7 +716,7 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte
|
|||||||
{
|
{
|
||||||
|
|
||||||
//clear out unified pdu 'superframe' slot
|
//clear out unified pdu 'superframe' slot
|
||||||
for (short int i = 0; i < 288; i++)
|
for (int i = 0; i < 24*127; i++)
|
||||||
{
|
{
|
||||||
state->dmr_pdu_sf[slot][i] = 0;
|
state->dmr_pdu_sf[slot][i] = 0;
|
||||||
}
|
}
|
||||||
@@ -742,7 +739,7 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte
|
|||||||
{
|
{
|
||||||
|
|
||||||
//clear out unified pdu 'superframe' slot
|
//clear out unified pdu 'superframe' slot
|
||||||
for (short int i = 0; i < 288; i++)
|
for (int i = 0; i < 24*127; i++)
|
||||||
{
|
{
|
||||||
state->dmr_pdu_sf[slot][i] = 0;
|
state->dmr_pdu_sf[slot][i] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -497,20 +497,18 @@ void dmr_data_burst_handler(dsd_opts * opts, dsd_state * state, uint8_t info[196
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_full) //Rate 1 Data -- todo: fix padding bits, the four padding bits are on bit 96,97,98,99
|
if (is_full) //Rate 1 Data
|
||||||
{
|
{
|
||||||
CRCExtracted = 0;
|
CRCExtracted = 0;
|
||||||
CRCComputed = 0;
|
CRCComputed = 0;
|
||||||
IrrecoverableErrors = 0; //implicit, since there is no encoding
|
IrrecoverableErrors = 0; //implicit, since there is no encoding
|
||||||
|
|
||||||
for (i = 0; i < 24; i++)
|
for (i = 0; i < 12; i++)
|
||||||
{
|
|
||||||
DMR_PDU[i] = (uint8_t)ConvertBitIntoBytes(&info[i*8], 8);
|
DMR_PDU[i] = (uint8_t)ConvertBitIntoBytes(&info[i*8], 8);
|
||||||
}
|
|
||||||
//leftover 4 bits, manual doesn't say which 4 so assuming last 4
|
//Skip Padding Bits (96,97,98,99)
|
||||||
//pushing last 4 to 25 and shifting it
|
for (i = 0; i < 12; i++)
|
||||||
DMR_PDU[25] = (uint8_t)ConvertBitIntoBytes(&info[192], 4);
|
DMR_PDU[i+12] = (uint8_t)ConvertBitIntoBytes(&info[(i*8)+100], 8);
|
||||||
DMR_PDU[25] = DMR_PDU[25] << 4;
|
|
||||||
|
|
||||||
//set CRC to correct on unconfirmed 1 rate data blocks (for reporting due to no CRC available on these)
|
//set CRC to correct on unconfirmed 1 rate data blocks (for reporting due to no CRC available on these)
|
||||||
if (state->data_conf_data[slot] == 0) CRCCorrect = 1;
|
if (state->data_conf_data[slot] == 0) CRCCorrect = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user