Skip to content

Commit

Permalink
chan_simpleusb / chan_usbradio: Modify cos operation (#356)
Browse files Browse the repository at this point in the history
chan_simpleusb and chan_usbradio should not activate the receiver
when the carrierfrom and ctcssfrom are set to no.

This closes #329.
  • Loading branch information
KB4MDD committed Jul 16, 2024
1 parent 82b503b commit 02e0718
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions channels/chan_simpleusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,13 @@ static struct ast_frame *simpleusb_read(struct ast_channel *c)
sd = 1;
}
o->rx_ctcss_active = sd;

/* Special case where cd and sd have been configured for no */
if (o->rxcdtype == CD_IGNORE && o->rxsdtype == SD_IGNORE) {
cd = 0;
sd = 0;
}

/* Timer for how long TX has been unkeyed - used with txoffdelay */
if (o->txoffdelay) {
if (o->txkeyed == 1) {
Expand Down
9 changes: 9 additions & 0 deletions channels/chan_usbradio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,13 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
sd = 1;
}
o->rx_ctcss_active = sd;

/* Special case where cd and sd have been configured for no */
if (o->rxcdtype == CD_IGNORE && o->rxsdtype == SD_IGNORE) {
cd = 0;
sd = 0;
}

/* Timer for how long TX has been unkeyed - used with txoffdelay */
if (o->txoffdelay) {
if (o->txkeyed == 1) {
Expand All @@ -2246,6 +2253,8 @@ static struct ast_frame *usbradio_read(struct ast_channel *c)
}
}
}

/* Check conditions and set receiver active */
if (cd && sd) {
//if(!o->rxkeyed)o->pmrChan->dd.b.doitnow=1;
if (o->rxkeyed || ((o->txoffcnt >= o->txoffdelay) && (o->rxoncnt >= o->rxondelay))) {
Expand Down

0 comments on commit 02e0718

Please sign in to comment.