From 3671ef1d872887163e95874ee63abff7c181f29a Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 17 May 2018 13:32:37 -0700 Subject: [PATCH] TMXR: Add speed factor validation check and display in SHOW MUX --- sim_tmxr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sim_tmxr.c b/sim_tmxr.c index 9a6ef98f..f1b3c84b 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -2411,7 +2411,7 @@ return SCPE_OK; static int32 _tmln_speed_delta (CONST char *cptr) { -struct { +static struct { const char *bps; int32 delta; } *spd, speeds[] = { @@ -2438,10 +2438,16 @@ struct { {"0", 0}}; /* End of List, last valid value */ int nspeed; char speed[24]; +int nfactor = 1; nspeed = (uint32)strtotv (cptr, &cptr, 10); if ((*cptr != '\0') && (*cptr != '-') && (*cptr != '*')) return -1; +if (*cptr == '*') { + nfactor = (uint32)strtotv (cptr+1, NULL, 10); + if ((nfactor < 1) || (nfactor > 32)) + return -1; + } sprintf (speed, "%d", nspeed); spd = speeds; @@ -3941,6 +3947,10 @@ else { fprintf(st, "*%.0f", lp->rxbpsfactor/TMXR_RX_BPS_UNIT_SCALE); fprintf(st, " bps"); } + else { + if (lp->rxbpsfactor != TMXR_RX_BPS_UNIT_SCALE) + fprintf(st, ", Speed=*%.0f bps", lp->rxbpsfactor/TMXR_RX_BPS_UNIT_SCALE); + } fprintf (st, "\n"); } if ((!lp->sock) && (!lp->connecting) && (!lp->serport) && (!lp->master)) {