diff --git a/src/uiGlobals.py b/src/uiGlobals.py index 8dafc90..dc63aab 100644 --- a/src/uiGlobals.py +++ b/src/uiGlobals.py @@ -19,7 +19,7 @@ # GLOBAL VARIABLES ############################################################################## APP_NAME = "Cricket" -APP_VERSION = "4.3.1" +APP_VERSION = "4.4.0" # StatusBar ID SB_PORT_ID = 0 diff --git a/src/updateDialog.py b/src/updateDialog.py index 70fcc76..c3792c2 100644 --- a/src/updateDialog.py +++ b/src/updateDialog.py @@ -99,8 +99,8 @@ def ClickOk(self, e): Note: The method also destroys the parent window after opening the web browser. """ - # webbrowser.open("https://github.com/mcci-usb/COLLECTION-cricket-ui/releases/tag/"+self.latest_version) - webbrowser.open(None+self.latest_version) + webbrowser.open("https://github.com/mcci-usb/COLLECTION-cricket-ui/releases/tag/"+self.latest_version) + # webbrowser.open(None+self.latest_version) self.parent.Destroy() diff --git a/src/usb3tree/linuxusb3parse.py b/src/usb3tree/linuxusb3parse.py index 3c9eb64..74b2ba0 100644 --- a/src/usb3tree/linuxusb3parse.py +++ b/src/usb3tree/linuxusb3parse.py @@ -1,10 +1,9 @@ - ############################################################################## # -# Module: linuxusb3parse.py +# Module: LinuxUsb3TreeParse.py # # Description: -# parsing the USB3 Tree view data in Linux +# parsing the USB4 Tree view data in Windows # # Author: # Vinay N, MCCI Corporation Mar 2024 @@ -13,44 +12,17 @@ # V4.3.1 Mon Apr 15 2024 17:00:00 Seenivasan V # Module created ############################################################################## -class LinuxUsb4TreeParse(): +class LinuxUsb3TreeParse(): def __init__(self): self.idata = None self.ldata = None def parse_usb3tb_data(self, usb3data): - """ - Parse USB3 data and organize it into internal data structures. - - This method takes USB3 data and organizes it into internal data structures - for easier access and manipulation. - - Args: - usb4data (dict): USB4TB data to be parsed. - - Returns: - None - """ self.idata = self.get_item_data(usb3data) self.ldata = self.get_level_data(self.idata) - # if self.idata is not None: - # self.ldata = self.get_level_data(self.idata) - # else: - # print("Error: idata is None") def get_item_data(self, msg): - """ - Parse USB 3.0 data from a list of dictionaries containing USB device information. - - Args: - msg (list): A list of dictionaries containing USB device information. - Returns: - dict: A dictionary containing parsed USB 3.0 data with keys formatted as 'vid,pid,bus,speed'. - Each value is a dictionary containing details such as type, vid, pid, bus, speed, ifc, - and optionally mport and port if available. - None: If the input 'msg' is not a list or if there are missing required fields in any item. - """ if not isinstance(msg, list): print("Error: usb3data is not a list") return None @@ -65,9 +37,13 @@ def get_item_data(self, msg): ifc = item.get('ifc') mport = item.get('mport') port = item.get('port') - - if vid is not None and pid is not None and bus is not None and speed is not None and ifc is not None: - key = f"{vid},{pid},{bus},{speed}" + + # if vid is not None and pid is not None and bus is not None and speed is not None and ifc is not None: + if bus is not None and speed is not None and ifc is not None: + # key = f"{vid},{pid},{bus},{speed}" + # key = f"{vid},{pid}" + key = f"{mport}" + parsed_item = { 'type': 'usb3', 'vid': vid, @@ -84,22 +60,16 @@ def get_item_data(self, msg): print("Error: Missing required fields in item") else: print("Error: Item is not a dictionary") - + + # parsed_usb3 = { + # '7': {'type': 'usb3', 'vid': '5967', 'pid': '9317', 'bus': '1', 'speed': 3, 'ifc': [14, 14, 254], 'mport': '(7,)', 'port': '7'}, + # '(10,)': {'type': 'usb3', 'vid': '32903', 'pid': '38', 'bus': '1', 'speed': 2, 'ifc': [224, 224], 'mport': '(10,)', 'port': '10'}, + # '(9, 4)': {'type': 'usb3', 'vid': '1118', 'pid': '1606', 'bus': '1', 'speed': 2, 'ifc': [2, 10], 'mport': '(9, 4)', 'port': '4'}, + # '(9, 1)': {'type': 'usb3', 'vid': '1121', 'pid': '20052', 'bus': '1', 'speed': 1, 'ifc': [3], 'mport': '(9, 1)', 'port': '1'}, + # '(6,)': {'type': 'usb3', 'vid': '1267', 'pid': '3147', 'bus': '1', 'speed': 2, 'ifc': [255], 'mport': '(6,)', 'port': '6'}} return parsed_usb3 def get_level_data(self, u3tbuf): - """ - Organize USB 3.0 data into levels based on the count of comma-separated keys. - - Args: - u3tbuf (dict): A dictionary containing USB 3.0 data where keys are formatted as 'vid,pid,bus,speed'. - - Returns: - dict: A dictionary organizing USB 3.0 data into levels based on the count of comma-separated keys. - Keys are formatted as 'levelX' where X is the count of commas in the keys of u3tbuf. - Values are lists containing keys from u3tbuf that match the respective level. - None: If the input 'u3tbuf' is not a dictionary. - """ if not isinstance(u3tbuf, dict): print("Error: u3tbuf is not a dictionary") return None diff --git a/src/usb3tree/macusb3parse.py b/src/usb3tree/macusb3parse.py new file mode 100644 index 0000000..9574001 --- /dev/null +++ b/src/usb3tree/macusb3parse.py @@ -0,0 +1,86 @@ +############################################################################## +# +# Module: MacUsb3TreeParse.py +# +# Description: +# parsing the USB4 Tree view data in Windows +# +# Author: +# Vinay N, MCCI Corporation Mar 2024 +# +# Revision history: +# V4.3.1 Mon Apr 15 2024 17:00:00 Seenivasan V +# Module created +############################################################################## +class MacUsb3TreeParse(): + def __init__(self): + self.idata = None + self.ldata = None + + def parse_usb3tb_data(self, usb3data): + self.idata = self.get_item_data(usb3data) + self.ldata = self.get_level_data(self.idata) + + def get_item_data(self, msg): + + if not isinstance(msg, list): + print("Error: usb3data is not a list") + return None + + parsed_usb3 = {} + for item in msg: + if isinstance(item, dict): + vid = item.get('vid') + pid = item.get('pid') + bus = item.get('bus') + speed = item.get('speed') + ifc = item.get('ifc') + mport = item.get('mport') + port = item.get('port') + + # if vid is not None and pid is not None and bus is not None and speed is not None and ifc is not None: + if bus is not None and speed is not None and ifc is not None: + # key = f"{vid},{pid},{bus},{speed}" + # key = f"{vid},{pid}" + key = f"{mport}" + + parsed_item = { + 'type': 'usb3', + 'vid': vid, + 'pid': pid, + 'bus': bus, + 'speed': speed, + 'ifc': ifc + } + if mport is not None: + parsed_item['mport'] = mport + parsed_item['port'] = port + parsed_usb3[key] = parsed_item + else: + print("Error: Missing required fields in item") + else: + print("Error: Item is not a dictionary") + + # parsed_usb3 = { + # '7': {'type': 'usb3', 'vid': '5967', 'pid': '9317', 'bus': '1', 'speed': 3, 'ifc': [14, 14, 254], 'mport': '(7,)', 'port': '7'}, + # '(10,)': {'type': 'usb3', 'vid': '32903', 'pid': '38', 'bus': '1', 'speed': 2, 'ifc': [224, 224], 'mport': '(10,)', 'port': '10'}, + # '(9, 4)': {'type': 'usb3', 'vid': '1118', 'pid': '1606', 'bus': '1', 'speed': 2, 'ifc': [2, 10], 'mport': '(9, 4)', 'port': '4'}, + # '(9, 1)': {'type': 'usb3', 'vid': '1121', 'pid': '20052', 'bus': '1', 'speed': 1, 'ifc': [3], 'mport': '(9, 1)', 'port': '1'}, + # '(6,)': {'type': 'usb3', 'vid': '1267', 'pid': '3147', 'bus': '1', 'speed': 2, 'ifc': [255], 'mport': '(6,)', 'port': '6'}} + return parsed_usb3 + + def get_level_data(self, u3tbuf): + if not isinstance(u3tbuf, dict): + print("Error: u3tbuf is not a dictionary") + return None + + pdict = {} + for rkitem in u3tbuf.keys(): + lcnt = rkitem.count(',') + kl = list(pdict.keys()) + if 'level'+str(lcnt) in kl: + pdict['level'+str(lcnt)].append(rkitem) + else: + pdict['level'+str(lcnt)] = [rkitem] + return pdict + diff --git a/src/usb3tree/macusb4parse.py b/src/usb3tree/macusb4parse.py deleted file mode 100644 index 6ef6dab..0000000 --- a/src/usb3tree/macusb4parse.py +++ /dev/null @@ -1,127 +0,0 @@ -############################################################################## -# -# Module: Macusb3parse.py -# -# Description: -# parsing the USB3 Tree view data in Mac -# -# Author: -# Vinay N, MCCI Corporation Mar 2024 -# -# Revision history: -# V4.3.1 Mon Apr 15 2024 17:00:00 Seenivasan V -# Module created -############################################################################## -class MacUsb4TreeParse(): - def __init__(self): - self.idata = None - self.ldata = None - - def parse_usb3tb_data(self, usb3data): - """ - Parse USB4TB data and organize it into internal data structures. - - This method takes USB4TB data and organizes it into internal data structures - for easier access and manipulation. - - Args: - usb4data (dict): USB4TB data to be parsed. - - Returns: - None - """ - - self.idata = self.get_item_data(usb3data) - self.ldata = self.get_level_data(self.idata) - # if self.idata is not None: - # self.ldata = self.get_level_data(self.idata) - # else: - # print("Error: idata is None") - - def get_item_data(self, msg): - """ - Parse USB 3.0 data from a list of dictionaries containing USB device information. - - Args: - msg (list): A list of dictionaries containing USB device information. - - Returns: - dict: A dictionary containing parsed USB 3.0 data with keys formatted as 'vid,pid,bus,speed'. - Each value is a dictionary containing details such as type, vid, pid, bus, speed, ifc, - and optionally mport and port if available. - None: If the input 'msg' is not a list or if there are missing required fields in any item. - """ - if not isinstance(msg, list): - print("Error: usb3data is not a list") - return None - - parsed_usb3 = {} - for item in msg: - if isinstance(item, dict): - vid = item.get('vid') - pid = item.get('pid') - bus = item.get('bus') - speed = item.get('speed') - ifc = item.get('ifc') - mport = item.get('mport') - port = item.get('port') - - # print("---- vid", vid) - # print("---- pid", pid) - - if vid is not None and pid is not None and bus is not None and speed is not None and ifc is not None: - key = f"{vid},{pid},{bus},{speed}" - parsed_item = { - 'type': 'usb3', - 'vid': vid, - 'pid': pid, - 'bus': bus, - 'speed': speed, - 'ifc': ifc - } - if mport is not None: - parsed_item['mport'] = mport - parsed_item['port'] = port - parsed_usb3[key] = parsed_item - else: - print("Error: Missing required fields in item") - else: - print("Error: Item is not a dictionary") - - return parsed_usb3 - - def get_level_data(self, u3tbuf): - """ - Organize USB 3.0 data into levels based on the count of comma-separated keys. - - Args: - u3tbuf (dict): A dictionary containing USB 3.0 data where keys are formatted as 'vid,pid,bus,speed'. - - Returns: - dict: A dictionary organizing USB 3.0 data into levels based on the count of comma-separated keys. - Keys are formatted as 'levelX' where X is the count of commas in the keys of u3tbuf. - Values are lists containing keys from u3tbuf that match the respective level. - None: If the input 'u3tbuf' is not a dictionary. - """ - if not isinstance(u3tbuf, dict): - print("Error: u3tbuf is not a dictionary") - return None - - pdict = {} - for rkitem in u3tbuf.keys(): - lcnt = rkitem.count(',') - kl = list(pdict.keys()) - if 'level'+str(lcnt) in kl: - pdict['level'+str(lcnt)].append(rkitem) - else: - pdict['level'+str(lcnt)] = [rkitem] - return pdict - -# # Sample USB3 data -# usb3_data = [{'type': 'usb3', 'vid': '32903', 'pid': '2880', 'bus': '2', 'speed': 5, 'ifc': [9]}, {'type': 'usb3', 'vid': '7516', 'pid': '22529', 'bus': '1', 'speed': 3, 'ifc': [9]}, {'type': 'usb3', 'vid': '5967', 'pid': '9317', 'bus': '1', 'mport': '(7,)', 'port': '7', 'speed': 3, 'ifc': [14, 14, 254]}, {'type': 'usb3', 'vid': '1121', 'pid': '20052', 'bus': '1', 'mport': '(3,)', 'port': '3', 'speed': 1, 'ifc': [3]}, {'type': 'usb3', 'vid': '32903', 'pid': '38', 'bus': '1', 'mport': '(10,)', 'port': '10', 'speed': 2, 'ifc': [224, 224]}, {'type': 'usb3', 'vid': '7825', 'pid': '56897', 'bus': '1', 'mport': '(1, 5)', 'port': '5', 'speed': 2, 'ifc': [17, 255]}, {'type': 'usb3', 'vid': '1118', 'pid': '1606', 'bus': '1', 'mport': '(9,)', 'port': '9', 'speed': 2, 'ifc': [2, 10]}, {'type': 'usb3', 'vid': '1267', 'pid': '3147', 'bus': '1', 'mport': '(6,)', 'port': '6', 'speed': 2, 'ifc': [255]}] - -# # Creating an instance of the parser -# usb_parser = WinUsb3TreeParse() - -# # Parsing USB3 data -# usb_parser.parse_usb3tb_data(usb3_data) diff --git a/src/usb3tree/usb3TreeWindow.py b/src/usb3tree/usb3TreeWindow.py index 7c89705..6437254 100644 --- a/src/usb3tree/usb3TreeWindow.py +++ b/src/usb3tree/usb3TreeWindow.py @@ -20,7 +20,7 @@ from datetime import datetime from usb3tree import usb3parse -MAX_LEVEL = 7 +MAX_LEVEL = 20 usbSpeed = {0: "LowSpeed", 1: "FullSpeed", 2: "HighSpeed", 3: "SuperSpeed", 4:"SuperSpeed Plus",5:"SuperSpeed Plus"} usbClass = { @@ -46,11 +46,6 @@ # Utilities ############################################################################## class Usb3TreeWindow(wx.Window): - """ - A class logWindow with init method - - To show the all actions while handling ports of devices - """ def __init__(self, parent, top): @@ -79,79 +74,82 @@ def __init__(self, parent, top): # Create USB3 parser instance mythcos = sys.platform self.usb3parse = usb3parse.create_usb3tb_parser(mythcos) - # print("usb3parse--->", self.usb3parse) - # Set size of frame self.SetSizer(self.vbox) self.vbox.Fit(self) self.Layout() def update_usb3_tree(self, usb3data): - """ - Update the USB list based on List - """ self.usb3parse.parse_usb3tb_data(usb3data) - - # Redraw the USB3 Tree View with the new data self.redraw_usb3_tree(self.usb3parse.idata, self.usb3parse.ldata) + + def delete_all_items(self): + root = self.tree.GetRootItem() + if root.IsOk(): + self.tree.DeleteChildren(root) + + def OnItemSelect(self, event): + # Define OnItemSelect method here + item = event.GetItem() + text = self.tree.GetItemText(item) def redraw_usb3_tree(self, idata, ldata): - """ - Redrraw the Tree view N Levels of USB4 and Thunderbolt - """ self.delete_all_items() lkeys = list(ldata.keys()) - if 'level0' in lkeys: # Check for USB3 devices under the correct key - self.draw_level0_data(idata, ldata['level0']) # Call draw_level0_data with USB3 devices - elif 'level1' in lkeys: # Check for USB3 devices under the correct key - self.draw_level0_data(idata, ldata['level1']) - elif 'level2' in lkeys: # Check for USB3 devices under the correct key - self.draw_level0_data(idata, ldata['level2']) - elif 'level3' in lkeys: # Check for USB3 devices under the correct key - self.draw_level0_data(idata, ldata['level3']) - elif 'level4' in lkeys: # Check for USB3 devices under the correct key - self.draw_level0_data(idata, ldata['level4']) + if 'level1' in lkeys: # Check for USB3 devices under the correct key + lobjdict = self.draw_level0_data(idata, ldata['level1']) # Call draw_level0_data with USB3 devices + for level in range(2, MAX_LEVEL): + if 'level'+str(level) in lkeys: + lobjdict = self.draw_leveln_data(idata, ldata['level'+str(level)], lobjdict, level) else: print("No USB3 devices found in ldata") - - def OnItemSelect(self, event): - # Define OnItemSelect method here - item = event.GetItem() - text = self.tree.GetItemText(item) def draw_level0_data(self, ddict, dlist): + parsed_data = [] + for key, info in ddict.items(): + vid = hex(int(info.get('vid'))) + pid = hex(int(info.get('pid'))) + speed = usbSpeed.get(info["speed"] - 1, "unknown") + mport = info.get('mport', '') + parsed_data.append((vid, pid, speed, mport)) + + for key, info in ddict.items(): + vid = hex(int(info.get('vid'))) + pid = hex(int(info.get('pid'))) + speed = usbSpeed.get(info["speed"] - 1, "unknown") + mport = info.get('mport', '') + + node_text = f"VID:{vid}, PID:{pid}, Speed:{speed}" + ports = [port.strip() for port in mport.strip('()').split(',') if port.strip()] + node_text = f"VID:{vid}, PID:{pid}, Speed:{speed}" + + parent = self.tree.GetRootItem() # Assuming self.tree is your TreeCtrl instance + for port in ports: + item, cookie = self.tree.GetFirstChild(parent) + found = False + while item.IsOk(): + text = self.tree.GetItemText(item) + if text.startswith(f"Port: {port}"): + parent = item + found = True + break + item, cookie = self.tree.GetNextChild(parent, cookie) + if not found: + # parent = self.tree.AppendItem(parent, f"Port: {port}") + parent = self.tree.AppendItem(parent, f"Port: {port} {node_text}") + return parent + + def draw_leveln_data(self, ddict, dlist, riobj, lidx): + objlist = list(riobj.keys()) for item in dlist: - vid = hex(int(ddict[item]['vid'])) # Convert VID to hexadecimal - pid = hex(int(ddict[item]['pid'])) # Convert PID to hexadecimal - speed = usbSpeed.get(ddict[item]['speed'], "Unknown") # Get speed from usbSpeed dictionary - ifc = ddict[item]['ifc'] # Get the interface code(s) - class_name = "Unknown" # Default USB class name - port_no = ddict[item].get('port', 'Unknown') # Get port number or default to 'Unknown' if not present - # Iterate over interface codes to find the USB class - for ifc_code in ifc: - if ifc_code in usbClass: - class_name = usbClass[ifc_code] - break # Stop searching if USB class is found - node_text = f"[port {port_no}] {class_name} (VID: {vid}, PID: {pid}, Speed: {speed})" - hub_node = self.tree.AppendItem(self.root, node_text) # Add hub node - # Check if the device is a hub and has ports - if 'ports' in ddict[item]: - for port in ddict[item]['ports']: - port_no = port.get('port', 'Unknown') # Get port number or default to 'Unknown' if not present - port_vid = hex(int(port['vid'])) - port_pid = hex(int(port['pid'])) - port_speed = usbSpeed.get(port['speed'], "Unknown") - port_text = f"[port {port_no}] {class_name} (VID: {port_vid}, PID: {port_pid}, Speed: {port_speed})" - self.tree.AppendItem(hub_node, port_text) # Add port node as child of the hub - - def draw_leveln_data(self, ddict, dlist, lidx): - for item in dlist: - cidx = item.split(',')[lidx] - vid = ddict[item]['vid'] - pid = ddict[item]['pid'] - node_text = f"{item} (VID: {vid}, PID: {pid})" - parent_item = self.get_parent_item(self.root, item, lidx) - self.tree.AppendItem(parent_item, node_text) + if item in objlist: + cidx = item.split(',')[lidx] + vid = ddict[item]['vid'] + pid = ddict[item]['pid'] + node_text = f"{item} (VID: {vid}, PID: {pid})" + parent_item = self.get_parent_item(self.root, item, lidx) + self.tree.AppendItem(parent_item, node_text) + return riobj def get_parent_item(self, parent, item, level): if level == 0: @@ -163,9 +161,4 @@ def get_parent_item(self, parent, item, level): if self.tree.GetItemText(children).split(',')[level-1] == parent_text: return children children, cookie = self.tree.GetNextChild(parent, cookie) - return self.get_parent_item(parent, item, level-1) - - def delete_all_items(self): - root = self.tree.GetRootItem() - if root.IsOk(): - self.tree.DeleteChildren(root) + return self.get_parent_item(parent, item, level-1) \ No newline at end of file diff --git a/src/usb3tree/usb3parse.py b/src/usb3tree/usb3parse.py index 43e0456..849b8f3 100644 --- a/src/usb3tree/usb3parse.py +++ b/src/usb3tree/usb3parse.py @@ -44,9 +44,9 @@ def create_usb3tb_parser(mythos): if mythos == 'win32': from .winusb3parse import WinUsb3TreeParse as OS_USB4TBParser elif mythos == 'linux': - from .linuxusb3parse import LinuxUsb4TreeParse as OS_USB4TBParser + from .linuxusb3parse import LinuxUsb3TreeParse as OS_USB4TBParser elif mythos == 'darwin': - from .macusb4parse import MacUsb4TreeParse as OS_USB4TBParser + from .macusb3parse import MacUsb3TreeParse as OS_USB4TBParser else: raise NotImplementedError(f"Platform '{sys.platform}' not supported") diff --git a/src/usb3tree/winusb3parse.py b/src/usb3tree/winusb3parse.py index af8a50f..5f82331 100644 --- a/src/usb3tree/winusb3parse.py +++ b/src/usb3tree/winusb3parse.py @@ -20,10 +20,6 @@ def __init__(self): def parse_usb3tb_data(self, usb3data): self.idata = self.get_item_data(usb3data) self.ldata = self.get_level_data(self.idata) - # if self.idata is not None: - # self.ldata = self.get_level_data(self.idata) - # else: - # print("Error: idata is None") def get_item_data(self, msg): @@ -42,11 +38,12 @@ def get_item_data(self, msg): mport = item.get('mport') port = item.get('port') - # print("---- vid", vid) - # print("---- pid", pid) - - if vid is not None and pid is not None and bus is not None and speed is not None and ifc is not None: - key = f"{vid},{pid},{bus},{speed}" + # if vid is not None and pid is not None and bus is not None and speed is not None and ifc is not None: + if bus is not None and speed is not None and ifc is not None: + # key = f"{vid},{pid},{bus},{speed}" + # key = f"{vid},{pid}" + key = f"{mport}" + parsed_item = { 'type': 'usb3', 'vid': vid, @@ -63,7 +60,13 @@ def get_item_data(self, msg): print("Error: Missing required fields in item") else: print("Error: Item is not a dictionary") - + + # parsed_usb3 = { + # '7': {'type': 'usb3', 'vid': '5967', 'pid': '9317', 'bus': '1', 'speed': 3, 'ifc': [14, 14, 254], 'mport': '(7,)', 'port': '7'}, + # '(10,)': {'type': 'usb3', 'vid': '32903', 'pid': '38', 'bus': '1', 'speed': 2, 'ifc': [224, 224], 'mport': '(10,)', 'port': '10'}, + # '(9, 4)': {'type': 'usb3', 'vid': '1118', 'pid': '1606', 'bus': '1', 'speed': 2, 'ifc': [2, 10], 'mport': '(9, 4)', 'port': '4'}, + # '(9, 1)': {'type': 'usb3', 'vid': '1121', 'pid': '20052', 'bus': '1', 'speed': 1, 'ifc': [3], 'mport': '(9, 1)', 'port': '1'}, + # '(6,)': {'type': 'usb3', 'vid': '1267', 'pid': '3147', 'bus': '1', 'speed': 2, 'ifc': [255], 'mport': '(6,)', 'port': '6'}} return parsed_usb3 def get_level_data(self, u3tbuf): @@ -81,11 +84,3 @@ def get_level_data(self, u3tbuf): pdict['level'+str(lcnt)] = [rkitem] return pdict -# # Sample USB3 data -# usb3_data = [{'type': 'usb3', 'vid': '32903', 'pid': '2880', 'bus': '2', 'speed': 5, 'ifc': [9]}, {'type': 'usb3', 'vid': '7516', 'pid': '22529', 'bus': '1', 'speed': 3, 'ifc': [9]}, {'type': 'usb3', 'vid': '5967', 'pid': '9317', 'bus': '1', 'mport': '(7,)', 'port': '7', 'speed': 3, 'ifc': [14, 14, 254]}, {'type': 'usb3', 'vid': '1121', 'pid': '20052', 'bus': '1', 'mport': '(3,)', 'port': '3', 'speed': 1, 'ifc': [3]}, {'type': 'usb3', 'vid': '32903', 'pid': '38', 'bus': '1', 'mport': '(10,)', 'port': '10', 'speed': 2, 'ifc': [224, 224]}, {'type': 'usb3', 'vid': '7825', 'pid': '56897', 'bus': '1', 'mport': '(1, 5)', 'port': '5', 'speed': 2, 'ifc': [17, 255]}, {'type': 'usb3', 'vid': '1118', 'pid': '1606', 'bus': '1', 'mport': '(9,)', 'port': '9', 'speed': 2, 'ifc': [2, 10]}, {'type': 'usb3', 'vid': '1267', 'pid': '3147', 'bus': '1', 'mport': '(6,)', 'port': '6', 'speed': 2, 'ifc': [255]}] - -# # Creating an instance of the parser -# usb_parser = WinUsb3TreeParse() - -# # Parsing USB3 data -# usb_parser.parse_usb3tb_data(usb3_data)