diff --git a/include/dsd.h b/include/dsd.h index 312a0b7..92f373a 100644 --- a/include/dsd.h +++ b/include/dsd.h @@ -462,8 +462,7 @@ typedef struct unsigned int nxdn_cipher_type; unsigned int nxdn_key; char nxdn_call_type[1024]; - char dmr_callsign[2][6][99]; //plenty of room in case of overflow; - char dmr_lrrp[2][6][9999]; //need to fix this + unsigned long long int dmr_lrrp_source[2]; NxdnElementsContent_t NxdnElementsContent; @@ -488,7 +487,7 @@ typedef struct char slot2light[8]; int directmode; - char dmr_branding[25]; + char dmr_branding[99]; int dmr_stereo_payload[144]; //load up 144 dibit buffer for every single DMR TDMA frame uint8_t data_header_blocks[2]; //collect number of blocks to follow from data header per slot uint8_t data_header_padding[2]; //collect number of padding octets in last block per slot @@ -510,6 +509,9 @@ typedef struct uint8_t dmr_alias_format[2]; //per slot uint8_t dmr_alias_len[2]; //per slot char dmr_alias_block_segment[2][4][7][16]; //2 slots, by 4 blocks, by up to 7 alias bytes that are up to 16-bit chars + char dmr_embedded_gps[2][200]; //2 slots by 99 char string for string embedded gps + char dmr_lrrp_gps[2][200]; //2 slots by 99 char string for string lrrp gps + char dmr_site_parms[200]; //string for site/net info depending on type of DMR system (TIII or Con+) dPMRVoiceFS2Frame_t dPMRVoiceFS2Frame; diff --git a/src/dmr_block.c b/src/dmr_block.c index a38eb78..68d0cd0 100644 --- a/src/dmr_block.c +++ b/src/dmr_block.c @@ -90,11 +90,6 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint32_ fprintf (stderr, " Destination: "); fprintf (stderr, "[%d]", (dheader[2] <<16 ) + (dheader[3] <<8 ) + dheader[4] ); - sprintf ( state->dmr_lrrp[slot][1], "SRC [%d] DST [%d] ", - ( (dheader[5] <<16 ) + (dheader[6] << 8) + dheader[7]), - ( (dheader[2] <<16 ) + (dheader[3] <<8 ) + dheader[4]) ); - - state->dmr_lrrp_source[slot] = (dheader[5] <<16 ) + (dheader[6] << 8) + dheader[7]; } @@ -106,10 +101,6 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint32_ fprintf (stderr, " Destination: "); fprintf (stderr, "[%d]", (dheader[2] <<16 ) + (dheader[3] <<8 ) + dheader[4] ); - sprintf ( state->dmr_lrrp[slot][1], "SRC [%d] DST [%d] ", - ( (dheader[5] <<16 ) + (dheader[6] << 8) + dheader[7]), - ( (dheader[2] <<16 ) + (dheader[3] <<8 ) + dheader[4]) ); - state->dmr_lrrp_source[slot] = (dheader[5] <<16 ) + (dheader[6] << 8) + dheader[7]; } @@ -121,10 +112,6 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint32_ fprintf (stderr, " Destination: "); fprintf (stderr, "[%d]", (dheader[2] <<16 ) + (dheader[3] <<8 ) + dheader[4] ); - sprintf ( state->dmr_lrrp[slot][1], "SRC [%d] DST [%d] ", - ( (dheader[5] <<16 ) + (dheader[6] << 8) + dheader[7]), - ( (dheader[2] <<16 ) + (dheader[3] <<8 ) + dheader[4]) ); - state->dmr_lrrp_source[slot] = (dheader[5] <<16 ) + (dheader[6] << 8) + dheader[7]; } @@ -136,9 +123,6 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint32_ fprintf (stderr, " Destination: "); fprintf (stderr, "[%d]", dheader[2]); - sprintf ( state->dmr_lrrp[slot][1], "SRC [%d] DST [%d] ", - dheader[3], dheader[2] ); - state->dmr_lrrp_source[slot] = dheader[3]; } @@ -150,9 +134,6 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint32_ fprintf (stderr, " Destination: "); fprintf (stderr, "[%d]", dheader[2]); - sprintf ( state->dmr_lrrp[slot][1], "SRC [%d] DST [%d] ", - dheader[3], dheader[2] ); - state->dmr_lrrp_source[slot] = dheader[3]; } diff --git a/src/dmr_csbk.c b/src/dmr_csbk.c index 0ac3597..7bc827d 100644 --- a/src/dmr_csbk.c +++ b/src/dmr_csbk.c @@ -234,6 +234,11 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8 uint32_t target = (uint32_t)ConvertBitIntoBytes(&cs_pdu_bits[56], 24); fprintf (stderr, " C_ALOHA_SYS_PARMS - %s - Net ID: %d Site ID: %d Par: %d \n Reg Req: %d V: %d MS: %d", model_str, net, site, par, regreq, version, target); + + //add string for ncurses terminal display - no par since slc doesn't carrry that value + sprintf (state->dmr_site_parms, "TIII - %s N%d-S%d", model_str, net, site); + + //debug print //fprintf (stderr, " Sys ID Code: [%04X]", sysidcode); uint16_t syscode = (uint16_t)ConvertBitIntoBytes(&cs_pdu_bits[40], 16); diff --git a/src/dmr_dburst.c b/src/dmr_dburst.c index e5b44d3..3f4e925 100644 --- a/src/dmr_dburst.c +++ b/src/dmr_dburst.c @@ -10,7 +10,6 @@ *-----------------------------------------------------------------------------*/ //TODO: CRC9 on confirmed data blocks; CRC32 on completed data sf; -//TODO: Embedded GPS Calculations //TODO: MBC full message CRC16 (does this include the header or not though?) //TODO: Reverse Channel Signalling - RC single burst BPTC/7-bit CRC //TODO: Single Burst Embedded LC - Non-RC single burst LC - Look for Late Entry Alg/Key diff --git a/src/dmr_flco.c b/src/dmr_flco.c index aa91de0..895105d 100644 --- a/src/dmr_flco.c +++ b/src/dmr_flco.c @@ -102,18 +102,20 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C //I wonder which of these we truly want to zero out, possibly none of them if (state->currentslot == 0) { - // state->dmr_fid = 0; - // state->dmr_so = 0; - state->lasttg = 0; - state->lastsrc = 0; + state->dmr_fid = 0; + state->dmr_so = 0; + // state->lasttg = 0; + // state->lastsrc = 0; + state->payload_algid = 0; state->payload_mi = 0; } if (state->currentslot == 1) { - // state->dmr_fidR = 0; - // state->dmr_soR = 0; - state->lasttgR = 0; - state->lastsrcR = 0; + state->dmr_fidR = 0; + state->dmr_soR = 0; + // state->lasttgR = 0; + // state->lastsrcR = 0; + state->payload_algidR = 0; state->payload_miR = 0; } } @@ -440,9 +442,17 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[]) fprintf (stderr, "%s", KYEL); if (slco == 0x2) //C_SYS_Parms + { fprintf (stderr, " C_SYS_PARMS - %s - Net ID: %d Site ID: %d - Reg Req: %d - CSC: %d ", model_str, net, site, reg, csc); + //add string for ncurses terminal display - no par since slc doesn't carrry that value + sprintf (state->dmr_site_parms, "TIII - %s N%d-S%d", model_str, net, site); + } else if (slco == 0x3) //P_SYS_Parms + { fprintf (stderr, " P_SYS_PARMS - %s - Net ID: %d Site ID: %d - Comp Ch: %d ", model_str, net, site, reg); + //add string for ncurses terminal display - no par since slc doesn't carrry that value + sprintf (state->dmr_site_parms, "TIII - %s N%d-S%d", model_str, net, site); + } else if (slco == 0x0) //null fprintf (stderr, " SLCO NULL "); else if (slco == 0x1) @@ -452,6 +462,7 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[]) state->dmr_mfid = 0x10; sprintf (state->dmr_branding_sub, "%s", "Con+ "); fprintf (stderr, " SLCO Connect Plus Voice Channel - Net ID: %d Site ID: %d", con_netid, con_siteid); + sprintf (state->dmr_site_parms, "N%d-S%d", con_netid, con_siteid); } else if (slco == 0xA) @@ -459,6 +470,7 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[]) state->dmr_mfid = 0x10; sprintf (state->dmr_branding_sub, "%s", "Con+ "); fprintf (stderr, " SLCO Connect Plus Control Channel - Net ID: %d Site ID: %d", con_netid, con_siteid); + sprintf (state->dmr_site_parms, "N%d-S%d", con_netid, con_siteid); } else if (slco == 0xF) @@ -466,6 +478,7 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[]) state->dmr_mfid = 0x10; sprintf (state->dmr_branding_sub, "%s", "Cap+ "); fprintf (stderr, " SLCO Capacity Plus Rest Channel %d", restchannel); + state->dmr_rest_channel = restchannel; } else fprintf (stderr, " SLCO Unknown - %d ", slco); @@ -574,6 +587,7 @@ void dmr_embedded_gps (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[]) { fprintf (stderr, "%s", KYEL); fprintf (stderr, " Embedded GPS"); + uint8_t slot = state->currentslot; uint8_t pf = lc_bits[0]; uint8_t res_a = lc_bits[1]; uint8_t res_b = (uint8_t)ConvertBitIntoBytes(&lc_bits[16], 4); @@ -581,7 +595,26 @@ void dmr_embedded_gps (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[]) uint32_t lon = (uint32_t)ConvertBitIntoBytes(&lc_bits[23], 25); uint32_t lat = (uint32_t)ConvertBitIntoBytes(&lc_bits[48], 24); + double lat_unit = (double)180/(double)16777216; //180 divided by 2^24 + double lon_unit = (double)360/(double)33554432; //360 divided by 2^25 + //run calculations and print + //7.2.16 and 7.2.17 + double latitude = (double)-90 + ((double)lat * lat_unit); + double longitude = (double)-180 + ((double)lon * lon_unit); + + fprintf (stderr, " Lat: %.5lf Lon: %.5lf", latitude, longitude); + + //7.2.15 Position Error + uint16_t position_error = pow(2, pos_err); //2^pos_err = 2 meters to the pos_err power + if (pos_err == 0x7 ) fprintf (stderr, " Position Error: Not Known or Location Invalid"); + else fprintf (stderr, " Position Error: Less than %d meters", position_error); + + //save to array for ncurses + if (pos_err != 0x7) + { + sprintf (state->dmr_embedded_gps[slot], "E-GPS (%lf %lf) Error: %dm", latitude, longitude, position_error); + } fprintf (stderr, "%s", KNRM); } diff --git a/src/dmr_pdu.c b/src/dmr_pdu.c index 0939079..4f97a29 100644 --- a/src/dmr_pdu.c +++ b/src/dmr_pdu.c @@ -353,6 +353,17 @@ uint8_t dmr_lrrp_check (dsd_opts * opts, dsd_state * state, uint8_t DMR_PDU[]) fprintf (pFile, "\n"); fclose (pFile); } + + //save to array for ncurses + if (!source) source = state->dmr_lrrp_source[state->currentslot]; + char sign[8]; + if (lat_sign) sprintf (sign, "%s", "-"); + else sprintf (sign, "%s", ""); + if (lat) + { + sprintf (state->dmr_embedded_gps[slot], "LRRP %08d (%s%lf, %lf)", source, sign, (double)lat * lat_unit, (double)lon * lon_unit); + } + } } diff --git a/src/dsd_frame.c b/src/dsd_frame.c index 08a9eb9..0726c53 100644 --- a/src/dsd_frame.c +++ b/src/dsd_frame.c @@ -138,6 +138,28 @@ processFrame (dsd_opts * opts, dsd_state * state) //Start DMR Types else if ((state->synctype >= 10) && (state->synctype <= 13) || (state->synctype == 32) || (state->synctype == 33) || (state->synctype == 34) ) //32-34 DMR MS and RC { + + //print manufacturer strings to branding, disabled 0x10 moto other systems can use that fid set + //0x06 is trident, but when searching, apparently, they developed con+, but was bought by moto? + if (state->dmr_mfid == 0x10) ; //sprintf (state->dmr_branding, "%s", "Motorola"); + else if (state->dmr_mfid == 0x68) sprintf (state->dmr_branding, "%s", "Hytera"); + else if (state->dmr_mfid == 0x58) sprintf (state->dmr_branding, "%s", "Tait"); + + else if (state->dmr_mfid == 0x20) sprintf (state->dmr_branding, "%s", "JVC Kenwood"); + else if (state->dmr_mfid == 0x04) sprintf (state->dmr_branding, "%s", "Flyde Micro"); + else if (state->dmr_mfid == 0x05) sprintf (state->dmr_branding, "%s", "PROD-EL SPA"); + else if (state->dmr_mfid == 0x06) sprintf (state->dmr_branding, "%s", ""); //trident + else if (state->dmr_mfid == 0x07) sprintf (state->dmr_branding, "%s", "RADIODATA"); + else if (state->dmr_mfid == 0x08) sprintf (state->dmr_branding, "%s", "Hytera"); + else if (state->dmr_mfid == 0x09) sprintf (state->dmr_branding, "%s", "ASELSAN"); + else if (state->dmr_mfid == 0x0A) sprintf (state->dmr_branding, "%s", "Kirisun"); + else if (state->dmr_mfid == 0x0B) sprintf (state->dmr_branding, "%s", "DMR Association"); + else if (state->dmr_mfid == 0x13) sprintf (state->dmr_branding, "%s", "EMC S.P.A."); + else if (state->dmr_mfid == 0x1C) sprintf (state->dmr_branding, "%s", "EMC S.P.A."); + else if (state->dmr_mfid == 0x33) sprintf (state->dmr_branding, "%s", "Radio Activity"); + else if (state->dmr_mfid == 0x3C) sprintf (state->dmr_branding, "%s", "Radio Activity"); + else if (state->dmr_mfid == 0x77) sprintf (state->dmr_branding, "%s", "Vertex Standard"); + //disable so radio id doesn't blink in and out during ncurses and aggressive_framesync state->nac = 0; //state->lastsrc = 0; diff --git a/src/dsd_main.c b/src/dsd_main.c index a3d489f..0e2d698 100644 --- a/src/dsd_main.c +++ b/src/dsd_main.c @@ -260,6 +260,7 @@ noCarrier (dsd_opts * opts, dsd_state * state) state->dmr_rest_channel = -1; //init on -1 sprintf(state->dmr_branding_sub, "%s", ""); sprintf(state->dmr_branding, "%s", ""); + sprintf (state->dmr_site_parms, "%s", ""); //may not zero this out state->dmr_mfid = 0; //dmr slco stuff @@ -278,6 +279,16 @@ noCarrier (dsd_opts * opts, dsd_state * state) //late entry mi fragments memset (state->late_entry_mi_fragment, 0, sizeof (state->late_entry_mi_fragment)); + //dmr talker alias new/fixed stuff + memset(state->dmr_alias_format, 0, sizeof(state->dmr_alias_format)); + memset(state->dmr_alias_len, 0, sizeof(state->dmr_alias_len)); + memset(state->dmr_alias_block_segment, 0, sizeof(state->dmr_alias_block_segment)); + memset(state->dmr_embedded_gps, 0, sizeof(state->dmr_embedded_gps)); + memset(state->dmr_lrrp_gps, 0, sizeof(state->dmr_lrrp_gps)); + + //zero out vc frequencies? + state->p25_vc_freq[0] = 0; + state->p25_vc_freq[1] = 0; } //nocarrier @@ -581,31 +592,6 @@ initState (dsd_state * state) state->fourv_counter[0] = 0; state->fourv_counter[1] = 0; - sprintf (state->dmr_callsign[0][0], "%s", ""); - sprintf (state->dmr_callsign[0][1], "%s", ""); - sprintf (state->dmr_callsign[0][2], "%s", ""); - sprintf (state->dmr_callsign[0][3], "%s", ""); - sprintf (state->dmr_callsign[0][4], "%s", ""); - sprintf (state->dmr_callsign[0][5], "%s", ""); - sprintf (state->dmr_callsign[1][0], "%s", ""); - sprintf (state->dmr_callsign[1][1], "%s", ""); - sprintf (state->dmr_callsign[1][2], "%s", ""); - sprintf (state->dmr_callsign[1][3], "%s", ""); - sprintf (state->dmr_callsign[1][4], "%s", ""); - sprintf (state->dmr_callsign[1][5], "%s", ""); - sprintf (state->dmr_lrrp[0][0], "%s", ""); - sprintf (state->dmr_lrrp[0][1], "%s", ""); - sprintf (state->dmr_lrrp[0][2], "%s", ""); - sprintf (state->dmr_lrrp[0][3], "%s", ""); - sprintf (state->dmr_lrrp[0][4], "%s", ""); - sprintf (state->dmr_lrrp[0][5], "%s", ""); - sprintf (state->dmr_lrrp[1][0], "%s", ""); - sprintf (state->dmr_lrrp[1][1], "%s", ""); - sprintf (state->dmr_lrrp[1][2], "%s", ""); - sprintf (state->dmr_lrrp[1][3], "%s", ""); - sprintf (state->dmr_lrrp[1][4], "%s", ""); - sprintf (state->dmr_lrrp[1][5], "%s", ""); - state->K = 0; state->R = 0; state->RR = 0; @@ -737,6 +723,7 @@ initState (dsd_state * state) sprintf (state->dmr_branding, "%s", ""); sprintf (state->dmr_branding_sub, "%s", ""); + sprintf (state->dmr_site_parms, "%s", ""); //initialize unified dmr pdu 'superframe' memset (state->dmr_pdu_sf, 0, sizeof (state->dmr_pdu_sf)); @@ -755,12 +742,15 @@ initState (dsd_state * state) memset(state->dmr_alias_format, 0, sizeof(state->dmr_alias_format)); memset(state->dmr_alias_len, 0, sizeof(state->dmr_alias_len)); memset(state->dmr_alias_block_segment, 0, sizeof(state->dmr_alias_block_segment)); + memset(state->dmr_embedded_gps, 0, sizeof(state->dmr_embedded_gps)); + memset(state->dmr_lrrp_gps, 0, sizeof(state->dmr_lrrp_gps)); //late entry mi fragments memset (state->late_entry_mi_fragment, 0, sizeof (state->late_entry_mi_fragment)); initialize_p25_heuristics(&state->p25_heuristics); -} + +} //init_state void usage () diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index cd10197..78b5975 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -125,26 +125,26 @@ char * SyncTypes[44] = { }; char * DMRBusrtTypes[32] = { - "PI Header ", - "VOICE LC ", - "TLC ", - "CSBK ", - "MBC Header ", - "MBC Cont ", - "DATA Header ", - "RATE 1/2 DATA ", - "RATE 3/4 DATA ", - "Slot Idle ", - "RATE 1 DATA ", - "ERR ", //These values for ERR may be Reserved for use in future? + "PI ", + "VLC ", + "TLC ", + "CSBK ", + "MBCH ", + "MBCC ", + "DATA ", + "R12D ", + "R34D ", + "IDLE ", + "R1_D ", + "ERR ", "DUID ERR ", "R-S ERR ", "CRC ERR ", "NULL ", "Voice ", //Using 16 for Voice since its higher than possible value in DMR - "INITIAL ", //17 is assigned on start up - "INITIAL ", - "INITIAL ",//expanded to include P1/2 signalling + " ", //17 is assigned on start up + "INIT ", + "INIT ",//expanded to include P1/2 signalling "MAC PTT", //20 "MAC ACTIVE", //21 "MAC HANGTIME", //22 @@ -311,7 +311,7 @@ char *choices[] = { "Decode D-STAR*", "Decode P25-P1*", "Decode EDACS/PV", - "Decode DMR* (LEH)", + "Decode DMR Mono*", "Decode dPMR", "Decode NXDN48", "Decode NXDN96", @@ -503,7 +503,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) info_win = newwin(6, WIDTH+18, starty, startx+20); box (info_win, 0, 0); mvwprintw(info_win, 2, 2, " Legacy Auto can only detect the following:"); - mvwprintw(info_win, 3, 2, " P25-P1, D-STAR, DMR LEH, and X2-TDMA"); + mvwprintw(info_win, 3, 2, " P25-P1, D-STAR, DMR Mono, and X2-TDMA"); wrefresh(info_win); } @@ -957,7 +957,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) box (entry_win, 0, 0); mvwprintw(entry_win, 2, 2, "Key Type Selection"); mvwprintw(entry_win, 3, 2, " "); - mvwprintw(entry_win, 4, 2, "1 - DMRA Privacy "); + mvwprintw(entry_win, 4, 2, "1 - Basic Privacy "); mvwprintw(entry_win, 5, 2, "2 - **tera Privacy "); mvwprintw(entry_win, 6, 2, "3 - NXDN Scrambler "); mvwprintw(entry_win, 7, 2, "4 - Force Key Priority "); @@ -1075,6 +1075,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->samplesPerSymbol = 10; state->symbolCenter = 4; sprintf (opts->output_name, "Legacy Auto"); + opts->dmr_mono = 0; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1104,6 +1105,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->samplesPerSymbol = 5; state->symbolCenter = 2; sprintf (opts->output_name, "EDACS/PV"); + opts->dmr_mono = 0; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1131,6 +1133,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->samplesPerSymbol = 10; state->symbolCenter = 4; sprintf (opts->output_name, "D-STAR"); + opts->dmr_mono = 0; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1163,6 +1166,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->symbolCenter = 4; state->rf_mod = 0; sprintf (opts->output_name, "P25P1"); + opts->dmr_mono = 0; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1193,6 +1197,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->symbolCenter = 4; state->rf_mod = 0; sprintf (opts->output_name, "XDMA"); + opts->dmr_mono = 0; opts->dmr_stereo = 1; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 24000; @@ -1220,7 +1225,8 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->samplesPerSymbol = 10; state->symbolCenter = 4; state->rf_mod = 0; - sprintf (opts->output_name, "DMR LEH"); + sprintf (opts->output_name, "DMR Mono"); + opts->dmr_mono = 1; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1247,6 +1253,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->samplesPerSymbol = 20; state->symbolCenter = 10; sprintf (opts->output_name, "dPMR"); + opts->dmr_mono = 0; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1276,6 +1283,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->symbolCenter = 10; state->rf_mod = 0; sprintf (opts->output_name, "NXDN48"); + opts->dmr_mono = 0; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1302,6 +1310,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->samplesPerSymbol = 10; state->symbolCenter = 4; sprintf (opts->output_name, "NXDN96"); + opts->dmr_mono = 0; opts->dmr_stereo = 0; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 8000; @@ -1329,6 +1338,7 @@ void ncursesMenu (dsd_opts * opts, dsd_state * state) state->symbolCenter = 4; // sprintf (opts->output_name, "X2-TDMA"); sprintf (opts->output_name, "DMR Stereo"); + opts->dmr_mono = 0; opts->dmr_stereo = 1; //this value is the end user option state->dmr_stereo = 0; //this values toggles on and off depending on voice or data handling opts->pulse_digi_rate_out = 24000; @@ -1612,10 +1622,10 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) //Variable reset/set section //carrier reset - if (state->carrier == 0) //reset these to 0 when no carrier - { - sprintf(state->dmr_branding, "%s", ""); - } + // if (state->carrier == 0) //reset these to 0 when no carrier + // { + // sprintf(state->dmr_branding, "%s", ""); + // } //set lls sync types if (state->synctype >= 0 && state->synctype < 39) @@ -1623,38 +1633,6 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) lls = state->synctype; } - //reset DMR alias block and embedded gps if burst type is not 16 or carrier drop - if (state->dmrburstL != 16 || state->carrier == 0) - { - for (short i = 0; i < 6; i++) - { - sprintf (state->dmr_callsign[0][i], "%s", ""); - } - } - if (state->dmrburstR != 16 || state->carrier == 0) - { - for (short i = 0; i < 6; i++) - { - sprintf (state->dmr_callsign[1][i], "%s", ""); - } - } - - //reset DMR LRRP when call is active on current slot if burst type is not data or carrier drop - if (state->dmrburstL == 16 || state->carrier == 0) - { - for (short i = 0; i < 6; i++) - { - sprintf (state->dmr_lrrp[0][i], "%s", ""); - } - } - if (state->dmrburstR == 16 || state->carrier == 0) - { - for (short i = 0; i < 6; i++) - { - sprintf (state->dmr_lrrp[1][i], "%s", ""); - } - } - //NXDN if (state->nxdn_last_rid > 0 && state->nxdn_last_rid != src); { @@ -1851,6 +1829,9 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) state->dmr_end_alert[0] = 0; //new voice frame, okay to beep at the end of it } + memset(state->dmr_alias_block_segment[0], 0, sizeof(state->dmr_alias_block_segment[0])); + sprintf (state->dmr_embedded_gps[0], "%s", ""); + } //DMR BS Slot 1 - matrix 0-4 @@ -1891,6 +1872,9 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) state->dmr_end_alert[0] = 0; //new voice frame, okay to beep at the end of it } + memset(state->dmr_alias_block_segment[0], 0, sizeof(state->dmr_alias_block_segment[0])); + sprintf (state->dmr_embedded_gps[0], "%s", ""); + } //DMR BS Slot 2 - matrix 5-9 @@ -1930,6 +1914,9 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) state->dmr_end_alert[1] = 0; //new voice frame, okay to beep at the end of it } + memset(state->dmr_alias_block_segment[1], 0, sizeof(state->dmr_alias_block_segment[1])); + sprintf (state->dmr_embedded_gps[1], "%s", ""); + } //P25 P1 @@ -2078,7 +2065,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) } if (opts->p25_trunk == 1 && (opts->use_rigctl == 1 || opts->audio_in_type == 3) ) { - printw ("| Trunk Tracking Active (P25/EDACS/NXDN)\n"); + printw ("| Trunk Tracking Active (P25/EDACS/NXDN/DMR)\n"); } @@ -2250,6 +2237,21 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if (lls > 1 && lls < 30) { printw ("DMR BS - DCC: [%02i] ", dcc); + if (state->dmr_mfid > -1) printw ("%s %s", state->dmr_branding, state->dmr_branding_sub); + printw ("%s", state->dmr_site_parms); //site id, net id, etc + if (state->dmr_rest_channel > 0) + { + printw ("Rest Channel: [%02d] ", state->dmr_rest_channel); + if (state->trunk_chan_map[state->dmr_rest_channel] != 0) + { + printw ("%.06lf Mhz", (double)state->trunk_chan_map[state->dmr_rest_channel]/1000000); + } + } + else if (state->p25_cc_freq != 0) + { + printw ("%.06lf MHz", (double)state->p25_cc_freq/1000000); + } + } else if (lls == 32 || lls == 33 || lls == 34) { @@ -2282,9 +2284,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) { if (state->p25_cc_freq != 0) { - printw ("Freq: [%.06lf] MHz", (double)state->p25_cc_freq/1000000); + printw ("Freq: [%.06lf] MHz", (double)state->p25_cc_freq/1000000); } - //printw ("Freq: [%.06lf] MHz", (double)state->p25_cc_freq/1000000); } } @@ -2318,7 +2319,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if(state->dmrburstL == 16 && state->payload_algid == 0 && state->K > 0 && state->dmr_fid == 0x10 && (state->dmr_so & 0xCF) == 0x40) { attron(COLOR_PAIR(1)); - printw ("DMRA Pr Key [%3lld] ", state->K); + printw ("Pr Key [%3lld] ", state->K); attroff(COLOR_PAIR(1)); attron(COLOR_PAIR(3)); } @@ -2408,18 +2409,37 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) attron(COLOR_PAIR(3)); } printw ("\n"); - //Alias Blocks and Embedded GPS + //printw ("| | "); //10 spaces printw ("| D XTRA | "); + + //Frequency Display + if (state->p25_vc_freq[0] != 0) + { + attron(COLOR_PAIR(5)); + printw ("Frequency: [%.06lf] MHz ", (double)state->p25_vc_freq[0]/1000000); + if (state->carrier == 1) + { + attron(COLOR_PAIR(3)); + } + } + if(state->dmrburstL == 16) //only during call { attron(COLOR_PAIR(5)); - for (short i = 0; i < 5; i++) - { - printw ("%s", state->dmr_callsign[0][i]); - } + //Embedded GPS (not LRRP) - printw ("%s", state->dmr_callsign[0][5] ); + printw ("%s ", state->dmr_embedded_gps[0]); + + //Embedded Talker Alias Blocks + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 7; j++) + { + printw ("%s", state->dmr_alias_block_segment[0][i][j]); + } + } + attroff(COLOR_PAIR(5)); if (state->carrier == 1) { @@ -2430,27 +2450,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) //LRRP if(state->dmrburstL != 16) //only during data { - attron(COLOR_PAIR(5)); - for (short i = 0; i < 5; i++) - { - printw ("%s", state->dmr_lrrp[0][i]); - } - attroff(COLOR_PAIR(5)); - if (state->carrier == 1) - { - attron(COLOR_PAIR(3)); - } - } - - //Frequency Display - if (state->p25_vc_freq[0] != 0) - { - attron(COLOR_PAIR(5)); - printw ("Frequency: [%.06lf] MHz", (double)state->p25_vc_freq[0]/1000000); - if (state->carrier == 1) - { - attron(COLOR_PAIR(3)); - } + printw ("%s", state->dmr_lrrp_gps[0]); } //Group Name Labels from CSV import @@ -2503,7 +2503,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) if(state->dmrburstR == 16 && state->payload_algidR == 0 && state->K > 0 && ((state->dmr_soR & 0xCF) == 0x40) && state->dmr_fidR == 0x10) { attron(COLOR_PAIR(1)); - printw ("DMRA Pr Key [%3lld] ", state->K); + printw ("Pr Key [%3lld] ", state->K); attroff(COLOR_PAIR(1)); attron(COLOR_PAIR(3)); } @@ -2589,51 +2589,51 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state) attron(COLOR_PAIR(3)); } printw ("\n"); - //Alias Blocks and Embedded GPS + //printw ("| | "); printw ("| D XTRA | "); + + //Frequency Display + if (state->p25_vc_freq[1] != 0) + { + attron(COLOR_PAIR(5)); + printw ("Frequency: [%.06lf] MHz ", (double)state->p25_vc_freq[1]/1000000); + if (state->carrier == 1) + { + attron(COLOR_PAIR(3)); + } + } + if(state->dmrburstR == 16) //only during call { attron(COLOR_PAIR(5)); - for (short i = 0; i < 5; i++) - { - printw ("%s", state->dmr_callsign[1][i]); - } + //Embedded GPS (not LRRP) - printw ("%s", state->dmr_callsign[1][5] ); + printw ("%s ", state->dmr_embedded_gps[1]); + + //Embedded Talker Alias Blocks + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 7; j++) + { + printw ("%s", state->dmr_alias_block_segment[1][i][j]); + } + } + attroff(COLOR_PAIR(5)); if (state->carrier == 1) { attron(COLOR_PAIR(3)); } + } //LRRP if(state->dmrburstR != 16) //only during data { - attron(COLOR_PAIR(5)); - for (short i = 0; i < 5; i++) - { - printw ("%s", state->dmr_lrrp[1][i]); - } - attroff(COLOR_PAIR(5)); - if (state->carrier == 1) - { - attron(COLOR_PAIR(3)); - } + printw ("%s", state->dmr_embedded_gps[1]); } - //Frequency Display - if (state->p25_vc_freq[0] != 0) - { - attron(COLOR_PAIR(5)); - printw ("Frequency: [%.06lf] MHz", (double)state->p25_vc_freq[0]/1000000); - if (state->carrier == 1) - { - attron(COLOR_PAIR(3)); - } - } - //Group Name Labels from CSV import if (state->dmrburstR == 16 || state->dmrburstR > 19) {