def enumerate_device_serials(vid=FT232H_VID, pid=FT232H_PID):
try:<EOL><INDENT>ctx = None<EOL>ctx = ftdi.new()<EOL>device_list = None<EOL>count, device_list = ftdi.usb_find_all(ctx, vid, pid)<EOL>if count < <NUM_LIT:0>:<EOL><INDENT>raise RuntimeError('<STR_LIT>'.format(<EOL>count, ftdi.get_error_string(self._ctx)))<EOL><DEDENT>devices = []<EOL>while device_list is not None:<EOL><INDENT>ret, manufacturer, description, serial = ftdi.usb_get_strings(<EOL>ctx, device_list.dev, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>)<EOL>if serial is not None:<EOL><INDENT>devices.append(serial)<EOL><DEDENT>device_list = device_list.next<EOL><DEDENT>return devices<EOL><DEDENT>finally:<EOL><INDENT>if device_list is not None:<EOL><INDENT>ftdi.list_free(device_list)<EOL><DEDENT>if ctx is not None:<EOL><INDENT>ftdi.free(ctx)<EOL><DEDENT><DEDENT>
Return a list of all FT232H device serial numbers connected to the
    machine.  You can use these serial numbers to open a specific FT232H device
    by passing it to the FT232H initializer's serial parameter.