tag:blogger.com,1999:blog-1626185782516232162.post8434867103689382806..comments2024-01-23T15:21:25.389-08:00Comments on Winfred C. H. Lu: Python Print String Descriptors for the USB HID DevicesWinfredhttp://www.blogger.com/profile/15649970719010644298noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-1626185782516232162.post-43074622609857004592022-04-06T21:22:39.898-07:002022-04-06T21:22:39.898-07:00This comment has been removed by a blog administrator.tahirahjaeyhttps://www.blogger.com/profile/07654765377145805977noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-12366307190823419582015-04-17T21:21:30.413-07:002015-04-17T21:21:30.413-07:00Hi Sumit,
No.
The device located at Port_#0005.H...Hi Sumit,<br /><br />No.<br />The device located at Port_#0005.Hub_#0004 is a generic Hub. The USB#ROOT_HUB20#4&116fe3f7 is one Root Hub, which supports USB 2.0 and the string you see is its device Instance Id.<br /><br />The (given) generic Hub could be port #5 of that Root Hub, but we can't be sure according to the limited information. You may run the Windows Device Manager | View | Devices by connections, to view the hierarchic relationship of them.Winfredhttps://www.blogger.com/profile/15649970719010644298noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-55238438422212490722015-04-17T03:55:22.215-07:002015-04-17T03:55:22.215-07:00Hi Winfred,
I want to access the usb using Locati...Hi Winfred,<br /><br />I want to access the usb using Location parameter i.e hub and port.When i open the device manager i can view the below given parameter for my usb device:<br /><br />Device Type: libusb-win32 devices<br />Manufacturer: Insert Manufacturer name <br />Location : Port_#0005.Hub_#0004.<br /><br />Can you please tell me whether the below given output of your code,which contains 4 in the middle is same as Hub,i have mentioned in the location id:<br /><br />USB#ROOT_HUB20#4&116fe3f7&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}<br /><br />Thanks & Regards,<br />Sumit<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-47136471579001654142014-07-25T07:38:34.629-07:002014-07-25T07:38:34.629-07:00Don't be confused, Vita. This script is very s...Don't be confused, Vita. This script is very simple. Please start from print_str_or_hex() function.Winfredhttps://www.blogger.com/profile/15649970719010644298noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-86531112975536631312014-07-24T18:39:03.493-07:002014-07-24T18:39:03.493-07:00Dear Winfred
How can I do this? This is my first ...Dear Winfred <br />How can I do this? This is my first time to use Python, I am so confused.:(Anonymoushttps://www.blogger.com/profile/01154582769476270706noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-51478430755020808862014-07-24T18:36:50.302-07:002014-07-24T18:36:50.302-07:00This comment has been removed by the author.Vitahttps://www.blogger.com/profile/00118567832811866031noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-85689480962665207192014-07-16T06:07:10.096-07:002014-07-16T06:07:10.096-07:00OK. What did you mean by "cannot extract from...OK. What did you mean by "cannot extract from the program"?<br />The maximum length of string representing iManufacturer and iProduct would up to 255, and the script should be able to handle it.<br />Would you print the buffer length returning by get_str_desc()?<br />And also please try to hex dump the buffer instead of just print the strings.Winfredhttps://www.blogger.com/profile/15649970719010644298noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-17732568895419422272014-07-15T19:14:07.514-07:002014-07-15T19:14:07.514-07:00Dear Winfred:
Device Descriptor:
bcdUSB: ...Dear Winfred:<br />Device Descriptor:<br />bcdUSB: 0x0200<br />bDeviceClass: 0xEF<br />bDeviceSubClass: 0x02<br />bDeviceProtocol: 0x01<br />bMaxPacketSize0: 0x40 (64)<br />idVendor: 0x2232<br />idProduct: 0x6001<br />bcdDevice: 0x0002<br />iManufacturer: 0x01<br />0x0409: "XXXXXX00010200144W11111"<br />iProduct: 0x02<br />0x0409: "XXX-XX02"<br />iSerialNumber: 0x00<br />bNumConfigurations: 0x01<br /><br />I can use USBView to get iManufacturer & iProduct numbers of Microsoft, but I cannot extract from the program, because it is too huge. Do you have any suggest?Anonymoushttps://www.blogger.com/profile/01154582769476270706noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-90931323859667303352014-07-15T18:36:51.264-07:002014-07-15T18:36:51.264-07:00Thanks a lot to MagicBlogger for correcting me. :)...Thanks a lot to <a href="https://www.blogger.com/profile/09602823910083417907" rel="nofollow">MagicBlogger</a> for correcting me. :)Winfredhttps://www.blogger.com/profile/15649970719010644298noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-16178123957332453722014-07-15T18:35:11.993-07:002014-07-15T18:35:11.993-07:00Hi Vita,
It is possible that this device doesn...Hi Vita,<br /><br />It is possible that this device doesn't provide any string descriptor. Although the index of the string descriptors should be zero in this case, many devices are seen reporting incorrect index like what you saw. I believe there is not much you can do except to ask for vendor's help to upgrade its firmware.<br /><br />You have a device produced by Silicon Motion according to Vendor ID (0x2232), but i can't be sure what the product (0x6001) it is.Winfredhttps://www.blogger.com/profile/15649970719010644298noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-72595779452937962652014-07-14T21:01:51.591-07:002014-07-14T21:01:51.591-07:00RootHub: USB#ROOT_HUB20#4&2c86c80d&0#{f18a...RootHub: USB#ROOT_HUB20#4&2c86c80d&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}<br />Port2] {36fc9e60-c465-11cf-8056-444553540000}\0009<br />Vendor ID: 0x2232<br />Product ID: 0x6001<br />Device BCD: 0x0002<br />Manufacturer (0x1) -> "ERROR: no String Descriptor for index 1"<br />Product (0x2) -> "ERROR: no String Descriptor for index 2"<br /><br />I cannot get the iManufacturer number and iProduct number, How can I do?Anonymoushttps://www.blogger.com/profile/01154582769476270706noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-24342697174377848802014-07-14T21:00:27.513-07:002014-07-14T21:00:27.513-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/01154582769476270706noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-58505406604853377152014-06-25T00:05:19.875-07:002014-06-25T00:05:19.875-07:00After learning of C99 flexible array, I have found...After learning of C99 flexible array, I have found a problem and solution.<br />For the size of flexible array, "12", which is the size of struct, is not necessary.<br /><br />Error:<br />req = struct.pack('LBBHHH',<br /> conn_idx,<br /> 0,<br /> 0,<br /> (USB_STRING_DESCRIPTOR_TYPE<<8) | str_idx,<br /> win32api.GetSystemDefaultLangID(),<br /> 12+MAXIMUM_USB_STRING_LENGTH)<br /><br />Correct:<br />req = struct.pack('LBBHHH',<br /> conn_idx,<br /> 0,<br /> 0,<br /> (USB_STRING_DESCRIPTOR_TYPE<<8) | str_idx,<br /> win32api.GetSystemDefaultLangID(),<br /> MAXIMUM_USB_STRING_LENGTH)<br />MagicBloggerhttps://www.blogger.com/profile/09602823910083417907noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-13421430380072556672014-06-24T23:44:50.304-07:002014-06-24T23:44:50.304-07:00This comment has been removed by the author.MagicBloggerhttps://www.blogger.com/profile/09602823910083417907noreply@blogger.comtag:blogger.com,1999:blog-1626185782516232162.post-10575933497958195542013-12-07T13:05:05.361-08:002013-12-07T13:05:05.361-08:00I tested-Printing string descriptors with PyWin32 ...I tested-Printing string descriptors with PyWin32 under Windows<br />On WIN8.1: works great.<br />Excellent article. Easy to understand!<br />I searched for many hours until I found this, needing to identify which USB port/jack is being actively used by a device.<br />Summary: "WINFRED LU - FOR THE WIN! "Anonymoushttps://www.blogger.com/profile/11218193251885556053noreply@blogger.com