Perhaps this should be a bug report? Or a feature request?
I am creating a virtual serial port, for a process, and trying to talk to that port with Xojo. This code collects up all ports and fills in a combobox with the names:
For i as Integer = 0 to System.SerialPortCount - 1
portName = System.SerialPort( i ).Name
PortPup.AddRow portName
Next
It does not get any virtual ports. The virtual ports in OSX are named ttys[number] eg ttys001. I have connected to the process using a Terminal window, using the command “screen /dev/ttys001”.
I guess the question is: is a workaround available that would make the virtual ports visible?
I use “screen”, and it works in both directions. In one terminal window, I run the C application. It creates a virtual serial port using Posix library calls. Then it reports the name of the serial device (printf to stderr). Typically this will be /dev/ttys000.
Then in another terminal window, I run “screen /dev/ttys000”. The C application sends some characters and a prompt, and with ‘screen’ I can interact with the command line interface.
So I assume this means no problem at the OS level.
With Xojo, I have been using Serial for interacting with a physical serial device, connecting to another chip which implements this exact same command line interface. This works very well, and I have built a rather involved GUI on top of this.
Using this Xojo GUI, I can select a serial port to interact with. Usually this will be a USB-to-serial convertor, and I have had this working with FTDI and CH340 drivers. In order to connect to the virtual port, I added ttys000 to this list. I open the port, and I see the initial transmission from the C application. So Xojo’s Serial is receiving…DataAvailable is firing. But…the transmissions going from Xojo to the C application are not getting through.
One difference I suppose with a virtual port is that there will be no delay as would be present when data is being physically transmitted (ie there is no baud rate). Though I don’t see why this would be a problem. Otherwise…no idea. I suppose something in the driver?
USB has been no problem at all, for the basic operations. Just this virtual driver doesn’t seem to talk to Xojo, and I cannot think of a reason that the same code would not work with virtual if it works with USB.