Example #1
0
 public void CorrectParityDecode()
 {
     Assert.Equal(0, CharacterFramingCommand.ParityDecode(System.IO.Ports.Parity.Odd));
     Assert.Equal(1, CharacterFramingCommand.ParityDecode(System.IO.Ports.Parity.Even));
     Assert.Equal(2, CharacterFramingCommand.ParityDecode(System.IO.Ports.Parity.Mark));
     Assert.Equal(3, CharacterFramingCommand.ParityDecode(System.IO.Ports.Parity.Space));
     Assert.Equal(4, CharacterFramingCommand.ParityDecode(System.IO.Ports.Parity.None));
 }
        public override string WriteCommand()
        {
            ushort zBits;
            ushort zParity;

            zBits   = CharacterFramingCommand.StopBitsDecode(UARTDataBits, UARTParity, UARTStopBits);
            zParity = CharacterFramingCommand.ParityDecode(UARTParity);

            return(String.Format("AT+{0}={1},{2},{3},{4},{5},{6}", CommandPrefix, UARTBaudRate, zBits, zParity, FlowControlCommand.DecodeValue(RTSSignalEnabled), FlowControlCommand.DecodeValue(CTSSignalEnabled), UARTReadTimerInterval));
        }
        public virtual string WriteCommand()
        {
            ushort zBits;
            ushort zParity;

            zBits   = CharacterFramingCommand.StopBitsDecode(UARTDataBits, UARTParity, UARTStopBits);
            zParity = CharacterFramingCommand.ParityDecode(UARTParity);

            return(String.Format("AT+{0}={1},{2},{3},{4}", CommandPrefix, UARTBaudRate, zBits, zParity, UARTReadTimerInterval));
        }