in reply to Win32::SerialPort on Win10 issue
We had this a while ago at work. We have a program that needs to work on bith Windows and Linux with serial ports.
On Linux, when you change a setting like the baud rate, it works right away. When using Win32::SerialPort, you also have to call write_settings() to load the updated settings from the Perl module into the Windows kernel (or something like that). The documentation of Win32::SerialPort has this to say under "Initialization":
The primary constructor is new with a PortName (as the Registry knows it) specified. This will create an object, and get the available options and capabilities via the Win32 API. The object is a superset of a Win32API::CommPort object, and supports all of its methods. The port is not yet ready for read/write access. First, the desired parameter settings must be established. Since these are tuning constants for an underlying hardware driver in the Operating System, they are all checked for validity by the methods that set them. The write_settings method writes a new Device Control Block to the driver. The write_settings method will return true if the port is ready for access or undef on failure. Ports are opened for binary transfers. A separate binmode is not needed. The USER must release the object if write_settings does not succeed.
|
|---|