Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
None
-
5.9.1
-
None
Description
Opening serial port with name greater than 9 is causing No such file or directory error. This bug seems to be related to this https://support.microsoft.com/en-us/help/115831/howto-specify-serial-ports-larger-than-com9 .
As per MSDN https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247.aspx#naming_conventions
The "\\.\" prefix will access the Win32 device namespace instead of the Win32 file namespace. This is how access to physical disks and volumes is accomplished directly, without going through the file system, if the API supports this type of access. You can access many devices other than disks this way (using the CreateFileand DefineDosDevice functions, for example).
For example, if you want to open the system's serial communications port 1, you can use "COM1" in the call to the CreateFile function. This works because COM1–COM9 are part of the reserved names in the NT namespace, although using the "\\.\" prefix will also work with these device names. By comparison, if you have a 100 port serial expansion board installed and want to open COM56, you cannot open it using "COM56" because there is no predefined NT namespace for COM56. You will need to open it using "\\.\COM56" because "\\.\" goes directly to the device namespace without attempting to locate a predefined alias.
QSerialPort uses the COM port name directly, which will work for COM port names 1-9 but greater than that the name has to prepend "\\.\" as per documentation.