During 2021 has anything changed in the SerialConection class? I’m not seeing anything obvious in the documentation, but maybe I’m overlooking it.
I had code that worked great on Mac, Windows (and I believe Linux) but now the same code is just generating a 102 error.
I thought it might be that I moved from a physical PC to Parallels on M1, but my customer is experiencing the same issue on multiple physical Windows machines.
The device itself plugs in as a USB device but reports itself as a legacy serial port.
I don’t even know how to start debugging this now, and I don’t have older versions of Xojo to use to validate when it might have changed.
I’m POSITIVE others have had strange issues connecting to serial devices. Any tips and tricks to debug would be HUGELY appreciated.
Edit: Ohp, nope, not this. 102 is a code for connection closed, it’s not always in error. You have to test for this code and ignore it if you were expecting the connection to close.
I’m getting it when I first try to connect.
I will try to ignore it and see if I get past.
Just so strange I didn’t have this happen before.
right you are.
I don’t understand what options could be invalid though.
Alright… I found the issue.
If I have DTR set to true it blows up only on Windows.
If I have DataTerminalReady set to True it works on Mac and Windows.
I thought those were the same thing, but clearly not.
Can anyone explain the distinction?
Is DTR referring to the physical wire, which doesn’t exist if it’s a USB device pretending to be a serial port?
Yeah, the documentation is severely lacking in explanations for these properties. At least with CTS vs ClearToSend you can see that ClearToSend is read-only and is used “to read the state of the ClearToSend line”. I’m guessing that CTS and DTR enable the handshaking lines and ClearToSend and DataTerminalReady can be used to read or set the values of the lines, respectively.
Also, many USB-serial converter do implement CTS and RTS hardware handshaking, so you can’t assume that they are ignored just because you’re using a USB virtual COM port.
1 Like
One is turning DTR on/off for the port, the other is actually changing the state of DTR signal.
1 Like
I guess I’m pretty ignorant about this.