Update Copyright to 2017, switch download URLs to HTTPS
[libftdi] / src / ftdi.c
index 777733a..2fff1ff 100644 (file)
@@ -2,7 +2,7 @@
                           ftdi.c  -  description
                              -------------------
     begin                : Fri Apr 4 2003
-    copyright            : (C) 2003-2014 by Intra2net AG and the libftdi developers
+    copyright            : (C) 2003-2017 by Intra2net AG and the libftdi developers
     email                : opensource@intra2net.com
  ***************************************************************************/
 
@@ -18,7 +18,7 @@
     \mainpage libftdi API documentation
 
     Library to talk to FTDI chips. You find the latest versions of libftdi at
-    http://www.intra2net.com/en/developer/libftdi/
+    https://www.intra2net.com/en/developer/libftdi/
 
     The library is easy to use. Have a look at this short example:
     \include simple.c
@@ -2596,6 +2596,24 @@ int ftdi_eeprom_set_strings(struct ftdi_context *ftdi, char * manufacturer,
     return 0;
 }
 
+/**
+    Return device ID strings from the eeprom. Device needs to be connected.
+
+    The parameters manufacturer, description and serial may be NULL
+    or pointer to buffers to store the fetched strings.
+
+    \param ftdi pointer to ftdi_context
+    \param manufacturer Store manufacturer string here if not NULL
+    \param mnf_len Buffer size of manufacturer string
+    \param product Store product description string here if not NULL
+    \param prod_len Buffer size of product description string
+    \param serial Store serial string here if not NULL
+    \param serial_len Buffer size of serial string
+
+    \retval   0: all fine
+    \retval  -1: ftdi context invalid
+    \retval  -2: ftdi eeprom buffer invalid
+*/
 int ftdi_eeprom_get_strings(struct ftdi_context *ftdi,
                             char *manufacturer, int mnf_len,
                             char *product, int prod_len,
@@ -2605,15 +2623,11 @@ int ftdi_eeprom_get_strings(struct ftdi_context *ftdi,
 
     if (ftdi == NULL)
         ftdi_error_return(-1, "No struct ftdi_context");
-
     if (ftdi->eeprom == NULL)
-        ftdi_error_return(-2,"No struct ftdi_eeprom");
+        ftdi_error_return(-2, "No struct ftdi_eeprom");
 
     eeprom = ftdi->eeprom;
 
-    if (ftdi->usb_dev == NULL)
-        ftdi_error_return(-3, "No connected device or device not yet opened");
-
     if (manufacturer)
     {
         strncpy(manufacturer, eeprom->manufacturer, mnf_len);