title: How to distinguish the specific device from the multiple serial COM ports?
body: <p>I'm writing a python program. One of the function of the program is to gets the current latitude and longitude from a GPS receiver via USB. However, the computer must connect OBD-II(On-Board Diagnostics) via USB to get data from a vehicle. I can find all available serial COM ports in the computer, but I cannot distinguish the GPS receiver from serial COM ports, because the two devices represent the similar label in the computer.</p>
  <p>The label:</p>
  <pre><code>Prolific USB-to-Serial Comm Port (COM5)
  Prolific USB-to-Serial Comm Port (COM6)
  </code></pre>
  <p>My test code:</p>
  <pre class="lang-py prettyprint-override"><code>import serial
  import pynmea2
  import time
  import traceback
  import serial.tools.list_ports
  
  def get_NMEA2_GPS():
      try:
          portList = list(serial.tools.list_ports_windows.comports())
          ser = None
          for port in portList:
              # print(&quot;-&quot;*10)
              # print(port.usb_info())
              # print(&quot;Port: [%s], device: [%s], description: [%s]&quot; %(str(port), str(port.device), str(port.description)))
              if &quot;Prolific USB-to-Serial Comm Port&quot; in port.description:
                  ser = serial.Serial(port[0], &quot;4800&quot;, timeout = 1.0)
                  print(&quot;Start to obtain GPS via NMEA&quot;)
                  break
              # End of if-condition
          # End of for-loop
          
          
          while True:
              # print(&quot;GPS data:&quot; + data )
              data = ser.readline().decode('ascii').strip()
              print(data)
              try:  
                  msg = pynmea2.parse(data)
                  
              except pynmea2.nmea.ParseError:
                  print(&quot;Warning: The checksum of the sentence is wrong!&quot;)
                  continue
              except UnicodeDecodeError:
                  continue
              else: 
                  if msg.sentence_type == &quot;RMC&quot;:
                      latitude = msg.latitude
                      longitude = msg.longitude
                      print(&quot;----The current position: %2.8f, %3.8f&quot; %(latitude, longitude))
              # time.sleep(0.1)  
      except KeyboardInterrupt:
          print(&quot;Stop obtain GPS information!&quot;)
          ser.close()
      except Exception:
          print(&quot;Error: 無法與GPS sensor連線&quot;)
          traceback.print_exc()
  
  def main():
      get_NMEA2_GPS()
      print(&quot;=&quot;*60)
      print(&quot;Finish!&quot;)
      input(&quot;Please enter any key!&quot;)
  # End of main
  
  if __name__ == &quot;__main__&quot;:
      main()
  # End of if-condition
  </code></pre>
  <p>I'm sure that COM5 is the GPS receiver, and COM6 is OBD-II. However, the COM port of the GPS receiver may change because I cannot expect that user plugs the GPS receiver into the same USB port. By the way, the OS that I use is Windows 10 64-bit. Could anyone give me any suggestion, please?</p>