Skip to content

Commit

Permalink
app_rpt: Channel initialization for PTT
Browse files Browse the repository at this point in the history
app_rpt is not waiting long enough in rpt_setup_channels for chan_simpleusb to
initialize the usb device before asserting PTT on/off.

This change adds a 250ms delay before asserting PTT on and another 50ms delay
before asserting PTT off.

I believe the intention of the original code was to insure that the PTT was
toggled immediately after the channel driver was created by app_rpt.

Testing by the effected users is needed. This may close #421 and #424.
  • Loading branch information
KB4MDD committed Nov 16, 2024
1 parent 26f0bd1 commit 264824f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/app_rpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2695,8 +2695,12 @@ static int rpt_setup_channels(struct rpt *myrpt, struct ast_format_cap *cap)
myrpt->txchannel = myrpt->rxchannel;
myrpt->dahditxchannel = IS_DAHDI_CHAN_NAME(myrpt->rxchanname) && !IS_PSEUDO_NAME(myrpt->rxchanname) ? myrpt->txchannel : NULL;
}
/* If the TX channel is not a pseudo channel, toggle the PTT line */
if (!IS_PSEUDO(myrpt->txchannel)) {
/* Wait for the driver to finish initialization */
usleep(250000);
ast_indicate(myrpt->txchannel, AST_CONTROL_RADIO_KEY);
usleep(50000);
ast_indicate(myrpt->txchannel, AST_CONTROL_RADIO_UNKEY);
}

Expand Down

0 comments on commit 264824f

Please sign in to comment.