DMR - Misc UDT / NMEA Cleanup;

This commit is contained in:
lwvmobile
2023-12-16 22:48:40 -05:00
parent 7193bca136
commit fa6fe06068

View File

@@ -420,8 +420,12 @@ void nmea_iec_61162_1 (dsd_opts * opts, dsd_state * state, uint8_t * input, uint
sprintf (deg_glyph, "%s", "°"); sprintf (deg_glyph, "%s", "°");
float latitude = 0.0f; float latitude = 0.0f;
float longitude = 0.0f; float longitude = 0.0f;
// float m_unit = 1.0f / 60.0f; //unit to convert min into decimal value - (1/60)*60 minutes = 1 degree
// float mm_unit = 1.0f / 10000.0f; //unit to convert minf into decimal value - (0000 - 9999) 0.0001×9999 = .9999 minutes, so its sub 1 minute decimal
//testing w/ Harris NMEA like values (ran tests over there with this code, this seems to work on those values)
float m_unit = 1.0f / 60.0f; //unit to convert min into decimal value - (1/60)*60 minutes = 1 degree float m_unit = 1.0f / 60.0f; //unit to convert min into decimal value - (1/60)*60 minutes = 1 degree
float mm_unit = 1.0f / 1000.0f; //unit to convert minf into decimal value - (0000 - 9999) 0.0001×9999 = .9999 minutes, so its sub 1 minute decimal float mm_unit = 1.0f / 600000.0f; //unit to convert minf into decimal value - (0000 - 9999) 0.0001×9999 = .9999 minutes, so its sub 1 minute decimal
//speed conversion //speed conversion
float fmps, fmph, fkph = 0.0f; //conversion of knots to mps, kph, and mph values float fmps, fmph, fkph = 0.0f; //conversion of knots to mps, kph, and mph values
@@ -682,9 +686,9 @@ void dmr_udt_decoder (dsd_opts * opts, dsd_state * state, uint8_t * block_bytes,
else if (udt_uab == 2) else if (udt_uab == 2)
nmea_iec_61162_1 (opts, state, cs_bits+96, udt_source, 2); //standard long format w/ 2 appended blocks nmea_iec_61162_1 (opts, state, cs_bits+96, udt_source, 2); //standard long format w/ 2 appended blocks
//check the 'spare' bits from 184 to 192 to see if this is a manufacturer specific nmea format //check the 'spare' bits from 184 to 192 to see if this is a manufacturer specific nmea format
else if (udt_uab == 3) //mfid format w/ 2 appended blocks -- format unspecified -- this may fail to trigger due to block assembler else if (udt_uab == 3) //mfid format w/ 2 appended blocks -- format unspecified
fprintf (stderr, " Unspecified MFID Format: %02X;", (uint8_t)ConvertBitIntoBytes(&cs_bits[184], 8)); fprintf (stderr, " Unspecified MFID Format: %02X;", (uint8_t)ConvertBitIntoBytes(&cs_bits[184], 8));
else //this may fail to trigger due to block assembler also else
fprintf (stderr, " Reserved Format; "); fprintf (stderr, " Reserved Format; ");
} }
else if (udt_format2 == 0x0B) else if (udt_format2 == 0x0B)
@@ -1015,23 +1019,6 @@ void dmr_block_assembler (dsd_opts * opts, dsd_state * state, uint8_t block_byte
if (pf) fprintf (stderr, "MBC/UDT Header/Blocks Protected "); if (pf) fprintf (stderr, "MBC/UDT Header/Blocks Protected ");
fprintf (stderr, "%s ", KNRM); fprintf (stderr, "%s ", KNRM);
} }
//This is a placeholder, TODO: Write Function to handle UDT and also handle ISO7, ISO8, and UTF16 text/aliases, etc
// if (is_udt) //only on ISO8 opcode //&& (state->dmr_pdu_sf[slot][9] & 0x7F) == 0x1A
// {
// fprintf (stderr, "%s", KCYN);
// if (opts->payload == 0)
// fprintf (stderr, "\n ");
// fprintf (stderr, "Unified Data Transport - ASCII: " );
// for (i = 12; i < ((blocks+1)*12)-2; i++)
// {
// if (state->dmr_pdu_sf[slot][i] <= 0x7E && state->dmr_pdu_sf[slot][i] >=0x20)
// {
// fprintf (stderr, "%c", state->dmr_pdu_sf[slot][i]);
// }
// else fprintf (stderr, " ");
// }
// }
} //end last block flag on MBC } //end last block flag on MBC
} //end type 2 (MBC Header and Continuation) } //end type 2 (MBC Header and Continuation)