public virtual void setDirection(PORT_NUMBER port, DIRECTION_ALL direction) { lock (this) { string portStr = string.Empty; switch (port) { case PORT_NUMBER.PORTA: portStr = "!A"; break; case PORT_NUMBER.PORTB: portStr = "!B"; break; case PORT_NUMBER.PORTC: portStr = "!C"; break; } if (direction == DIRECTION_ALL.OUTPUT) { m_direction[0] = 0x0; } else { m_direction[0] = 0xFF; } _serialPort.Write(portStr); _serialPort.Write(m_direction, 0, 1); } }
public virtual void setAllDirection(DIRECTION_ALL direction) { lock (this) { string[] strPorts = { "!A", "!B", "!C" }; foreach (string s in strPorts) { _serialPort.Write(s); if (direction == DIRECTION_ALL.OUTPUT) { m_direction[0] = 0x0; } else { m_direction[0] = 0xFF; } _serialPort.Write(m_direction, 0, 1); } } }
public override void setDirection(PORT_NUMBER port, DIRECTION_ALL direction) { }
public override void setAllDirection(DIRECTION_ALL direction) { }