Skip to content

Commit

Permalink
chan_usrp: Add TX/RX debug messages (#413)
Browse files Browse the repository at this point in the history
* chan_usrp:  Add TX/RX debug messages

This updates chan_usrp to have debug message for TX and RX on and off. The messages closely match those in chan_simpleusb and chan_usbradio. This indication is needed to help users troubleshoot problems when using this driver.

I also added a queue overflow warning message should the internal queue overflow.  This should never happen, but if it does, it needs to be reported.

* chan_usrp: Add TX/RX debug messages

Changed the queue overflow to show the actual threshold.
  • Loading branch information
KB4MDD authored Oct 26, 2024
1 parent e728383 commit 90dadaa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions channels/chan_usrp.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ static int usrp_indicate(struct ast_channel *ast, int cond, const void *data, si
switch (cond) {
case AST_CONTROL_RADIO_KEY:
p->txkey = 1;
ast_debug(1, "Channel %s: ACRK TX ON.\n", ast_channel_name(ast));
break;
case AST_CONTROL_RADIO_UNKEY:
p->txkey = 0;
ast_debug(1, "Channel %s: ACRUK TX OFF.\n", ast_channel_name(ast));
break;
case AST_CONTROL_HANGUP:
return -1;
Expand Down Expand Up @@ -593,6 +595,7 @@ static int usrp_xwrite(struct ast_channel *ast, struct ast_frame *frame)
remque((struct qelem *) qp);
ast_free(qp);
}
ast_log(LOG_WARNING, "Channel %s: Receive queue exceeds the threshold of %lu\n", ast_channel_name(ast), USRP_VOICE_FRAME_SIZE);
if (pvt->rxkey) {
pvt->rxkey = 1;
}
Expand All @@ -610,6 +613,7 @@ static int usrp_xwrite(struct ast_channel *ast, struct ast_frame *frame)
fr.delivery.tv_sec = 0;
fr.delivery.tv_usec = 0;
ast_queue_frame(ast, &fr);
ast_debug(1, "Channel %s: RX ON\n", ast_channel_name(ast));
}
pvt->rxkey = MAX_RXKEY_TIME;
qp = pvt->rxq.qe_forw;
Expand Down Expand Up @@ -662,6 +666,7 @@ static int usrp_xwrite(struct ast_channel *ast, struct ast_frame *frame)
fr.delivery.tv_sec = 0;
fr.delivery.tv_usec = 0;
ast_queue_frame(ast, &fr);
ast_debug(1, "Channel %s: RX OFF\n", ast_channel_name(ast));
}
/* Decrement the receive key counter.
* This ensures that we do not get stuck in receive mode.
Expand Down

0 comments on commit 90dadaa

Please sign in to comment.