Fixed a few more SerialPort connection problems

This commit is contained in:
Jeff Parsons 2016-12-01 16:03:09 -08:00 committed by Jeff Parsons
commit 423ee5df2c
12 changed files with 2100 additions and 2038 deletions

View file

@ -111,7 +111,6 @@ function SerialPort8080(parmsSerial) {
*/
this.fAutoXOFF = true;
this.fAutoStop = false;
this.fNullModem = true;
Component.call(this, "SerialPort", parmsSerial, SerialPort8080, Messages8080.SERIAL);
@ -469,7 +468,7 @@ SerialPort8080.prototype.initBus = function(cmp, bus, cpu, dbg)
};
/**
* initConnection()
* initConnection(fNullModem)
*
* If a machine 'connection' parameter exists of the form "{sourcePort}->{targetMachine}.{targetPort}",
* and "{sourcePort}" matches our idComponent, then look for a component with id "{targetMachine}.{targetPort}".
@ -488,8 +487,9 @@ SerialPort8080.prototype.initBus = function(cmp, bus, cpu, dbg)
* if we've already initialized, no harm done.
*
* @this {SerialPort8080}
* @param {boolean} [fNullModem] (caller's null-modem setting, to ensure our settings are in agreement)
*/
SerialPort8080.prototype.initConnection = function()
SerialPort8080.prototype.initConnection = function(fNullModem)
{
if (!this.connection) {
var sConnection = this.cmp.getMachineParm("connection");
@ -504,10 +504,11 @@ SerialPort8080.prototype.initConnection = function()
var exports = this.connection['exports'];
if (exports) {
var fnConnect = exports['connect'];
if (fnConnect) fnConnect.call(this.connection);
if (fnConnect) fnConnect.call(this.connection, this.fNullModem);
this.sendData = exports['receiveData'];
this.updateStatus = exports['receiveStatus'];
if (this.sendData) {
this.fNullModem = fNullModem;
this.updateStatus = exports['receiveStatus'];
this.status(this.idMachine + '.' + sSourceID + " connected to " + sTargetID);
return;
}
@ -540,7 +541,7 @@ SerialPort8080.prototype.powerUp = function(data, fRepower)
* may be not fully resolved until the target machine performs its own initConnection(), which will
* in turn invoke our initConnection() again.
*/
this.initConnection();
this.initConnection(this.fNullModem);
if (!data || !this.restore) {
this.reset();
@ -900,7 +901,7 @@ SerialPort8080.prototype.outControl = function(port, bOut, addrFrom)
pins |= (bOut & SerialPort8080.UART8251.COMMAND.RTS)? RS232.RTS.MASK : 0;
pins |= (bOut & SerialPort8080.UART8251.COMMAND.DTR)? RS232.DTR.MASK : 0;
}
this.updateStatus(pins);
this.updateStatus.call(this.connection, pins);
}
}
this.bCommand = bOut;