Consider:
Baud rate 19200
RTS on
DTR on
Data bits=8, Stop bits=1, Parity=None
Set chars: Eof=0x00, Error=0x2A, Break=0x2A, Event=0x00, Xon=0x11, Xoff=0x13
Handflow: ControlHandShake=(DTR_CONTROL), FlowReplace=(TRANSMIT_TOGGLE, RTS_CONTROL),
XonLimit=0, XoffLimit=4096
OK, so using a port scanner I've found that a USB device needs these settings to facilitate an import. I can recreate most of these as follows:
port = new SerialPort("COM4");
port.DtrEnable = true;
port.RtsEnable = true;
port.Handshake = Handshake.None;
port.BaudRate = 19200;
port.StopBits = StopBits.One;
port.Parity = Parity.None;
port.DataBits = 8;
port.Open();
byte[] a = new byte[2] { 0x0 , 0x1 };
port.Write(a, 0, 1);
port.Write(a, 0, 1);
port.Write("mem");
port.Write("mem");
string output = port.ReadExisting();
System.Diagnostics.Debug.WriteLine("Found: " + output);
However, the codes produced are these:
Set chars: Eof=0x1A, Error=0x00, Break=0x00, Event=0x1A, Xon=0x11, Xoff=0x13
XonLimit=1024, XoffLimit=1024
How do I change the X limits, and each of the character codes so that this has a chance of working?
The post SerialPort 0x1A character reading problem is the closest thing I've found so far, but I don't understand it.