diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2014-06-10 17:49:02 +0400 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2014-06-30 09:06:15 +0200 |
commit | b3df3e8deaed821b101aef2c2367326107a6254a (patch) | |
tree | 3b35927b8b00884fcbae6ea68cf7bc9edc7180d7 /examples | |
parent | aee836176ff4bf60f6823a9defccee7f49b92a5b (diff) | |
download | qtserialport-b3df3e8deaed821b101aef2c2367326107a6254a.tar.gz |
Improve the serial number handling on Windows
The standard USB CDC driver (usbser.sys) does not add information of
serial number to the device instance identifier of the child devices
(serial ports), so our algorithm returns an empty string.
But information about a serial number is stored in the device identifier
of the parental node. Thus, it is necessary to get this parent
identifier, using these recommendations from MSDN:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff549417%28v=vs.85%29.aspx
For this purpose is used the set of new functions from the
"Configuration Manager Functions" family.
Therefore it was necessary:
* Rewrite the deviceInstanceIdentifier() function.
Now this function accepts one DEVINST parameter and returns the
corresponding device instance identifier string.
* Add the new parentDeviceInstanceNumber() function.
This function accepts a DEVINST of the child device and returns a
DEVINST of the parent device.
Thus, the new algorithm tries to extract a serial number from the
current (child) device and in case it is empty, try to extract from
the parent.
Tested on Windows 7/8 with the Segger JLink device (provides the CDC
serial port) using Qt4 (MSVC2010) and then Qt5 (MSVC2012, MinGW).
Also are checked other devices for possible regressions:
* on-board serial port
* com0com virtual serial port
* USB FTDI serial port
no regressions found.
Change-Id: Ic6afc258f45aa374ec77dc0b586d479b5286359f
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions