TMXR: Add speed factor validation check and display in SHOW MUX
This commit is contained in:
parent
d7f1942998
commit
3671ef1d87
1 changed files with 11 additions and 1 deletions
12
sim_tmxr.c
12
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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue