Added better support for virtual null modem cables on Modem Control multiplexer lines.

If the multiplexer is a modem control one, this change caused connections to be established ONLY if DTR is presented by the simulated system and to always be dropped when DTR is not asserted.
This commit is contained in:
Mark Pizzolato 2013-04-18 12:46:57 -07:00
parent e65ef135d2
commit ba5767520f

View file

@ -955,7 +955,8 @@ lp->ipad = NULL;
if ((lp->destination) && (!lp->serport)) { if ((lp->destination) && (!lp->serport)) {
if (lp->connecting) if (lp->connecting)
sim_close_sock (lp->connecting, 0); sim_close_sock (lp->connecting, 0);
lp->connecting = sim_connect_sock (lp->destination, "localhost", NULL); if ((!lp->mp->modem_control) || (lp->modembits & TMXR_MDM_DTR))
lp->connecting = sim_connect_sock (lp->destination, "localhost", NULL);
} }
tmxr_init_line (lp); /* initialize line state */ tmxr_init_line (lp); /* initialize line state */
/* Revise the unit's connect string to reflect the current attachments */ /* Revise the unit's connect string to reflect the current attachments */
@ -1094,10 +1095,16 @@ if (lp->mp && lp->mp->modem_control) { /* This API ONLY works on mo
if (bits_to_set | bits_to_clear) { /* Anything to do? */ if (bits_to_set | bits_to_clear) { /* Anything to do? */
if (lp->serport) if (lp->serport)
return sim_control_serial (lp->serport, bits_to_set, bits_to_clear, incoming_bits); return sim_control_serial (lp->serport, bits_to_set, bits_to_clear, incoming_bits);
if (lp->sock) { if ((lp->sock) || (lp->connecting)) {
if (bits_to_clear&TMXR_MDM_DTR) /* drop DTR? */ if (bits_to_clear&TMXR_MDM_DTR) /* drop DTR? */
tmxr_reset_ln (lp); tmxr_reset_ln (lp);
} }
else {
if ((lp->destination) && /* Virtual Null Modem Cable */
((bits_to_set ^ before_modem_bits) & /* and DTR being Raised */
TMXR_MDM_DTR))
lp->connecting = sim_connect_sock (lp->destination, "localhost", NULL);
}
} }
return SCPE_OK; return SCPE_OK;
} }