Hello community, here is the log from the commit of package libftdi1 for openSUSE:Factory checked in at 2017-11-19 11:09:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libftdi1 (Old) and /work/SRC/openSUSE:Factory/.libftdi1.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libftdi1" Sun Nov 19 11:09:08 2017 rev:16 rq:542226 version:1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/libftdi1/libftdi1.changes 2017-07-21 22:35:49.311644789 +0200 +++ /work/SRC/openSUSE:Factory/.libftdi1.new/libftdi1.changes 2017-11-19 11:09:23.515761200 +0100 @@ -1,0 +2,19 @@ +Tue Nov 7 13:39:39 UTC 2017 - [email protected] + +- Update to version 1.4: + * 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* + * C++ API: Ability to open devices with empty descriptor strings + * C++ API: Fix enumerations for buffer purge and modem controls + * small build fixes and improvements in the python examples + * ftdi_eeprom / eeprom handling: + + New API function: ftdi_eeprom_get_strings() + + Fix USE_SERIAL handling for 230X type chips + + Make ftdi_read_eeprom_location() endianness independent + + Fix flashing of FT245R +- Build python3 version of bindings on Factory +- Rename python bindings subpackage to match singlespec conventions +- Run spec-cleaner + +------------------------------------------------------------------- Old: ---- libftdi1-1.3.tar.bz2 New: ---- libftdi1-1.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libftdi1.spec ++++++ --- /var/tmp/diff_new_pack.EGWF7N/_old 2017-11-19 11:09:23.951745303 +0100 +++ /var/tmp/diff_new_pack.EGWF7N/_new 2017-11-19 11:09:23.955745158 +0100 @@ -18,30 +18,30 @@ %define sover -2 %define libname %{name}%{sover} - Name: libftdi1 -Version: 1.3 +Version: 1.4 Release: 0 Summary: Library to program and control the FTDI USB controller -License: LGPL-2.1+ and GPL-2.0-with-classpath-exception +License: LGPL-2.1+ AND GPL-2.0-with-classpath-exception Group: Hardware/Other Url: http://www.intra2net.com/en/developer/libftdi Source: http://www.intra2net.com/en/developer/libftdi/download/libftdi1-%{version}.tar.bz2 -%if 0%{?suse_version} > 1325 -BuildRequires: libboost_headers-devel -%else -BuildRequires: boost-devel -%endif BuildRequires: cmake >= 2.8 BuildRequires: doxygen BuildRequires: gcc-c++ BuildRequires: libconfuse-devel BuildRequires: libusb-1_0-devel BuildRequires: pkgconfig +BuildRequires: swig +%if 0%{?suse_version} > 1325 +BuildRequires: libboost_headers-devel +BuildRequires: python3-devel +BuildRequires: python3-xml +%else +BuildRequires: boost-devel BuildRequires: python-devel BuildRequires: python-xml -BuildRequires: swig -BuildRoot: %{_tmppath}/%{name}-%{version}-build +%endif %description Library to program and control the FTDI USB controller. @@ -55,18 +55,29 @@ Library to program and control the FTDI USB controller. This library is used by many programs accessing FTDI USB-to-RS232 converters. +%if 0%{?suse_version} > 1325 +%package -n python3-%{name} +Summary: Python 3 binding for libftdi1 +Group: Development/Languages/Python -%package binding-python -Summary: Python binding for libftdi +%description -n python3-%{name} +Library to program and control the FTDI USB controller. +This library is used by many programs accessing FTDI USB-to-RS232 converters. + +This package provides the python binding for libftdi. +%else +%package -n python2-%{name} +Summary: Python 2 binding for libftdi1 Group: Development/Languages/Python -Requires: %{libname} = %{version} -Requires: swig +Provides: binding-python = %{version} +Obsoletes: binding-python < %{version} -%description binding-python +%description -n python2-%{name} Library to program and control the FTDI USB controller. This library is used by many programs accessing FTDI USB-to-RS232 converters. This package provides the python binding for libftdi. +%endif %package devel Summary: Header files and static libraries for libftdi @@ -83,7 +94,7 @@ %build %cmake -make %{?_smp_mflags} +%make_jobs %install %cmake_install @@ -98,18 +109,22 @@ %postun -n %{libname} -p /sbin/ldconfig %files -n %{libname} -%defattr(-,root,root) %doc AUTHORS COPYING* LICENSE README %{_libdir}/libftdi*.so.* -%files binding-python -%defattr(-,root,root) +%if 0%{?suse_version} > 1325 +%files -n python3-%{name} +%doc python/examples/*.py +%{python3_sitearch}/_ftdi1.so +%{python3_sitearch}/ftdi1.py +%else +%files -n python2-%{name} %doc python/examples/*.py %{python_sitearch}/_ftdi1.so %{python_sitearch}/ftdi1.py +%endif %files devel -%defattr(-,root,root) %doc ftdi_eeprom/example.conf %{_bindir}/libftdi*-config %{_bindir}/ftdi_eeprom ++++++ libftdi1-1.3.tar.bz2 -> libftdi1-1.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/AUTHORS new/libftdi1-1.4/AUTHORS --- old/libftdi1-1.3/AUTHORS 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/AUTHORS 2017-08-07 16:52:39.000000000 +0200 @@ -5,6 +5,7 @@ Contributors in alphabetical order, see Changelog for full details: + Adam Malinowski <[email protected]> Alain Abbas <[email protected]> Alexander Lehmann <[email protected]> Alex Harford <[email protected]> @@ -22,6 +23,7 @@ Davide Michelizza <[email protected]> Denis Sirotkin <[email protected]> Emil <[email protected]> + Eric Schott <[email protected]> Eugene Hutorny <[email protected]> Evan Nemerson <[email protected]> Evgeny Sinelnikov <[email protected]> @@ -33,15 +35,19 @@ Jarkko Sonninen <[email protected]> Jean-Daniel Merkli <[email protected]> Jochen Sprickerhof <[email protected]> + Joe Zbiciak <[email protected]> + Jon Beniston <[email protected]> Juergen Beisert <[email protected]> Lorenz Moesenlechner <[email protected]> Marek Vavruša <[email protected]> Marius Kintel <[email protected]> Mark Hämmerling <[email protected]> + Matthias Janke <[email protected]> Matthias Kranz <[email protected]> Matthias Richter <[email protected]> Matthijs ten Berge <[email protected]> Max <[email protected]> + Maxwell Dreytser <[email protected]> Michel Zou <[email protected]> Mike Frysinger <[email protected]> Nathael Pajani <[email protected]> @@ -50,9 +56,11 @@ Paul Fertser <[email protected]> Peter Holik <[email protected]> Raphael Assenat <[email protected]> + Robert Cox <[email protected]> Robin Haberkorn <[email protected]> Rodney Sinclair <[email protected]> Rogier Wolff <[email protected]> + Rolf Fiedler <[email protected]> Salvador Eduardo Tropea <[email protected]> Stephan Linz <[email protected]> Steven Turner <[email protected]> @@ -67,4 +75,5 @@ Vladimir Yakovlev <[email protected]> Wilfried Holzke <[email protected]> Xiaofan Chen <[email protected]> + Yegor Yefremov <[email protected]> Yi-Shin Li <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/CMakeLists.txt new/libftdi1-1.4/CMakeLists.txt --- old/libftdi1-1.3/CMakeLists.txt 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/CMakeLists.txt 2017-08-07 16:52:39.000000000 +0200 @@ -1,7 +1,7 @@ # Project project(libftdi1) set(MAJOR_VERSION 1) -set(MINOR_VERSION 3) +set(MINOR_VERSION 4) set(PACKAGE libftdi1) set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION}) set(VERSION ${VERSION_STRING}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/ChangeLog new/libftdi1-1.4/ChangeLog --- old/libftdi1-1.3/ChangeLog 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/ChangeLog 2017-08-07 16:52:39.000000000 +0200 @@ -1,3 +1,17 @@ +New in 1.4 - 2017-08-07 +----------------------- +* 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* +* C++ API: Ability to open devices with empty descriptor strings +* C++ API: Fix enumerations for buffer purge and modem controls +* small build fixes and improvements in the python examples +* ftdi_eeprom / eeprom handling: + * New API function: ftdi_eeprom_get_strings() + * Fix USE_SERIAL handling for 230X type chips + * Make ftdi_read_eeprom_location() endianness independent + * Fix flashing of FT245R + New in 1.3 - 2016-05-20 ----------------------- * Added ftdi_usb_get_strings2() to prevent automatic device close (Fahrzin Hemmati) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/README new/libftdi1-1.4/README --- old/libftdi1-1.3/README 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/README 2017-08-07 16:52:39.000000000 +0200 @@ -1,5 +1,5 @@ -------------------------------------------------------------------- -libftdi version 1.3 +libftdi version 1.4 -------------------------------------------------------------------- libftdi - A library (using libusb) to talk to FTDI's UART/FIFO chips @@ -20,29 +20,20 @@ Changes ------- -* Added ftdi_usb_get_strings2() to prevent automatic device close (Fahrzin Hemmati) -* Added ftdi_transfer_data_cancel() for cancellation of a submitted transfer, - avoided resubmittion of a canceled transfer in the callbacks, - replaced calls to libusb_handle_events with - libusb_handle_events_timeout_completed (Eugene Hutorny) +* 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* +* C++ API: Ability to open devices with empty descriptor strings +* C++ API: Fix enumerations for buffer purge and modem controls +* small build fixes and improvements in the python examples * ftdi_eeprom / eeprom handling: - * Add support for arbitrary user data (Salvador Eduardo Tropea) - * Add --build-eeprom support (Salvador Eduardo Tropea) - * Fix use_usb_version config file option (Thilo Schulz) - * Ability to include other config files in EEPROM config file (Thilo Schulz) - * Add external oscillator enable bit (Raphael Assenat) - * Support channel configuration (Stephan Linz) - * Added --device option to ftdi_eeprom to specify FTDI device (Robin Haberkorn) - * Fixed EEPROM user-area space checks for FT232R and FT245R chips (Robin Haberkorn) -* Various improvements to CBUS handling, including the EEPROM (Robin Haberkorn) -* swig wrapper: Fix handling of binary strings in ftdi_write_data() - for python 3 (xantares09) -* cbus python example code (Rodney Sinclair) -* ftdi_stream: fix timeout setting (Ларионов Даниил) -* Fixed typo in CBUS defines: CBUSG_DRIVE1 -> CBUSH_DRIVE1 + * New API function: ftdi_eeprom_get_strings() + * Fix USE_SERIAL handling for 230X type chips + * Make ftdi_read_eeprom_location() endianness independent + * Fix flashing of FT245R You'll find the newest version of libftdi at: -http://www.intra2net.com/en/developer/libftdi +https://www.intra2net.com/en/developer/libftdi Quick start @@ -57,5 +48,5 @@ More verbose build instructions are in "README.build" -------------------------------------------------------------------- -www.intra2net.com 2003-2014 Intra2net AG +www.intra2net.com 2003-2017 Intra2net AG -------------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/README.build new/libftdi1-1.4/README.build --- old/libftdi1-1.3/README.build 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/README.build 2017-08-07 16:52:39.000000000 +0200 @@ -2,19 +2,19 @@ Ubuntu 12.10, But it is similar on other Linux distros. 1) Install the build tools -sudo apt-get install build-essential -sudo apt-get install git-core -sudo apt-get install cmake -sudo apt-get install doxygen (for building documentations) +sudo apt-get install build-essential (yum install make automake gcc gcc-c++ kernel-devel) +sudo apt-get install git-core (yum install git) +sudo apt-get install cmake (yum install cmake) +sudo apt-get install doxygen (for building documentations) (yum install doxygen) 2) Install dependencies -sudo apt-get install libusb-1.0-devel +sudo apt-get install libusb-1.0-devel (yum install libusb-devel) (if the system comes with older version like 1.0.8 or earlier, it is recommended you build libusbx-1.0.14 or later). -sudo apt-get install libconfuse-dev (for ftdi-eeprom) -sudo apt-get install swig python-dev (for python bindings) -sudo apt-get install libboost-all-dev (for C++ binding and unit test) +sudo apt-get install libconfuse-dev (for ftdi-eeprom) (yum install libconfuse-devel) +sudo apt-get install swig python-dev (for python bindings) (yum install swig python-devel) +sudo apt-get install libboost-all-dev (for C++ binding and unit test) (yum install boost-devel) 3) Clone the git repository mkdir libftdi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/doc/release-checklist.txt new/libftdi1-1.4/doc/release-checklist.txt --- old/libftdi1-1.3/doc/release-checklist.txt 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/doc/release-checklist.txt 2017-08-07 16:52:39.000000000 +0200 @@ -1,5 +1,6 @@ *** Checklist for a new libftdi release *** - Update ChangeLog and AUTHORS via git history + (git log --oneline latest_release..HEAD) - Update version number in the following files: - CMakeLists.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/ftdipp/CMakeLists.txt new/libftdi1-1.4/ftdipp/CMakeLists.txt --- old/libftdi1-1.3/ftdipp/CMakeLists.txt 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/ftdipp/CMakeLists.txt 2017-08-07 16:52:39.000000000 +0200 @@ -27,7 +27,7 @@ add_library(ftdipp1 SHARED ${cpp_sources}) math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatiblity with previous releases - set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 2) + set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 3) # Prevent clobbering each other during the build set_target_properties(ftdipp1 PROPERTIES CLEAN_DIRECT_OUTPUT 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/ftdipp/ftdi.cpp new/libftdi1-1.4/ftdipp/ftdi.cpp --- old/libftdi1-1.3/ftdipp/ftdi.cpp 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/ftdipp/ftdi.cpp 2017-08-07 16:52:39.000000000 +0200 @@ -2,11 +2,11 @@ ftdi.cpp - C++ wraper for libftdi ------------------- begin : Mon Oct 13 2008 - copyright : (C) 2008-2014 by Marek Vavruša / libftdi developers + copyright : (C) 2008-2017 by Marek Vavruša / libftdi developers email : [email protected] and [email protected] ***************************************************************************/ /* -Copyright (C) 2008-2014 by Marek Vavruša / libftdi developers +Copyright (C) 2008-2017 by Marek Vavruša / libftdi developers The software in this package is distributed under the GNU General Public License version 2 (with a special exception described below). @@ -87,7 +87,7 @@ if (ret < 0) return ret; - return get_strings_and_reopen(); + return get_strings_and_reopen(false,false,false); } int Context::open(int vendor, int product, const std::string& description, const std::string& serial, unsigned int index) @@ -106,7 +106,7 @@ if (ret < 0) return ret; - return get_strings_and_reopen(); + return get_strings_and_reopen(false,!description.empty(),!serial.empty()); } int Context::open(const std::string& description) @@ -116,7 +116,7 @@ if (ret < 0) return ret; - return get_strings_and_reopen(); + return get_strings_and_reopen(false,true,false); } int Context::open(struct libusb_device *dev) @@ -144,12 +144,26 @@ int Context::flush(int mask) { - int ret = 1; + int ret; - if (mask & Input) - ret &= ftdi_usb_purge_rx_buffer(d->ftdi); - if (mask & Output) - ret &= ftdi_usb_purge_tx_buffer(d->ftdi); + switch (mask & (Input | Output)) { + case Input: + ret = ftdi_usb_purge_rx_buffer(d->ftdi); + break; + + case Output: + ret = ftdi_usb_purge_tx_buffer(d->ftdi); + break; + + case Input | Output: + ret = ftdi_usb_purge_buffers(d->ftdi); + break; + + default: + // Emulate behavior of previous version. + ret = 1; + break; + } return ret; } @@ -219,7 +233,7 @@ return chunk; } -int Context::write(unsigned char *buf, int size) +int Context::write(const unsigned char *buf, int size) { return ftdi_write_data(d->ftdi, buf, size); } @@ -314,47 +328,52 @@ return ftdi_read_pins(d->ftdi, pins); } -char* Context::error_string() +const char* Context::error_string() { return ftdi_get_error_string(d->ftdi); } -int Context::get_strings() +int Context::get_strings(bool vendor, bool description, bool serial) { // Prepare buffers - char vendor[512], desc[512], serial[512]; + char ivendor[512], idesc[512], iserial[512]; - int ret = ftdi_usb_get_strings(d->ftdi, d->dev, vendor, 512, desc, 512, serial, 512); + int ret = ftdi_usb_get_strings(d->ftdi, d->dev, vendor?ivendor:NULL, 512, description?idesc:NULL, 512, serial?iserial:NULL, 512); if (ret < 0) return -1; - d->vendor = vendor; - d->description = desc; - d->serial = serial; + d->vendor = ivendor; + d->description = idesc; + d->serial = iserial; return 1; } -int Context::get_strings_and_reopen() +int Context::get_strings_and_reopen(bool vendor, bool description, bool serial) { - if ( d->dev == 0 ) - { - d->dev = libusb_get_device(d->ftdi->usb_dev); - } + int ret = 0; - // Get device strings (closes device) - int ret=get_strings(); - if (ret < 0) + if(vendor || description || serial) { - d->open = 0; - return ret; + if (d->dev == 0) + { + d->dev = libusb_get_device(d->ftdi->usb_dev); + } + + // Get device strings (closes device) + ret=get_strings(vendor, description, serial); + if (ret < 0) + { + d->open = 0; + return ret; + } + + // Reattach device + ret = ftdi_usb_open_dev(d->ftdi, d->dev); + d->open = (ret >= 0); } - // Reattach device - ret = ftdi_usb_open_dev(d->ftdi, d->dev); - d->open = (ret >= 0); - return ret; } @@ -362,6 +381,8 @@ */ const std::string& Context::vendor() { + if(d->vendor.empty()) + get_strings_and_reopen(true,false,false); return d->vendor; } @@ -369,6 +390,8 @@ */ const std::string& Context::description() { + if(d->description.empty()) + get_strings_and_reopen(false,true,false); return d->description; } @@ -376,6 +399,8 @@ */ const std::string& Context::serial() { + if(d->serial.empty()) + get_strings_and_reopen(false,false,true); return d->serial; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/ftdipp/ftdi.hpp new/libftdi1-1.4/ftdipp/ftdi.hpp --- old/libftdi1-1.3/ftdipp/ftdi.hpp 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/ftdipp/ftdi.hpp 2017-08-07 16:52:39.000000000 +0200 @@ -2,11 +2,11 @@ ftdi.hpp - C++ wrapper for libftdi ------------------- begin : Mon Oct 13 2008 - copyright : (C) 2008-2014 by Marek Vavruša and libftdi developers + copyright : (C) 2008-2017 by Marek Vavruša and libftdi developers email : [email protected] and [email protected] ***************************************************************************/ /* -Copyright (C) 2008-2014 by Marek Vavruša and libftdi developers +Copyright (C) 2008-2017 by Marek Vavruša and libftdi developers The software in this package is distributed under the GNU General Public License version 2 (with a special exception described below). @@ -55,16 +55,16 @@ */ enum Direction { - Input, - Output + Input = 0x2, + Output = 0x1, }; /*! \brief Modem control flags. */ enum ModemCtl { - Dtr, - Rts + Dtr = 0x2, + Rts = 0x1, }; /* Constructor, Destructor */ @@ -100,7 +100,7 @@ /* I/O */ int read(unsigned char *buf, int size); - int write(unsigned char *buf, int size); + int write(const unsigned char *buf, int size); int set_read_chunk_size(unsigned int chunksize); int set_write_chunk_size(unsigned int chunksize); int read_chunk_size(); @@ -108,7 +108,7 @@ /* Async IO TODO: should wrap? - int writeAsync(unsigned char *buf, int size); + int writeAsync(const unsigned char *buf, int size); void asyncComplete(int wait_for_more); */ @@ -131,11 +131,11 @@ int read_pins(unsigned char *pins); /* Misc */ - char* error_string(); + const char* error_string(); protected: - int get_strings(); - int get_strings_and_reopen(); + int get_strings(bool vendor=true, bool description=true, bool serial=true); + int get_strings_and_reopen(bool vendor=true, bool description=true, bool serial=true); /* Properties */ struct ftdi_context* context(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/libftdi1.spec.in new/libftdi1-1.4/libftdi1.spec.in --- old/libftdi1-1.3/libftdi1.spec.in 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/libftdi1.spec.in 2017-08-07 16:52:39.000000000 +0200 @@ -7,13 +7,13 @@ License: LGPL for libftdi and GPLv2+linking exception for the C++ wrapper Group: System Environment/Libraries Vendor: Intra2net AG -Source: http://www.intra2net.com/en/developer/libftdi/download/%{name}-%{version}.tar.bz2 +Source: https://www.intra2net.com/en/developer/libftdi/download/%{name}-%{version}.tar.bz2 Buildroot: /tmp/%{name}-%{version}-root Requires: libusb1 BuildRequires: libusb1, libusb1-devel, pkgconfig, doxygen BuildRequires: swig python-devel Prefix: /usr -URL: http://www.intra2net.com/en/developer/libftdi +URL: https://www.intra2net.com/en/developer/libftdi %package devel Summary: Header files and static libraries for libftdi1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/python/CMakeLists.txt new/libftdi1-1.4/python/CMakeLists.txt --- old/libftdi1-1.3/python/CMakeLists.txt 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/python/CMakeLists.txt 2017-08-07 16:52:39.000000000 +0200 @@ -30,6 +30,8 @@ if ( LINK_PYTHON_LIBRARY ) swig_link_libraries ( ftdi1 ${PYTHON_LIBRARIES} ) + elseif( APPLE ) + set_target_properties ( ${SWIG_MODULE_ftdi1_REAL_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) endif () set_target_properties ( ${SWIG_MODULE_ftdi1_REAL_NAME} PROPERTIES NO_SONAME ON ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/python/examples/cbus.py new/libftdi1-1.4/python/examples/cbus.py --- old/libftdi1-1.3/python/examples/cbus.py 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/python/examples/cbus.py 2017-08-07 16:52:39.000000000 +0200 @@ -17,55 +17,55 @@ # Define class for displaying errors. class ErrorMsg(Exception): def __init__(self,message): - self.message = message; + self.message = message def __str__(self): - return self.message; + return self.message -# Function to convert CBUSH values to human-readable strings +# Function to convert CBUSX values to human-readable strings def cbush_string(value): - if value == ftdi.CBUSH_AWAKE: + if value == ftdi.CBUSX_AWAKE: return 'AWAKE' - if value == ftdi.CBUSH_BAT_DETECT: + if value == ftdi.CBUSX_BAT_DETECT: return 'BAT_DETECT' - if value == ftdi.CBUSH_BAT_DETECT_NEG: + if value == ftdi.CBUSX_BAT_DETECT_NEG: return 'BAT_DETECT_NEG' - if value == ftdi.CBUSH_BB_RD: + if value == ftdi.CBUSX_BB_RD: return 'BB_RD' - if value == ftdi.CBUSH_BB_WR: + if value == ftdi.CBUSX_BB_WR: return 'BB_WR' - if value == ftdi.CBUSH_CLK15: - return 'CLK15' - if value == ftdi.CBUSH_CLK30: - return 'CLK30' - if value == ftdi.CBUSH_CLK7_5: - return 'CLK7_5' - if value == ftdi.CBUSH_DRIVE_0: + if value == ftdi.CBUSX_CLK24: + return 'CLK24' + if value == ftdi.CBUSX_CLK12: + return 'CLK12' + if value == ftdi.CBUSX_CLK6: + return 'CLK6' + if value == ftdi.CBUSX_DRIVE_0: return 'DRIVE_0' - if value == ftdi.CBUSH_DRIVE1: + if value == ftdi.CBUSX_DRIVE1: return 'DRIVE_1' - if value == ftdi.CBUSH_I2C_RXF: + if value == ftdi.CBUSX_I2C_RXF: return 'I2C_RXF' - if value == ftdi.CBUSH_I2C_TXE: + if value == ftdi.CBUSX_I2C_TXE: return 'I2C_TXE' - if value == ftdi.CBUSH_IOMODE: + if value == ftdi.CBUSX_IOMODE: return 'IOMODE' - if value == ftdi.CBUSH_PWREN: + if value == ftdi.CBUSX_PWREN: return 'PWREN' - if value == ftdi.CBUSH_RXLED: + if value == ftdi.CBUSX_RXLED: return 'RXLED' - if value == ftdi.CBUSH_SLEEP: + if value == ftdi.CBUSX_SLEEP: return 'SLEEP' - if value == ftdi.CBUSH_TIME_STAMP: + if value == ftdi.CBUSX_TIME_STAMP: return 'TIME_STAMP' - if value == ftdi.CBUSH_TRISTATE: + if value == ftdi.CBUSX_TRISTATE: return 'TRISTATE' - if value == ftdi.CBUSH_TXDEN: + if value == ftdi.CBUSX_TXDEN: return 'TXDEN' - if value == ftdi.CBUSH_TXLED: + if value == ftdi.CBUSX_TXLED: return 'TXLED' - if value == ftdi.CBUSH_TXRXLED: + if value == ftdi.CBUSX_TXRXLED: return 'TXRXLED' - if value == ftdi.CBUSH_VBUS_SENSE: + if value == ftdi.CBUSX_VBUS_SENSE: return 'VBUS_SENSE' return 'UNKNOWN' @@ -80,11 +80,11 @@ # List all the FT230X devices. nDevices, devlist = ftdi.usb_find_all(ftdic, 0x0403, 0x6015) if nDevices < 0: - raise ErrorMsg('ftdi.usb_find_all error = %s' % ftdi.get_error_string(ftdic)); + raise ErrorMsg('ftdi.usb_find_all error = %s' % ftdi.get_error_string(ftdic)) elif nDevices == 0: - raise ErrorMsg('No FT230X devices found'); + raise ErrorMsg('No FT230X devices found') elif nDevices != 1: - raise ErrorMsg('More than one FT230X device found'); + raise ErrorMsg('More than one FT230X device found') # Display the identified single FT230X device. ret, manufacturer, description, serial = ftdi.usb_get_strings(ftdic, devlist.dev) @@ -93,7 +93,7 @@ print 'manufacturer="%s" description="%s" serial="%s"' % (manufacturer, description, serial) # Open the identified single FT230X device. - ret = ftdi.usb_open_desc(ftdic, 0x0403, 0x6015, description, serial); + ret = ftdi.usb_open_desc(ftdic, 0x0403, 0x6015, description, serial) if ret < 0: raise ErrorMsg('ftdi.usb_open_desc error = %s' % ftdi.get_error_string(ftdic)) @@ -104,7 +104,7 @@ print 'chip id=0x%08X' % (chipid % 2**32) # Read the EEPROM - ret = ftdi.read_eeprom(ftdic); + ret = ftdi.read_eeprom(ftdic) if ret < 0: raise ErrorMsg('ftdi.read_eeprom error = %s' % ftdi.get_error_string(ftdic)) @@ -126,10 +126,10 @@ sys.stdout.write(x) else: sys.stdout.write('.') - sys.stdout.write('\n'); + sys.stdout.write('\n') # Read and display the EEPROM (in human readable format) - ret = ftdi.eeprom_decode(ftdic, 1); + ret = ftdi.eeprom_decode(ftdic, 1) if ret < 0: raise ErrorMsg('ftdi.eeprom_decode error = %s' % ftdi.get_error_string(ftdic)) @@ -143,7 +143,7 @@ if ret < 0: raise ErrorMsg('ftdi.get_eeprom_value error = %s' % ftdi.get_error_string(ftdic)) print 'initial CBUS3 = %d (%s)' % (value,cbush_string(value),) - ret = ftdi.set_eeprom_value(ftdic,ftdi.CBUS_FUNCTION_3,ftdi.CBUSH_DRIVE1) + ret = ftdi.set_eeprom_value(ftdic,ftdi.CBUS_FUNCTION_3,ftdi.CBUSX_DRIVE1) if ret < 0: raise ErrorMsg('ftdi.set_eeprom_value error = %s' % ftdi.get_error_string(ftdic)) ret, value = ftdi.get_eeprom_value(ftdic,ftdi.CBUS_FUNCTION_3) @@ -164,10 +164,10 @@ print 'EEPROM write not attempted' # Close the ftdi context. - ret = ftdi.usb_close(ftdic); + ret = ftdi.usb_close(ftdic) if ret < 0: - raise ErrorMsg('ftdi.usb_close error = %s' % ftdi.get_error_string(ftdic)); + raise ErrorMsg('ftdi.usb_close error = %s' % ftdi.get_error_string(ftdic)) except ErrorMsg, msg: - print >> sys.stderr, 'FATAL ERROR: ' + str(msg); - exit(1); + print >> sys.stderr, 'FATAL ERROR: ' + str(msg) + exit(1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/python/ftdi1.i new/libftdi1-1.4/python/ftdi1.i --- old/libftdi1-1.3/python/ftdi1.i 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/python/ftdi1.i 2017-08-07 16:52:39.000000000 +0200 @@ -61,11 +61,13 @@ %enddef %feature("autodoc", ftdi_usb_get_strings_docstring) ftdi_usb_get_strings; %feature("autodoc", ftdi_usb_get_strings_docstring) ftdi_usb_get_strings2; +%feature("autodoc", ftdi_usb_get_strings_docstring) ftdi_eeprom_get_strings; %apply char *OUTPUT { char * manufacturer, char * description, char * serial }; %cstring_bounded_output( char * manufacturer, 256 ); %cstring_bounded_output( char * description, 256 ); +%cstring_bounded_output( char * product, 256 ); %cstring_bounded_output( char * serial, 256 ); -%typemap(default,noblock=1) int mnf_len, int desc_len, int serial_len { $1 = 256; } +%typemap(default,noblock=1) int mnf_len, int desc_len, int product_len, int serial_len { $1 = 256; } int ftdi_usb_get_strings(struct ftdi_context *ftdi, struct libusb_device *dev, char * manufacturer, int mnf_len, char * description, int desc_len, @@ -74,8 +76,14 @@ char * manufacturer, int mnf_len, char * description, int desc_len, char * serial, int serial_len); + int ftdi_eeprom_get_strings(struct ftdi_context *ftdi, + char *manufacturer, int mnf_len, + char *product, int product_len, + char *serial, int serial_len); + %clear char * manufacturer, char * description, char * serial; -%clear int mnf_len, int desc_len, int serial_len; +%clear char * product; +%clear int mnf_len, int desc_len, int product_len, int serial_len; %define ftdi_read_data_docstring "read_data(context) -> (return_code, buf)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/src/ftdi.c new/libftdi1-1.4/src/ftdi.c --- old/libftdi1-1.3/src/ftdi.c 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/src/ftdi.c 2017-08-07 16:52:39.000000000 +0200 @@ -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 : [email protected] ***************************************************************************/ @@ -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 @@ -469,11 +469,12 @@ char *serial, int serial_len) { struct libusb_device_descriptor desc; + char need_open; if ((ftdi==NULL) || (dev==NULL)) return -1; - char need_open = (ftdi->usb_dev == NULL); + need_open = (ftdi->usb_dev == NULL); if (need_open && libusb_open(dev, &ftdi->usb_dev) < 0) ftdi_error_return(-4, "libusb_open() failed"); @@ -749,6 +750,7 @@ \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) @@ -823,6 +825,54 @@ } /** + Opens the device at a given USB bus and device address. + + \param ftdi pointer to ftdi_context + \param bus Bus number + \param addr Device address + + \retval 0: all fine + \retval -1: usb_find_busses() failed + \retval -2: usb_find_devices() failed + \retval -3: usb device not found + \retval -4: unable to open device + \retval -5: unable to claim device + \retval -6: reset failed + \retval -7: set baudrate failed + \retval -8: get product description failed + \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_addr(struct ftdi_context *ftdi, uint8_t bus, uint8_t addr) +{ + libusb_device *dev; + libusb_device **devs; + int i = 0; + + if (ftdi == NULL) + ftdi_error_return(-11, "ftdi context invalid"); + + if (libusb_get_device_list(ftdi->usb_ctx, &devs) < 0) + ftdi_error_return(-12, "libusb_get_device_list() failed"); + + while ((dev = devs[i++]) != NULL) + { + if (libusb_get_bus_number(dev) == bus && libusb_get_device_address(dev) == addr) + { + int res; + res = ftdi_usb_open_dev(ftdi, dev); + libusb_free_device_list(devs,1); + return res; + } + } + + // device not found + ftdi_error_return_free_device_list(-3, "device not found", devs); +} + +/** Opens the ftdi-device described by a description-string. Intended to be used for parsing a device-description given as commandline argument. @@ -1252,7 +1302,7 @@ else best_baud = ftdi_to_clkbits(baudrate, C_CLK, 16, &encoded_divisor); } - else if ((ftdi->type == TYPE_BM) || (ftdi->type == TYPE_2232C) || (ftdi->type == TYPE_R )) + else if ((ftdi->type == TYPE_BM) || (ftdi->type == TYPE_2232C) || (ftdi->type == TYPE_R) || (ftdi->type == TYPE_230X)) { best_baud = ftdi_to_clkbits(baudrate, C_CLK, 16, &encoded_divisor); } @@ -2441,7 +2491,7 @@ eeprom->manufacturer = NULL; if (manufacturer) { - eeprom->manufacturer = malloc(strlen(manufacturer)+1); + eeprom->manufacturer = (char *)malloc(strlen(manufacturer)+1); if (eeprom->manufacturer) strcpy(eeprom->manufacturer, manufacturer); } @@ -2451,7 +2501,7 @@ eeprom->product = NULL; if(product) { - eeprom->product = malloc(strlen(product)+1); + eeprom->product = (char *)malloc(strlen(product)+1); if (eeprom->product) strcpy(eeprom->product, product); } @@ -2471,7 +2521,7 @@ default: ftdi_error_return(-3, "Unknown chip type"); } - eeprom->product = malloc(strlen(default_product) +1); + eeprom->product = (char *)malloc(strlen(default_product) +1); if (eeprom->product) strcpy(eeprom->product, default_product); } @@ -2481,7 +2531,7 @@ eeprom->serial = NULL; if (serial) { - eeprom->serial = malloc(strlen(serial)+1); + eeprom->serial = (char *)malloc(strlen(serial)+1); if (eeprom->serial) strcpy(eeprom->serial, serial); } @@ -2567,7 +2617,7 @@ { if (eeprom->manufacturer) free (eeprom->manufacturer); - eeprom->manufacturer = malloc(strlen(manufacturer)+1); + eeprom->manufacturer = (char *)malloc(strlen(manufacturer)+1); if (eeprom->manufacturer) strcpy(eeprom->manufacturer, manufacturer); } @@ -2576,7 +2626,7 @@ { if (eeprom->product) free (eeprom->product); - eeprom->product = malloc(strlen(product)+1); + eeprom->product = (char *)malloc(strlen(product)+1); if (eeprom->product) strcpy(eeprom->product, product); } @@ -2585,7 +2635,7 @@ { if (eeprom->serial) free (eeprom->serial); - eeprom->serial = malloc(strlen(serial)+1); + eeprom->serial = (char *)malloc(strlen(serial)+1); if (eeprom->serial) { strcpy(eeprom->serial, serial); @@ -2595,6 +2645,61 @@ 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, + char *serial, int serial_len) +{ + struct ftdi_eeprom *eeprom; + + if (ftdi == NULL) + ftdi_error_return(-1, "No struct ftdi_context"); + if (ftdi->eeprom == NULL) + ftdi_error_return(-2, "No struct ftdi_eeprom"); + + eeprom = ftdi->eeprom; + + if (manufacturer) + { + strncpy(manufacturer, eeprom->manufacturer, mnf_len); + if (mnf_len > 0) + manufacturer[mnf_len - 1] = '\0'; + } + + if (product) + { + strncpy(product, eeprom->product, prod_len); + if (prod_len > 0) + product[prod_len - 1] = '\0'; + } + + if (serial) + { + strncpy(serial, eeprom->serial, serial_len); + if (serial_len > 0) + serial[serial_len - 1] = '\0'; + } + + return 0; +} /*FTD2XX doesn't check for values not fitting in the ACBUS Signal options*/ void set_ft232h_cbus(struct ftdi_eeprom *eeprom, unsigned char * output) @@ -2646,6 +2751,15 @@ default: return 0; } } + case TYPE_R: + { + switch (type) + { + case CHANNEL_IS_UART : return 0; + case CHANNEL_IS_FIFO : return 0x01; + default: return 0; + } + } case TYPE_230X: /* FT230X is only UART */ default: return 0; } @@ -2938,6 +3052,7 @@ output[0x14] = eeprom->chip; break; case TYPE_R: + output[0x00] = type2bit(eeprom->channel_a_type, TYPE_R); if (eeprom->high_current == HIGH_CURRENT_DRIVE_R) output[0x00] |= HIGH_CURRENT_DRIVE_R; if (eeprom->external_oscillator) @@ -3170,7 +3285,6 @@ break; case TYPE_230X: output[0x00] = 0x80; /* Actually, leave the default value */ - output[0x0a] = 0x08; /* Enable USB Serial Number */ /*FIXME: Make DBUS & CBUS Control configurable*/ output[0x0c] = 0; /* DBUS drive 4mA, CBUS drive 4 mA like factory default */ for (j = 0; j <= 6; j++) @@ -3270,7 +3384,7 @@ */ static void print_inverted_bits(int invert) { - char *r_bits[] = {"TXD","RXD","RTS","CTS","DTR","DSR","DCD","RI"}; + const char *r_bits[] = {"TXD","RXD","RTS","CTS","DTR","DSR","DCD","RI"}; int i; fprintf(stdout,"Inverted bits:"); @@ -3358,7 +3472,7 @@ free(eeprom->manufacturer); if (manufacturer_size > 0) { - eeprom->manufacturer = malloc(manufacturer_size); + eeprom->manufacturer = (char *)malloc(manufacturer_size); if (eeprom->manufacturer) { // Decode manufacturer @@ -3379,7 +3493,7 @@ product_size = buf[0x11]/2; if (product_size > 0) { - eeprom->product = malloc(product_size); + eeprom->product = (char *)malloc(product_size); if (eeprom->product) { // Decode product name @@ -3400,7 +3514,7 @@ serial_size = buf[0x13]/2; if (serial_size > 0) { - eeprom->serial = malloc(serial_size); + eeprom->serial = (char *)malloc(serial_size); if (eeprom->serial) { // Decode serial @@ -3556,7 +3670,7 @@ if (verbose) { - char *channel_mode[] = {"UART", "FIFO", "CPU", "OPTO", "FT1284"}; + const char *channel_mode[] = {"UART", "FIFO", "CPU", "OPTO", "FT1284"}; fprintf(stdout, "VID: 0x%04x\n",eeprom->vendor_id); fprintf(stdout, "PID: 0x%04x\n",eeprom->product_id); fprintf(stdout, "Release: 0x%04x\n",eeprom->release_number); @@ -3637,7 +3751,7 @@ } else if (ftdi->type == TYPE_232H) { - char *cbush_mux[] = {"TRISTATE","TXLED","RXLED", "TXRXLED","PWREN", + const char *cbush_mux[] = {"TRISTATE","TXLED","RXLED", "TXRXLED","PWREN", "SLEEP","DRIVE_0","DRIVE_1","IOMODE","TXDEN", "CLK30","CLK15","CLK7_5" }; @@ -3658,7 +3772,7 @@ } else if (ftdi->type == TYPE_230X) { - char *cbusx_mux[] = {"TRISTATE","TXLED","RXLED", "TXRXLED","PWREN", + const char *cbusx_mux[] = {"TRISTATE","TXLED","RXLED", "TXRXLED","PWREN", "SLEEP","DRIVE_0","DRIVE_1","IOMODE","TXDEN", "CLK24","CLK12","CLK6","BAT_DETECT","BAT_DETECT#", "I2C_TXE#", "I2C_RXF#", "VBUS_SENSE", "BB_WR#", @@ -3684,11 +3798,11 @@ if (ftdi->type == TYPE_R) { - char *cbus_mux[] = {"TXDEN","PWREN","RXLED", "TXLED","TX+RXLED", + const char *cbus_mux[] = {"TXDEN","PWREN","RXLED", "TXLED","TX+RXLED", "SLEEP","CLK48","CLK24","CLK12","CLK6", "IOMODE","BB_WR","BB_RD" }; - char *cbus_BB[] = {"RXF","TXE","RD", "WR"}; + const char *cbus_BB[] = {"RXF","TXE","RD", "WR"}; if (eeprom->invert) print_inverted_bits(eeprom->invert); @@ -4185,12 +4299,16 @@ */ int ftdi_read_eeprom_location (struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val) { + unsigned char buf[2]; + if (ftdi == NULL || ftdi->usb_dev == NULL) ftdi_error_return(-2, "USB device unavailable"); - if (libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_IN_REQTYPE, SIO_READ_EEPROM_REQUEST, 0, eeprom_addr, (unsigned char *)eeprom_val, 2, ftdi->usb_read_timeout) != 2) + if (libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_IN_REQTYPE, SIO_READ_EEPROM_REQUEST, 0, eeprom_addr, buf, 2, ftdi->usb_read_timeout) != 2) ftdi_error_return(-1, "reading eeprom failed"); + *eeprom_val = (0xff & buf[0]) | (buf[1] << 8); + return 0; } @@ -4473,7 +4591,7 @@ \retval Pointer to error string */ -char *ftdi_get_error_string (struct ftdi_context *ftdi) +const char *ftdi_get_error_string (struct ftdi_context *ftdi) { if (ftdi == NULL) return ""; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/src/ftdi.h new/libftdi1-1.4/src/ftdi.h --- old/libftdi1-1.3/src/ftdi.h 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/src/ftdi.h 2017-08-07 16:52:39.000000000 +0200 @@ -2,7 +2,7 @@ ftdi.h - 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 : [email protected] ***************************************************************************/ @@ -18,7 +18,9 @@ #define __libftdi_h__ #include <stdint.h> +#ifndef _WIN32 #include <sys/time.h> +#endif /* 'interface' might be defined as a macro on Windows, so we need to * undefine it so as not to break the current libftdi API, because @@ -265,7 +267,7 @@ struct ftdi_eeprom *eeprom; /** String representation of last error */ - char *error_str; + const char *error_str; /** Defines behavior in case a kernel module is already attached to the device */ enum ftdi_module_detach_mode module_detach_mode; @@ -487,6 +489,11 @@ char *manufacturer, int mnf_len, char *description, int desc_len, char *serial, int serial_len); + + int ftdi_eeprom_get_strings(struct ftdi_context *ftdi, + char *manufacturer, int mnf_len, + char *product, int prod_len, + char *serial, int serial_len); int ftdi_eeprom_set_strings(struct ftdi_context *ftdi, char * manufacturer, char * product, char * serial); @@ -495,6 +502,7 @@ 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_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); @@ -568,7 +576,7 @@ int ftdi_read_eeprom_location (struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val); int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val); - char *ftdi_get_error_string(struct ftdi_context *ftdi); + const char *ftdi_get_error_string(struct ftdi_context *ftdi); #ifdef __cplusplus } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/src/ftdi_i.h new/libftdi1-1.4/src/ftdi_i.h --- old/libftdi1-1.3/src/ftdi_i.h 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/src/ftdi_i.h 2017-08-07 16:52:39.000000000 +0200 @@ -2,7 +2,7 @@ ftdi_i.h - description ------------------- begin : Don Sep 9 2011 - copyright : (C) 2003-2014 by Intra2net AG and the libftdi developers + copyright : (C) 2003-2017 by Intra2net AG and the libftdi developers email : [email protected] ***************************************************************************/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/src/ftdi_stream.c new/libftdi1-1.4/src/ftdi_stream.c --- old/libftdi1-1.3/src/ftdi_stream.c 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/src/ftdi_stream.c 2017-08-07 16:52:39.000000000 +0200 @@ -41,6 +41,7 @@ #include <stdlib.h> #include <stdio.h> +#include <sys/time.h> #include <libusb.h> #include "ftdi.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libftdi1-1.3/test/baudrate.cpp new/libftdi1-1.4/test/baudrate.cpp --- old/libftdi1-1.3/test/baudrate.cpp 2016-05-20 08:53:12.000000000 +0200 +++ new/libftdi1-1.4/test/baudrate.cpp 2017-08-07 16:52:39.000000000 +0200 @@ -102,6 +102,7 @@ case TYPE_R: case TYPE_2232C: case TYPE_BM: + case TYPE_230X: fractional_bits |= (calc_index & 0x001) ? 4 : 0; break; default:; @@ -159,6 +160,7 @@ test_types.push_back(TYPE_BM); test_types.push_back(TYPE_2232C); test_types.push_back(TYPE_R); + test_types.push_back(TYPE_230X); map<int, calc_result> baudrates; baudrates[183] = calc_result(183, 16383, 7, 48);
