namespace Tinkerforge
{
    public static class ERS232
    {
        public static (char[] Message, byte Length) Read(this BrickletRS232 rs232)
        {
            rs232.Read(out char[] message, out byte length);
            return (message, length);
        }

        public static (byte Baudrate, byte Parity, byte Stopbits, byte Wordlength, byte HardwareFlowcontrol, byte
            SoftwareFlowcontrol) GetConfiguration(this BrickletRS232 rs232)
        {
            rs232.GetConfiguration(out byte baudrate, out byte parity, out byte stopbits, out byte wordlength,
                out byte hardwareFlowcontrol, out byte softwareFlowcontrol);
            return (baudrate, parity, stopbits, wordlength, hardwareFlowcontrol, softwareFlowcontrol);
        }
    }
}
