200 for port in availablePorts: |
201 for port in availablePorts: |
201 supported = False |
202 supported = False |
202 vid = port.vendorIdentifier() |
203 vid = port.vendorIdentifier() |
203 pid = port.productIdentifier() |
204 pid = port.productIdentifier() |
204 |
205 |
205 if vid == 0 and pid == 0: |
206 if not port.isValid(): |
206 # no device detected at port |
207 # no device detected at port |
207 continue |
208 continue |
208 |
209 |
209 for board in SupportedBoards: |
210 for board in SupportedBoards: |
210 if ((vid, pid) in SupportedBoards[board]["ids"] or |
211 if ((vid, pid) in SupportedBoards[board]["ids"] or |
242 if not supported: |
243 if not supported: |
243 if vid and pid and (vid, pid) not in IgnoredBoards: |
244 if vid and pid and (vid, pid) not in IgnoredBoards: |
244 unknownDevices.append((vid, pid, port.description())) |
245 unknownDevices.append((vid, pid, port.description())) |
245 logging.debug("Unknown device: (0x%04x:0x%04x %s)", |
246 logging.debug("Unknown device: (0x%04x:0x%04x %s)", |
246 vid, pid, port.description()) |
247 vid, pid, port.description()) |
247 |
248 else: |
248 return foundDevices, unknownDevices |
249 desc = port.description() |
|
250 if not desc: |
|
251 desc = "Unknown Device" |
|
252 unknownPorts.append((vid, pid, desc, port.portName())) |
|
253 |
|
254 return foundDevices, unknownDevices, unknownPorts |
249 |
255 |
250 |
256 |
251 def getDeviceIcon(boardName, iconFormat=True): |
257 def getDeviceIcon(boardName, iconFormat=True): |
252 """ |
258 """ |
253 Function to get the icon for the given board. |
259 Function to get the icon for the given board. |