Example #1
0
            public void SetStandard(string Port, int Baud, CommBase.Handshake Hs)
            {
                dataBits = 8;
                stopBits = CommBase.StopBits.one;
                parity   = CommBase.Parity.none;
                port     = Port;
                baudRate = Baud;
                switch (Hs)
                {
                case CommBase.Handshake.none:
                    txFlowCTS    = false;
                    txFlowDSR    = false;
                    txFlowX      = false;
                    rxFlowX      = false;
                    useRTS       = CommBase.HSOutput.online;
                    useDTR       = CommBase.HSOutput.online;
                    txWhenRxXoff = true;
                    rxGateDSR    = false;
                    break;

                case CommBase.Handshake.XonXoff:
                    txFlowCTS    = false;
                    txFlowDSR    = false;
                    txFlowX      = true;
                    rxFlowX      = true;
                    useRTS       = CommBase.HSOutput.online;
                    useDTR       = CommBase.HSOutput.online;
                    txWhenRxXoff = true;
                    rxGateDSR    = false;
                    XonChar      = CommBase.ASCII.DC1;
                    XoffChar     = CommBase.ASCII.DC3;
                    break;

                case CommBase.Handshake.CtsRts:
                    txFlowCTS    = true;
                    txFlowDSR    = false;
                    txFlowX      = false;
                    rxFlowX      = false;
                    useRTS       = CommBase.HSOutput.handshake;
                    useDTR       = CommBase.HSOutput.online;
                    txWhenRxXoff = true;
                    rxGateDSR    = false;
                    break;

                case CommBase.Handshake.DsrDtr:
                    txFlowCTS    = false;
                    txFlowDSR    = true;
                    txFlowX      = false;
                    rxFlowX      = false;
                    useRTS       = CommBase.HSOutput.online;
                    useDTR       = CommBase.HSOutput.handshake;
                    txWhenRxXoff = true;
                    rxGateDSR    = false;
                    break;
                }
            }
Example #2
0
            public void SetStandard(string port, int baudrate, CommBase.Handshake handshake)
            {
                DataBits = 8;
                StopBits = CommBase.StopBits.One;
                Parity   = CommBase.Parity.None;
                Port     = port;
                BaudRate = baudrate;
                switch (handshake)
                {
                case CommBase.Handshake.None:
                    TxFlowCTS    = false;
                    TxFlowDSR    = false;
                    TxFlowX      = false;
                    RxFlowX      = false;
                    UseRTS       = CommBase.HSOutput.Online;
                    UseDTR       = CommBase.HSOutput.Online;
                    TxWhenRxXoff = true;
                    RxGateDSR    = false;
                    break;

                case CommBase.Handshake.XonXoff:
                    TxFlowCTS    = false;
                    TxFlowDSR    = false;
                    TxFlowX      = true;
                    RxFlowX      = true;
                    UseRTS       = CommBase.HSOutput.Online;
                    UseDTR       = CommBase.HSOutput.Online;
                    TxWhenRxXoff = true;
                    RxGateDSR    = false;
                    XonChar      = CommBase.ASCII.DC1;
                    XoffChar     = CommBase.ASCII.DC3;
                    break;

                case CommBase.Handshake.CtsRts:
                    TxFlowCTS    = true;
                    TxFlowDSR    = false;
                    TxFlowX      = false;
                    RxFlowX      = false;
                    UseRTS       = CommBase.HSOutput.Handshake;
                    UseDTR       = CommBase.HSOutput.Online;
                    TxWhenRxXoff = true;
                    RxGateDSR    = false;
                    break;

                case CommBase.Handshake.DsrDtr:
                    TxFlowCTS    = false;
                    TxFlowDSR    = true;
                    TxFlowX      = false;
                    RxFlowX      = false;
                    UseRTS       = CommBase.HSOutput.Online;
                    UseDTR       = CommBase.HSOutput.Handshake;
                    TxWhenRxXoff = true;
                    RxGateDSR    = false;
                    break;
                }
            }
Example #3
0
            public void SetStandard(string Port, uint Baud, CommBase.Handshake Hs)
            {
                this.dataBits = 8;
                this.stopBits = CommBase.StopBits.one;
                this.parity   = CommBase.Parity.none;
                this.port     = Port;
                this.baudRate = Baud;
                CommBase.Handshake hs = Hs;
                switch (hs)
                {
                case CommBase.Handshake.none:
                {
                    this.txFlowCTS    = false;
                    this.txFlowDSR    = false;
                    this.txFlowX      = false;
                    this.rxFlowX      = false;
                    this.useRTS       = CommBase.HSOutput.online;
                    this.useDTR       = CommBase.HSOutput.online;
                    this.txWhenRxXoff = true;
                    this.rxGateDSR    = false;
                    return;
                }

                case CommBase.Handshake.XonXoff:
                {
                    this.txFlowCTS    = false;
                    this.txFlowDSR    = false;
                    this.txFlowX      = true;
                    this.rxFlowX      = true;
                    this.useRTS       = CommBase.HSOutput.online;
                    this.useDTR       = CommBase.HSOutput.online;
                    this.txWhenRxXoff = true;
                    this.rxGateDSR    = false;
                    this.XonChar      = CommBase.ASCII.DC1;
                    this.XoffChar     = CommBase.ASCII.DC3;
                    return;
                }

                case CommBase.Handshake.CtsRts:
                {
                    this.txFlowCTS    = true;
                    this.txFlowDSR    = false;
                    this.txFlowX      = false;
                    this.rxFlowX      = false;
                    this.useRTS       = CommBase.HSOutput.handshake;
                    this.useDTR       = CommBase.HSOutput.online;
                    this.txWhenRxXoff = true;
                    this.rxGateDSR    = false;
                    return;
                }

                case CommBase.Handshake.DsrDtr:
                {
                    this.txFlowCTS    = false;
                    this.txFlowDSR    = true;
                    this.txFlowX      = false;
                    this.rxFlowX      = false;
                    this.useRTS       = CommBase.HSOutput.online;
                    this.useDTR       = CommBase.HSOutput.handshake;
                    this.txWhenRxXoff = true;
                    this.rxGateDSR    = false;
                    return;
                }

                default:
                {
                    return;
                }
                }
            }
Example #4
0
 public void SetStandard(string Port, int Baud, CommBase.Handshake Hs)
 {
     dataBits = 8;
     stopBits = CommBase.StopBits.one;
     parity = CommBase.Parity.none;
     port = Port;
     baudRate = Baud;
     switch (Hs)
     {
         case CommBase.Handshake.none:
             txFlowCTS = false;
             txFlowDSR = false;
             txFlowX = false;
             rxFlowX = false;
             useRTS = CommBase.HSOutput.online;
             useDTR = CommBase.HSOutput.online;
             txWhenRxXoff = true;
             rxGateDSR = false;
             break;
         case CommBase.Handshake.XonXoff:
             txFlowCTS = false;
             txFlowDSR = false;
             txFlowX = true;
             rxFlowX = true;
             useRTS = CommBase.HSOutput.online;
             useDTR = CommBase.HSOutput.online;
             txWhenRxXoff = true;
             rxGateDSR = false;
             XonChar = CommBase.ASCII.DC1;
             XoffChar = CommBase.ASCII.DC3;
             break;
         case CommBase.Handshake.CtsRts:
             txFlowCTS = true;
             txFlowDSR = false;
             txFlowX = false;
             rxFlowX = false;
             useRTS = CommBase.HSOutput.handshake;
             useDTR = CommBase.HSOutput.online;
             txWhenRxXoff = true;
             rxGateDSR = false;
             break;
         case CommBase.Handshake.DsrDtr:
             txFlowCTS = false;
             txFlowDSR = true;
             txFlowX = false;
             rxFlowX = false;
             useRTS = CommBase.HSOutput.online;
             useDTR = CommBase.HSOutput.handshake;
             txWhenRxXoff = true;
             rxGateDSR = false;
             break;
     }
 }