SerialDevice.At(i).Name -- opens the port

I have an application where a comport is used for PTT (push to talk).
I iterate the list serial devices to build a list of the names like this:

For i As Integer = 0 To SerialDevice.LastIndex
  mydevs.Add( SerialDevice.At(i).Name.ToText )
Next

The problem is that when I get the name for the port which is doing PTT, the SerialDevice call opens the port and thus puts the device into transmit mode (PTT asserted).

Is it expected behavior that SerialDevice is doing an open? Is there a way to get the names without causing an open?
thanks
-jim

In case you don’t get a useful answer, it’s fairly possible there’s no workaround available at this time and you should create an Issue to report this as a bug so Xojo may fix it.
(sorry, I don’t use the serial device class myself; just wanted to write a “default” answer).

This is not expected behavior, and I haven’t observed this behavior with any serial devices I have used (and I have used a lot of different ones). Do you see the same behavior when you try another Xojo app that does serial communication? For example, CoolTerm is written in Xojo, and it enumerates all the ports at startup to create a list of all the names of available ports, basically the same way you are doing. See if it puts your device into transmit mode when the app starts. If it does, then this definitely smells like a bug. The next step would then be to try any other serial terminal to see if you can observe the same behavior.

Also, the “.ToText” should not be needed since SerialDevice.At(i).Name already returns a string.

Arnaud & Roger - Thank you.
CoolTerm looks pretty slick;
CoolTerm DOES put the device into xmit mode when its doing its scan…
Other pgms like secureCrt or device manager does not put the device into xmitting when looking for ports.
I’ll go file a bug.
-jim

3 Likes

That seems to be the best course of action at this point. Make sure you include as much information about device as possible since this issue seems to specifically affect your device. So, it might be the combination of the Xojo serial API, your device, and the driver for your device that causes this issue.

Do you know if an updated driver is available for your device? Also, do you see this behavior across different platforms (Windows, macOS, etc)?