mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 12:45:40 -05:00
More DMR Trunking Tweaks; MFID tweaks;
This commit is contained in:
@@ -228,7 +228,7 @@ void dmr_dheader (dsd_opts * opts, dsd_state * state, uint8_t dheader[], uint32_
|
|||||||
state->data_block_counter[slot]++; //increment the counter since this counts against the data blocks
|
state->data_block_counter[slot]++; //increment the counter since this counts against the data blocks
|
||||||
|
|
||||||
//set overarching manufacturer in use when non-standard feature id set is up
|
//set overarching manufacturer in use when non-standard feature id set is up
|
||||||
if (dheader[1] != 0) state->dmr_mfid = dheader[1];
|
//if (dheader[1] != 0) state->dmr_mfid = dheader[1]; //diable, will only set in link control or csbk for now (random manufacturers getting set, bad decode? or random feature?)
|
||||||
|
|
||||||
//assign prop header pdu to 'superframe'
|
//assign prop header pdu to 'superframe'
|
||||||
uint8_t blocks = state->data_header_blocks[slot] - 1;
|
uint8_t blocks = state->data_header_blocks[slot] - 1;
|
||||||
@@ -458,5 +458,5 @@ void dmr_reset_blocks (dsd_opts * opts, dsd_state * state)
|
|||||||
memset (state->data_header_blocks, 0, sizeof(state->data_header_blocks));
|
memset (state->data_header_blocks, 0, sizeof(state->data_header_blocks));
|
||||||
memset (state->data_block_crc_valid, 0, sizeof(state->data_block_crc_valid));
|
memset (state->data_block_crc_valid, 0, sizeof(state->data_block_crc_valid));
|
||||||
memset (state->dmr_lrrp_source, 0, sizeof(state->dmr_lrrp_source));
|
memset (state->dmr_lrrp_source, 0, sizeof(state->dmr_lrrp_source));
|
||||||
memset (state->dmr_cach_fragment, 0, sizeof (state->dmr_cach_fragment));
|
memset (state->dmr_cach_fragment, 1, sizeof (state->dmr_cach_fragment));
|
||||||
}
|
}
|
||||||
118
src/dmr_csbk.c
118
src/dmr_csbk.c
@@ -36,7 +36,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
csbk = ((cs_pdu[0] & 0x3F) << 8) | cs_pdu[1]; //opcode and fid combo set
|
csbk = ((cs_pdu[0] & 0x3F) << 8) | cs_pdu[1]; //opcode and fid combo set
|
||||||
|
|
||||||
//set overarching manufacturer in use when non-standard feature id set is up
|
//set overarching manufacturer in use when non-standard feature id set is up
|
||||||
if (csbk_fid != 0) state->dmr_mfid = csbk_fid;
|
if (csbk_fid != 0) state->dmr_mfid = csbk_fid;
|
||||||
|
|
||||||
//TIII standard with fid of 0 - (opcodes in decimal)
|
//TIII standard with fid of 0 - (opcodes in decimal)
|
||||||
if (0 == 0) //standard feature set for TIII //csbk_fid == 0
|
if (0 == 0) //standard feature set for TIII //csbk_fid == 0
|
||||||
@@ -148,39 +148,45 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
state->p25_vc_freq[1] = freq;
|
state->p25_vc_freq[1] = freq;
|
||||||
}
|
}
|
||||||
|
|
||||||
char mode[8]; //allow, block, digital, enc, etc
|
//if neither current slot has vlc, pi, or voice in it currently
|
||||||
|
//may need to fully write this out if this statement doesn't work the way I want it to
|
||||||
for (int i = 0; i < state->group_tally; i++)
|
if (state->dmrburstL != (16 || 0 || 1) && state->dmrburstR != (16 || 0 || 1) )
|
||||||
{
|
{
|
||||||
if (state->group_array[i].groupNumber == target)
|
char mode[8]; //allow, block, digital, enc, etc
|
||||||
{
|
|
||||||
fprintf (stderr, " [%s]", state->group_array[i].groupName);
|
|
||||||
strcpy (mode, state->group_array[i].groupMode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0))
|
for (int i = 0; i < state->group_tally; i++)
|
||||||
{
|
|
||||||
if (freq != 0) //if we have a valid frequency
|
|
||||||
{
|
{
|
||||||
//RIGCTL
|
if (state->group_array[i].groupNumber == target)
|
||||||
if (opts->use_rigctl == 1)
|
|
||||||
{
|
{
|
||||||
SetModulation(opts->rigctl_sockfd, 12500); //bw depends on system strength more than anything, 12.5 should be safe for DMR
|
fprintf (stderr, " [%s]", state->group_array[i].groupName);
|
||||||
SetFreq(opts->rigctl_sockfd, freq); //minus one because our index starts at zero
|
strcpy (mode, state->group_array[i].groupMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0))
|
||||||
|
{
|
||||||
|
if (freq != 0) //if we have a valid frequency
|
||||||
|
{
|
||||||
|
//RIGCTL
|
||||||
|
if (opts->use_rigctl == 1)
|
||||||
|
{
|
||||||
|
SetModulation(opts->rigctl_sockfd, 12500); //bw depends on system strength more than anything, 12.5 should be safe for DMR
|
||||||
|
SetFreq(opts->rigctl_sockfd, freq); //minus one because our index starts at zero
|
||||||
|
state->p25_vc_freq[0] = state->p25_vc_freq[1] = freq;
|
||||||
|
opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//rtl_udp
|
||||||
|
else if (opts->audio_in_type == 3)
|
||||||
|
{
|
||||||
|
rtl_udp_tune (opts, state, freq);
|
||||||
state->p25_vc_freq[0] = state->p25_vc_freq[1] = freq;
|
state->p25_vc_freq[0] = state->p25_vc_freq[1] = freq;
|
||||||
opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop
|
opts->p25_is_tuned = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//rtl_udp
|
|
||||||
else if (opts->audio_in_type == 3)
|
|
||||||
{
|
|
||||||
rtl_udp_tune (opts, state, freq);
|
|
||||||
state->p25_vc_freq[0] = state->p25_vc_freq[1] = freq;
|
|
||||||
opts->p25_is_tuned = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -246,7 +252,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
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);
|
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
|
//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);
|
sprintf (state->dmr_site_parms, "TIII - %s N%d-S%d ", model_str, net, site);
|
||||||
|
|
||||||
//debug print
|
//debug print
|
||||||
//fprintf (stderr, " Sys ID Code: [%04X]", sysidcode);
|
//fprintf (stderr, " Sys ID Code: [%04X]", sysidcode);
|
||||||
@@ -278,14 +284,13 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
if (p_kind == 0) fprintf (stderr, " Disable Target PTT (DIS_PTT)");
|
if (p_kind == 0) fprintf (stderr, " Disable Target PTT (DIS_PTT)");
|
||||||
if (p_kind == 1) fprintf (stderr, " Enable Target PTT (EN_PTT)");
|
if (p_kind == 1) fprintf (stderr, " Enable Target PTT (EN_PTT)");
|
||||||
if (p_kind == 2) fprintf (stderr, " Private Call (ILLEGALLY_PARKED)");
|
if (p_kind == 2) fprintf (stderr, " Private Call (ILLEGALLY_PARKED)");
|
||||||
if (p_kind == 3) fprintf (stderr, " Enable Target MS PTT(EN_PTT_ONE_MS)");//EN_PTT_ONE_MS
|
if (p_kind == 3) fprintf (stderr, " Enable Target MS PTT (EN_PTT_ONE_MS)");
|
||||||
|
|
||||||
fprintf (stderr, "\n");
|
fprintf (stderr, "\n");
|
||||||
fprintf (stderr, " Target [%08d] - Source [%08d]", target, source);
|
fprintf (stderr, " Target [%08d] - Source [%08d]", target, source);
|
||||||
|
|
||||||
//experimental, but this may work work if we stay on this channel
|
//Illegally Parked is another way to say a private call is outbound on this channel
|
||||||
//may be reversed considering we won't know exactly who is going to answer first
|
//so, we can use this as a form of 'link control'
|
||||||
//only good for an initial protect clear all as well
|
|
||||||
if (p_kind == 2)
|
if (p_kind == 2)
|
||||||
{
|
{
|
||||||
//don't set this if operating out of dmr mono or using call alert beep
|
//don't set this if operating out of dmr mono or using call alert beep
|
||||||
@@ -403,6 +408,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
//a 'follow rest channel on no sync' only approach
|
//a 'follow rest channel on no sync' only approach
|
||||||
if (csbk_o == 0x3E)
|
if (csbk_o == 0x3E)
|
||||||
{
|
{
|
||||||
|
|
||||||
//initial line break
|
//initial line break
|
||||||
fprintf (stderr, "\n");
|
fprintf (stderr, "\n");
|
||||||
fprintf (stderr, "%s", KYEL);
|
fprintf (stderr, "%s", KYEL);
|
||||||
@@ -459,6 +465,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
tghex = (uint32_t)ConvertBitIntoBytes(&cs_pdu_bits[32], 24);
|
tghex = (uint32_t)ConvertBitIntoBytes(&cs_pdu_bits[32], 24);
|
||||||
//fprintf (stderr, "\n TG Hex = 0x%06X", tghex);
|
//fprintf (stderr, "\n TG Hex = 0x%06X", tghex);
|
||||||
state->dmr_mfid = 0x10;
|
state->dmr_mfid = 0x10;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf (state->dmr_branding_sub, "%s", "Cap+ ");
|
sprintf (state->dmr_branding_sub, "%s", "Cap+ ");
|
||||||
fprintf (stderr, "%s", KNRM);
|
fprintf (stderr, "%s", KNRM);
|
||||||
|
|
||||||
@@ -533,6 +540,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, " Connect Plus Neighbors\n");
|
fprintf (stderr, " Connect Plus Neighbors\n");
|
||||||
fprintf (stderr, " NB1(%02d), NB2(%02d), NB3(%02d), NB4(%02d), NB5(%02d)", nb1, nb2, nb3, nb4, nb5);
|
fprintf (stderr, " NB1(%02d), NB2(%02d), NB3(%02d), NB4(%02d), NB5(%02d)", nb1, nb2, nb3, nb4, nb5);
|
||||||
state->dmr_mfid = 0x06;
|
state->dmr_mfid = 0x06;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf(state->dmr_branding_sub, "Con+ ");
|
sprintf(state->dmr_branding_sub, "Con+ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -549,6 +557,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, " Connect Plus Voice Channel Grant\n");
|
fprintf (stderr, " Connect Plus Voice Channel Grant\n");
|
||||||
fprintf (stderr, " srcAddr(%8d), grpAddr(%8d), LCN(%d), TS(%d)",srcAddr, grpAddr, lcn, tslot);
|
fprintf (stderr, " srcAddr(%8d), grpAddr(%8d), LCN(%d), TS(%d)",srcAddr, grpAddr, lcn, tslot);
|
||||||
state->dmr_mfid = 0x06;
|
state->dmr_mfid = 0x06;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf(state->dmr_branding_sub, "Con+ ");
|
sprintf(state->dmr_branding_sub, "Con+ ");
|
||||||
// state->dmr_vc_lcn = lcn;
|
// state->dmr_vc_lcn = lcn;
|
||||||
// state->dmr_vc_lsn = lcn * (tslot+1);
|
// state->dmr_vc_lsn = lcn * (tslot+1);
|
||||||
@@ -570,31 +579,37 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, " [%s]", state->group_array[i].groupName);
|
fprintf (stderr, " [%s]", state->group_array[i].groupName);
|
||||||
strcpy (mode, state->group_array[i].groupMode);
|
strcpy (mode, state->group_array[i].groupMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//need channel map frequencies and stuff, also way to figure out control channel frequency? (channel 0 from channel map?)
|
//voice calls can occur on the con+ control channel, so we need the same check for voice as we do for cap+
|
||||||
if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0))
|
//if neither current slot has vlc, pi, or voice in it currently
|
||||||
|
//may need to fully write this out if this statement doesn't work the way I want it to
|
||||||
|
if (state->dmrburstL != (16 || 0 || 1) && state->dmrburstR != (16 || 0 || 1) )
|
||||||
{
|
{
|
||||||
if (state->trunk_chan_map[lcn] != 0) //if we have a valid frequency
|
//need channel map frequencies and stuff, also way to figure out control channel frequency? (channel 0 from channel map?)
|
||||||
|
if (state->p25_cc_freq != 0 && opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0))
|
||||||
{
|
{
|
||||||
//RIGCTL
|
if (state->trunk_chan_map[lcn] != 0) //if we have a valid frequency
|
||||||
if (opts->use_rigctl == 1)
|
|
||||||
{
|
{
|
||||||
SetModulation(opts->rigctl_sockfd, 12500); //bw depends on system strength more than anything, 12.5 should be safe for DMR
|
//RIGCTL
|
||||||
SetFreq(opts->rigctl_sockfd, state->trunk_chan_map[lcn]); //minus one because our index starts at zero
|
if (opts->use_rigctl == 1)
|
||||||
|
{
|
||||||
|
SetModulation(opts->rigctl_sockfd, 12500); //bw depends on system strength more than anything, 12.5 should be safe for DMR
|
||||||
|
SetFreq(opts->rigctl_sockfd, state->trunk_chan_map[lcn]); //minus one because our index starts at zero
|
||||||
|
state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[lcn];
|
||||||
|
opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//rtl_udp
|
||||||
|
else if (opts->audio_in_type == 3)
|
||||||
|
{
|
||||||
|
rtl_udp_tune (opts, state, state->trunk_chan_map[lcn]);
|
||||||
state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[lcn];
|
state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[lcn];
|
||||||
opts->p25_is_tuned = 1; //set to 1 to set as currently tuned so we don't keep tuning nonstop
|
opts->p25_is_tuned = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//rtl_udp
|
|
||||||
else if (opts->audio_in_type == 3)
|
|
||||||
{
|
|
||||||
rtl_udp_tune (opts, state, state->trunk_chan_map[lcn]);
|
|
||||||
state->p25_vc_freq[0] = state->p25_vc_freq[1] = state->trunk_chan_map[lcn];
|
|
||||||
opts->p25_is_tuned = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -610,6 +625,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, " Connect Plus Data Channel Grant\n");
|
fprintf (stderr, " Connect Plus Data Channel Grant\n");
|
||||||
fprintf (stderr, " srcAddr(%8d), grpAddr(%8d), LCN(%d), TS(%d)",srcAddr, grpAddr, lcn, tslot);
|
fprintf (stderr, " srcAddr(%8d), grpAddr(%8d), LCN(%d), TS(%d)",srcAddr, grpAddr, lcn, tslot);
|
||||||
state->dmr_mfid = 0x06;
|
state->dmr_mfid = 0x06;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf(state->dmr_branding_sub, "Con+ ");
|
sprintf(state->dmr_branding_sub, "Con+ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -625,6 +641,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, " Connect Plus Terminate Channel Grant\n"); //Data only shows a srcAddr??
|
fprintf (stderr, " Connect Plus Terminate Channel Grant\n"); //Data only shows a srcAddr??
|
||||||
fprintf (stderr, " srcAddr(%8d), grpAddr(%8d), LCN(%d), TS(%d)",srcAddr, grpAddr, lcn, tslot);
|
fprintf (stderr, " srcAddr(%8d), grpAddr(%8d), LCN(%d), TS(%d)",srcAddr, grpAddr, lcn, tslot);
|
||||||
state->dmr_mfid = 0x06;
|
state->dmr_mfid = 0x06;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf(state->dmr_branding_sub, "Con+ ");
|
sprintf(state->dmr_branding_sub, "Con+ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -635,6 +652,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, "%s", KYEL);
|
fprintf (stderr, "%s", KYEL);
|
||||||
fprintf (stderr, " Connect Plus Registration Request");
|
fprintf (stderr, " Connect Plus Registration Request");
|
||||||
state->dmr_mfid = 0x06;
|
state->dmr_mfid = 0x06;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf(state->dmr_branding_sub, "Con+ ");
|
sprintf(state->dmr_branding_sub, "Con+ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -645,6 +663,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, "%s", KYEL);
|
fprintf (stderr, "%s", KYEL);
|
||||||
fprintf (stderr, " Connect Plus Registration Response");
|
fprintf (stderr, " Connect Plus Registration Response");
|
||||||
state->dmr_mfid = 0x06;
|
state->dmr_mfid = 0x06;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf(state->dmr_branding_sub, "Con+ ");
|
sprintf(state->dmr_branding_sub, "Con+ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -655,6 +674,7 @@ void dmr_cspdu (dsd_opts * opts, dsd_state * state, uint8_t cs_pdu_bits[], uint8
|
|||||||
fprintf (stderr, "%s", KYEL);
|
fprintf (stderr, "%s", KYEL);
|
||||||
fprintf (stderr, " Connect Plus Talkgroup Affiliation");
|
fprintf (stderr, " Connect Plus Talkgroup Affiliation");
|
||||||
state->dmr_mfid = 0x06;
|
state->dmr_mfid = 0x06;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf(state->dmr_branding_sub, "Con+ ");
|
sprintf(state->dmr_branding_sub, "Con+ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ void dmr_flco (dsd_opts * opts, dsd_state * state, uint8_t lc_bits[], uint32_t C
|
|||||||
is_cap_plus = 1;
|
is_cap_plus = 1;
|
||||||
restchannel = (int)ConvertBitIntoBytes(&lc_bits[48], 8);
|
restchannel = (int)ConvertBitIntoBytes(&lc_bits[48], 8);
|
||||||
source = (uint32_t)ConvertBitIntoBytes(&lc_bits[56], 16);
|
source = (uint32_t)ConvertBitIntoBytes(&lc_bits[56], 16);
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
|
sprintf (state->dmr_branding_sub, "%s", "Cap+ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -267,7 +269,7 @@ uint8_t dmr_cach (dsd_opts * opts, dsd_state * state, uint8_t cach_bits[25])
|
|||||||
{
|
{
|
||||||
//reset the full cach, even if we aren't going to use it, may be beneficial for next time
|
//reset the full cach, even if we aren't going to use it, may be beneficial for next time
|
||||||
state->dmr_cach_counter = 0; //first fragment, set to zero.
|
state->dmr_cach_counter = 0; //first fragment, set to zero.
|
||||||
memset (state->dmr_cach_fragment, 0, sizeof (state->dmr_cach_fragment));
|
memset (state->dmr_cach_fragment, 1, sizeof (state->dmr_cach_fragment));
|
||||||
|
|
||||||
//seperate
|
//seperate
|
||||||
for (i = 0; i < 17; i++)
|
for (i = 0; i < 17; i++)
|
||||||
@@ -288,7 +290,7 @@ uint8_t dmr_cach (dsd_opts * opts, dsd_state * state, uint8_t cach_bits[25])
|
|||||||
h1 = Hamming17123 (slco_bits + 0);
|
h1 = Hamming17123 (slco_bits + 0);
|
||||||
|
|
||||||
//run single - manual would suggest that though this exists, there is no support? or perhaps its manufacturer only thing?
|
//run single - manual would suggest that though this exists, there is no support? or perhaps its manufacturer only thing?
|
||||||
if (h1) ; // dmr_slco (opts, state, slco_bits); //random false positibes for con+, so diabled for now
|
if (h1) ; // dmr_slco (opts, state, slco_bits); //random false positives and sets bad parms/mfid etc
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
err = 1;
|
err = 1;
|
||||||
@@ -301,7 +303,7 @@ uint8_t dmr_cach (dsd_opts * opts, dsd_state * state, uint8_t cach_bits[25])
|
|||||||
{
|
{
|
||||||
//reset the full cach and counter
|
//reset the full cach and counter
|
||||||
state->dmr_cach_counter = 0;
|
state->dmr_cach_counter = 0;
|
||||||
memset (state->dmr_cach_fragment, 0, sizeof (state->dmr_cach_fragment));
|
memset (state->dmr_cach_fragment, 1, sizeof (state->dmr_cach_fragment));
|
||||||
}
|
}
|
||||||
if (lcss == 3) state->dmr_cach_counter++; //continuation, so increment counter by one.
|
if (lcss == 3) state->dmr_cach_counter++; //continuation, so increment counter by one.
|
||||||
if (lcss == 2) //final segment - assemble, de-interleave, hamming, crc, and execute
|
if (lcss == 2) //final segment - assemble, de-interleave, hamming, crc, and execute
|
||||||
@@ -315,7 +317,7 @@ uint8_t dmr_cach (dsd_opts * opts, dsd_state * state, uint8_t cach_bits[25])
|
|||||||
//zero out complete fragment array
|
//zero out complete fragment array
|
||||||
lcss = 5; //toss away value
|
lcss = 5; //toss away value
|
||||||
state->dmr_cach_counter = 0;
|
state->dmr_cach_counter = 0;
|
||||||
memset (state->dmr_cach_fragment, 0, sizeof (state->dmr_cach_fragment));
|
memset (state->dmr_cach_fragment, 1, sizeof (state->dmr_cach_fragment));
|
||||||
err = 1;
|
err = 1;
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
@@ -451,13 +453,13 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[])
|
|||||||
{
|
{
|
||||||
fprintf (stderr, " C_SYS_PARMS - %s - Net ID: %d Site ID: %d - Reg Req: %d - CSC: %d ", model_str, net, site, reg, csc);
|
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
|
//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);
|
sprintf (state->dmr_site_parms, "TIII - %s N%d-S%d ", model_str, net, site);
|
||||||
}
|
}
|
||||||
else if (slco == 0x3) //P_SYS_Parms
|
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);
|
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
|
//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);
|
sprintf (state->dmr_site_parms, "TIII - %s N%d-S%d ", model_str, net, site);
|
||||||
}
|
}
|
||||||
else if (slco == 0x0) //null
|
else if (slco == 0x0) //null
|
||||||
fprintf (stderr, " SLCO NULL ");
|
fprintf (stderr, " SLCO NULL ");
|
||||||
@@ -466,6 +468,7 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[])
|
|||||||
else if (slco == 0x9)
|
else if (slco == 0x9)
|
||||||
{
|
{
|
||||||
state->dmr_mfid = 0x10;
|
state->dmr_mfid = 0x10;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf (state->dmr_branding_sub, "%s", "Con+ ");
|
sprintf (state->dmr_branding_sub, "%s", "Con+ ");
|
||||||
fprintf (stderr, " SLCO Connect Plus Voice Channel - Net ID: %d Site ID: %d", con_netid, con_siteid);
|
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);
|
sprintf (state->dmr_site_parms, "N%d - S%d ", con_netid, con_siteid);
|
||||||
@@ -474,6 +477,7 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[])
|
|||||||
else if (slco == 0xA)
|
else if (slco == 0xA)
|
||||||
{
|
{
|
||||||
state->dmr_mfid = 0x10;
|
state->dmr_mfid = 0x10;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf (state->dmr_branding_sub, "%s", "Con+ ");
|
sprintf (state->dmr_branding_sub, "%s", "Con+ ");
|
||||||
fprintf (stderr, " SLCO Connect Plus Control Channel - Net ID: %d Site ID: %d", con_netid, con_siteid);
|
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);
|
sprintf (state->dmr_site_parms, "N%d - S%d ", con_netid, con_siteid);
|
||||||
@@ -482,6 +486,7 @@ void dmr_slco (dsd_opts * opts, dsd_state * state, uint8_t slco_bits[])
|
|||||||
else if (slco == 0xF)
|
else if (slco == 0xF)
|
||||||
{
|
{
|
||||||
state->dmr_mfid = 0x10;
|
state->dmr_mfid = 0x10;
|
||||||
|
sprintf (state->dmr_branding, "%s", "Motorola");
|
||||||
sprintf (state->dmr_branding_sub, "%s", "Cap+ ");
|
sprintf (state->dmr_branding_sub, "%s", "Cap+ ");
|
||||||
fprintf (stderr, " SLCO Capacity Plus Rest Channel %d", restchannel);
|
fprintf (stderr, " SLCO Capacity Plus Rest Channel %d", restchannel);
|
||||||
state->dmr_rest_channel = restchannel;
|
state->dmr_rest_channel = restchannel;
|
||||||
|
|||||||
@@ -145,20 +145,22 @@ processFrame (dsd_opts * opts, dsd_state * state)
|
|||||||
else if (state->dmr_mfid == 0x68) sprintf (state->dmr_branding, "%s", "Hytera");
|
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 == 0x58) sprintf (state->dmr_branding, "%s", "Tait");
|
||||||
|
|
||||||
else if (state->dmr_mfid == 0x20) sprintf (state->dmr_branding, "%s", "JVC Kenwood");
|
//disabling these due to random data decodes setting an odd mfid, could be legit, but only for that one packet?
|
||||||
else if (state->dmr_mfid == 0x04) sprintf (state->dmr_branding, "%s", "Flyde Micro");
|
//or, its just a decode error somewhere
|
||||||
else if (state->dmr_mfid == 0x05) sprintf (state->dmr_branding, "%s", "PROD-EL SPA");
|
// else if (state->dmr_mfid == 0x20) sprintf (state->dmr_branding, "%s", "JVC Kenwood");
|
||||||
else if (state->dmr_mfid == 0x06) sprintf (state->dmr_branding, "%s", ""); //trident
|
// else if (state->dmr_mfid == 0x04) sprintf (state->dmr_branding, "%s", "Flyde Micro");
|
||||||
else if (state->dmr_mfid == 0x07) sprintf (state->dmr_branding, "%s", "RADIODATA");
|
// else if (state->dmr_mfid == 0x05) sprintf (state->dmr_branding, "%s", "PROD-EL SPA");
|
||||||
else if (state->dmr_mfid == 0x08) sprintf (state->dmr_branding, "%s", "Hytera");
|
// else if (state->dmr_mfid == 0x06) sprintf (state->dmr_branding, "%s", "Motorola"); //trident/moto con+
|
||||||
else if (state->dmr_mfid == 0x09) sprintf (state->dmr_branding, "%s", "ASELSAN");
|
// else if (state->dmr_mfid == 0x07) sprintf (state->dmr_branding, "%s", "RADIODATA");
|
||||||
else if (state->dmr_mfid == 0x0A) sprintf (state->dmr_branding, "%s", "Kirisun");
|
// else if (state->dmr_mfid == 0x08) sprintf (state->dmr_branding, "%s", "Hytera");
|
||||||
else if (state->dmr_mfid == 0x0B) sprintf (state->dmr_branding, "%s", "DMR Association");
|
// else if (state->dmr_mfid == 0x09) sprintf (state->dmr_branding, "%s", "ASELSAN");
|
||||||
else if (state->dmr_mfid == 0x13) sprintf (state->dmr_branding, "%s", "EMC S.P.A.");
|
// else if (state->dmr_mfid == 0x0A) sprintf (state->dmr_branding, "%s", "Kirisun");
|
||||||
else if (state->dmr_mfid == 0x1C) sprintf (state->dmr_branding, "%s", "EMC S.P.A.");
|
// else if (state->dmr_mfid == 0x0B) sprintf (state->dmr_branding, "%s", "DMR Association");
|
||||||
else if (state->dmr_mfid == 0x33) sprintf (state->dmr_branding, "%s", "Radio Activity");
|
// else if (state->dmr_mfid == 0x13) sprintf (state->dmr_branding, "%s", "EMC S.P.A.");
|
||||||
else if (state->dmr_mfid == 0x3C) sprintf (state->dmr_branding, "%s", "Radio Activity");
|
// else if (state->dmr_mfid == 0x1C) sprintf (state->dmr_branding, "%s", "EMC S.P.A.");
|
||||||
else if (state->dmr_mfid == 0x77) sprintf (state->dmr_branding, "%s", "Vertex Standard");
|
// 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
|
//disable so radio id doesn't blink in and out during ncurses and aggressive_framesync
|
||||||
state->nac = 0;
|
state->nac = 0;
|
||||||
|
|||||||
@@ -170,7 +170,12 @@ noCarrier (dsd_opts * opts, dsd_state * state)
|
|||||||
//zero out nxdn site/srv/cch info if not trunking
|
//zero out nxdn site/srv/cch info if not trunking
|
||||||
state->nxdn_location_site_code = 0;
|
state->nxdn_location_site_code = 0;
|
||||||
state->nxdn_location_sys_code = 0;
|
state->nxdn_location_sys_code = 0;
|
||||||
sprintf (state->nxdn_location_category, "%s", " ");
|
sprintf (state->nxdn_location_category, "%s", " ");
|
||||||
|
|
||||||
|
//dmr mfid branding and site parms
|
||||||
|
sprintf(state->dmr_branding_sub, "%s", "");
|
||||||
|
sprintf(state->dmr_branding, "%s", "");
|
||||||
|
sprintf (state->dmr_site_parms, "%s", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//zero out after x second hangtime when trunking to prevent premature zeroing on these variables
|
//zero out after x second hangtime when trunking to prevent premature zeroing on these variables
|
||||||
@@ -181,9 +186,7 @@ noCarrier (dsd_opts * opts, dsd_state * state)
|
|||||||
state->lastsrc = 0;
|
state->lastsrc = 0;
|
||||||
state->lasttgR = 0;
|
state->lasttgR = 0;
|
||||||
state->lastsrcR = 0;
|
state->lastsrcR = 0;
|
||||||
//zero out vc frequencies?
|
|
||||||
// state->p25_vc_freq[0] = 0;
|
|
||||||
// state->p25_vc_freq[1] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
state->lastp25type = 0;
|
state->lastp25type = 0;
|
||||||
@@ -287,13 +290,11 @@ noCarrier (dsd_opts * opts, dsd_state * state)
|
|||||||
memset (state->nxdn_alias_block_segment, 0, sizeof(state->nxdn_alias_block_segment));
|
memset (state->nxdn_alias_block_segment, 0, sizeof(state->nxdn_alias_block_segment));
|
||||||
sprintf (state->nxdn_call_type, "%s", "");
|
sprintf (state->nxdn_call_type, "%s", "");
|
||||||
|
|
||||||
sprintf(state->dmr_branding_sub, "%s", "");
|
//dmr overaching manufacturer in use for a particular system or radio
|
||||||
sprintf(state->dmr_branding, "%s", "");
|
// state->dmr_mfid = -1;
|
||||||
sprintf (state->dmr_site_parms, "%s", ""); //may not zero this out
|
|
||||||
state->dmr_mfid = -1;
|
|
||||||
|
|
||||||
//dmr slco stuff
|
//dmr slco stuff
|
||||||
memset(state->dmr_cach_fragment, 0, sizeof(state->dmr_cach_fragment));
|
memset(state->dmr_cach_fragment, 1, sizeof(state->dmr_cach_fragment));
|
||||||
state->dmr_cach_counter = 0;
|
state->dmr_cach_counter = 0;
|
||||||
|
|
||||||
//initialize unified dmr pdu 'superframe'
|
//initialize unified dmr pdu 'superframe'
|
||||||
@@ -320,9 +321,10 @@ noCarrier (dsd_opts * opts, dsd_state * state)
|
|||||||
state->dmr_rest_channel = -1;
|
state->dmr_rest_channel = -1;
|
||||||
state->p25_vc_freq[0] = 0;
|
state->p25_vc_freq[0] = 0;
|
||||||
state->p25_vc_freq[1] = 0;
|
state->p25_vc_freq[1] = 0;
|
||||||
state->dmr_mfid = 0;
|
state->dmr_mfid = -1;
|
||||||
sprintf(state->dmr_branding_sub, "%s", "");
|
sprintf(state->dmr_branding_sub, "%s", "");
|
||||||
sprintf(state->dmr_branding, "%s", "");
|
sprintf(state->dmr_branding, "%s", "");
|
||||||
|
sprintf (state->dmr_site_parms, "%s", "");
|
||||||
opts->p25_is_tuned = 0;
|
opts->p25_is_tuned = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -771,7 +773,7 @@ initState (dsd_state * state)
|
|||||||
memset (state->data_block_crc_valid, 0, sizeof(state->data_block_crc_valid));
|
memset (state->data_block_crc_valid, 0, sizeof(state->data_block_crc_valid));
|
||||||
|
|
||||||
//dmr slco stuff
|
//dmr slco stuff
|
||||||
memset(state->dmr_cach_fragment, 0, sizeof(state->dmr_cach_fragment));
|
memset(state->dmr_cach_fragment, 1, sizeof(state->dmr_cach_fragment));
|
||||||
state->dmr_cach_counter = 0;
|
state->dmr_cach_counter = 0;
|
||||||
|
|
||||||
//embedded signalling
|
//embedded signalling
|
||||||
|
|||||||
@@ -2241,7 +2241,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
|||||||
if (lls > 1 && lls < 30)
|
if (lls > 1 && lls < 30)
|
||||||
{
|
{
|
||||||
printw ("DMR BS - DCC: [%02i] ", dcc);
|
printw ("DMR BS - DCC: [%02i] ", dcc);
|
||||||
if (state->dmr_mfid > -1) printw ("%s %s", state->dmr_branding, state->dmr_branding_sub);
|
printw ("%s %s", state->dmr_branding, state->dmr_branding_sub);
|
||||||
printw ("%s", state->dmr_site_parms); //site id, net id, etc
|
printw ("%s", state->dmr_site_parms); //site id, net id, etc
|
||||||
if (state->dmr_rest_channel > 0)
|
if (state->dmr_rest_channel > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user