libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.4rc1-6-g7c2a685

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 23 May 2017 20:39:03 +0200 (CEST)
The branch, master has been updated
       via  7c2a6851e1a7544504c58db0e9a21cd87c0bf117 (commit)
       via  30ea3095f153a6c671d0942a7b14d2940d3b8916 (commit)
       via  4fe1a3f009f8591a1b6ac157a073d60fbd151c91 (commit)
      from  5a37dcb718d42bcf51bf87c3f8a257e3480686ec (commit)


- Log -----------------------------------------------------------------
commit 7c2a6851e1a7544504c58db0e9a21cd87c0bf117
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date:   Tue May 23 20:37:20 2017 +0200

    Changelog: Rename ftdi_usb_open_bus_port() to ftdi_usb_open_bus_addr()

commit 30ea3095f153a6c671d0942a7b14d2940d3b8916
Author: Maxwell Dreytser <admin@xxxxxxxxx>
Date:   Thu May 11 01:14:39 2017 -0400

    Change ftdi_open_bus_port to ftdi_open_bus_addr, since 
libusb_get_port_number is not always unique.

commit 4fe1a3f009f8591a1b6ac157a073d60fbd151c91
Author: Maxwell Dreytser <admin@xxxxxxxxx>
Date:   Fri Apr 21 12:48:42 2017 -0400

    Minor comment fix.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog  |    4 ++--
 README     |    2 +-
 src/ftdi.c |   10 ++++++----
 src/ftdi.h |    2 +-
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 34054be..9e9995d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
-New in 1.4rcX - 2017-04-XX
+New in 1.4rcX - 2017-06-XX
 -----------------------
-* New ftdi_usb_open_bus_port() open function
+* New ftdi_usb_open_bus_addr() open function
 * Use BM/R series baud rate computation for FT230X
 * ftdi_get_error_string() now returns const char*
 * small build fixes and improvements in the python examples
diff --git a/README b/README
index c082038..48c00c9 100644
--- a/README
+++ b/README
@@ -20,7 +20,7 @@ that made libftdi possible what it is today.
 
 Changes
 -------
-* New ftdi_usb_open_bus_port() open function
+* New ftdi_usb_open_bus_addr() open function
 * Use BM/R series baud rate computation for FT230X
 * ftdi_get_error_string() now returns const char*
 * small build fixes and improvements in the python examples
diff --git a/src/ftdi.c b/src/ftdi.c
index c26ab72..175befc 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -750,6 +750,7 @@ int ftdi_usb_open_desc(struct ftdi_context *ftdi, int 
vendor, int product,
     \retval -9: get serial number failed
     \retval -10: unable to close device
     \retval -11: ftdi context invalid
+    \retval -12: libusb_get_device_list() failed
 */
 int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int vendor, int 
product,
                              const char* description, const char* serial, 
unsigned int index)
@@ -824,11 +825,11 @@ int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, 
int vendor, int product,
 }
 
 /**
-    Opens the device at a given USB bus and port.
+    Opens the device at a given USB bus and device address.
 
     \param ftdi pointer to ftdi_context
     \param bus Bus number
-    \param port Port number
+    \param addr Device address
 
     \retval  0: all fine
     \retval -1: usb_find_busses() failed
@@ -842,8 +843,9 @@ int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int 
vendor, int product,
     \retval -9: get serial number failed
     \retval -10: unable to close device
     \retval -11: ftdi context invalid
+    \retval -12: libusb_get_device_list() failed
 */
-int ftdi_usb_open_bus_port(struct ftdi_context *ftdi, uint8_t bus, uint8_t 
port)
+int ftdi_usb_open_bus_addr(struct ftdi_context *ftdi, uint8_t bus, uint8_t 
addr)
 {
     libusb_device *dev;
     libusb_device **devs;
@@ -857,7 +859,7 @@ int ftdi_usb_open_bus_port(struct ftdi_context *ftdi, 
uint8_t bus, uint8_t port)
 
     while ((dev = devs[i++]) != NULL)
     {
-        if (libusb_get_bus_number(dev) == bus && libusb_get_port_number(dev) 
== port)
+        if (libusb_get_bus_number(dev) == bus && 
libusb_get_device_address(dev) == addr)
         {
             int res;
             res = ftdi_usb_open_dev(ftdi, dev);
diff --git a/src/ftdi.h b/src/ftdi.h
index 5927c48..de02adf 100644
--- a/src/ftdi.h
+++ b/src/ftdi.h
@@ -502,7 +502,7 @@ extern "C"
                            const char* description, const char* serial);
     int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int vendor, int 
product,
                                  const char* description, const char* serial, 
unsigned int index);
-    int ftdi_usb_open_bus_port(struct ftdi_context *ftdi, uint8_t bus, uint8_t 
port);
+    int ftdi_usb_open_bus_addr(struct ftdi_context *ftdi, uint8_t bus, uint8_t 
addr);
     int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct libusb_device 
*dev);
     int ftdi_usb_open_string(struct ftdi_context *ftdi, const char* 
description);
 


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v1.4rc1-6-g7c2a685, libftdi-git <=