diff --git a/src/p25_lcw.c b/src/p25_lcw.c index 99fc609..165663a 100644 --- a/src/p25_lcw.c +++ b/src/p25_lcw.c @@ -93,7 +93,9 @@ void p25_lcw (dsd_opts * opts, dsd_state * state, uint8_t LCW_bits[], uint8_t ir } - //uses explicit bit? + //TODO: Allow Tuning from Call Grants either in LDU1 or TDULC? (TDMA to p1 fallback?) + //TODO: Allow TG Hold overrides here either in LDU1 or TDULC? + //NOTE: If we have an active TG hold, we really should't be here anyways else if (lc_format == 0x42) //is this group only, or group and private? { fprintf (stderr, " Group Voice Channel Update - "); diff --git a/src/p25p1_mdpu.c b/src/p25p1_mdpu.c index 804eea2..1ed1588 100644 --- a/src/p25p1_mdpu.c +++ b/src/p25p1_mdpu.c @@ -322,6 +322,9 @@ void processMPDU(dsd_opts * opts, dsd_state * state) } } + //TG hold on P25p1 Ext -- block non-matching target, allow matching group + if (state->tg_hold != 0 && state->tg_hold != group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == group) sprintf (mode, "%s", "A"); //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL; @@ -421,6 +424,9 @@ void processMPDU(dsd_opts * opts, dsd_state * state) } } + //TG hold on P25p1 Ext UU -- may not be ideal/feasible to use these on private calls + // if (state->tg_hold != 0 && state->tg_hold != target) sprintf (mode, "%s", "B"); + // if (state->tg_hold != 0 && state->tg_hold == target) sprintf (mode, "%s", "A"); //Skip tuning private calls if group calls are disabled if (opts->trunk_tune_private_calls == 0) goto SKIPCALL; @@ -539,6 +545,9 @@ void processMPDU(dsd_opts * opts, dsd_state * state) } } + //TG hold on MFID90 GRG -- block non-matching target, allow matching group + if (state->tg_hold != 0 && state->tg_hold != group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == group) sprintf (mode, "%s", "A"); //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL; diff --git a/src/p25p1_tsbk.c b/src/p25p1_tsbk.c index cebc757..4bebea9 100644 --- a/src/p25p1_tsbk.c +++ b/src/p25p1_tsbk.c @@ -214,6 +214,10 @@ void processTSBK(dsd_opts * opts, dsd_state * state) } } + //TG hold on MFID90 GRG -- block non-matching target, allow matching group + if (state->tg_hold != 0 && state->tg_hold != group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == group) sprintf (mode, "%s", "A"); + //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL; @@ -309,6 +313,9 @@ void processTSBK(dsd_opts * opts, dsd_state * state) } } + //TG hold on MFID90 GRG -- block non-matching target, allow matching group + if (state->tg_hold != 0 && state->tg_hold != tempg) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == tempg) sprintf (mode, "%s", "A"); //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL; diff --git a/src/p25p2_vpdu.c b/src/p25p2_vpdu.c index b23fa87..d42bcf0 100644 --- a/src/p25p2_vpdu.c +++ b/src/p25p2_vpdu.c @@ -115,6 +115,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on MFID90 GRG -- block non-matching super group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != sgroup) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == sgroup) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL; @@ -193,6 +201,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on MFID90 GRG -- block non-matching super group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != sgroup) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == sgroup) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL; @@ -305,6 +321,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on MFID90 GRG -- block non-matching super group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != tunable_group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == tunable_group) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //check to see if the group candidate is blocked first if (opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0) && (strcmp(mode, "B") != 0)) //DE is digital encrypted, B is block { @@ -402,6 +426,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on GRP_V -- block non-matching group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == group) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL; @@ -493,6 +525,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on UU_V -- may not want to allow these in case of TG and RID both are same + // if (state->tg_hold != 0 && state->tg_hold != target) sprintf (mode, "%s", "B"); + // if (state->tg_hold != 0 && state->tg_hold == target) + // { + // sprintf (mode, "%s", "A"); + // opts->p25_is_tuned = 0; //unlock tuner + // } + //tune if tuning available if (opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0) && (strcmp(mode, "B") != 0)) { @@ -641,6 +681,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on GRP_V Multi -- block non-matching group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != tunable_group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == tunable_group) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //tune if tuning available if (opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0) && (strcmp(mode, "B") != 0)) { @@ -810,6 +858,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on GRP_V Multi -- block non-matching group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != tunable_group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == tunable_group) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //check to see if the group candidate is blocked first if (opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0) && (strcmp(mode, "B") != 0)) //DE is digital encrypted, B is block { @@ -924,6 +980,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on GRP_V Multi -- block non-matching group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != tunable_group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == tunable_group) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //check to see if the group candidate is blocked first if (opts->p25_trunk == 1 && (strcmp(mode, "DE") != 0) && (strcmp(mode, "B") != 0)) //DE is digital encrypted, B is block { @@ -1024,6 +1088,14 @@ void process_MAC_VPDU(dsd_opts * opts, dsd_state * state, int type, unsigned lon } } + //TG hold on GRP_V Exp -- block non-matching group, allow matching group + if (state->tg_hold != 0 && state->tg_hold != group) sprintf (mode, "%s", "B"); + if (state->tg_hold != 0 && state->tg_hold == group) + { + sprintf (mode, "%s", "A"); + opts->p25_is_tuned = 0; //unlock tuner + } + //Skip tuning group calls if group calls are disabled if (opts->trunk_tune_group_calls == 0) goto SKIPCALL;