X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=ftdipp%2Fftdi.hpp;h=4e3511d37c023430e8a340cc2d24ab5134c357b3;hp=d85371781e3462448ae6d50c0193c4a4731d77f5;hb=fb56d9cf14f34dda2d7b154f16a0c08ad8b639f9;hpb=7c21beca63e7d4b07d7ebff25428ca4cfdbc8ec5 diff --git a/ftdipp/ftdi.hpp b/ftdipp/ftdi.hpp index d853717..4e3511d 100644 --- a/ftdipp/ftdi.hpp +++ b/ftdipp/ftdi.hpp @@ -2,11 +2,11 @@ ftdi.hpp - C++ wrapper for libftdi ------------------- begin : Mon Oct 13 2008 - copyright : (C) 2008 by Marek Vavruša + copyright : (C) 2008-2017 by Marek Vavruša and libftdi developers email : opensource@intra2net.com and marek@vavrusa.com ***************************************************************************/ /* -Copyright (C) 2008 by Marek Vavruša +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). @@ -93,10 +93,14 @@ public: int set_baud_rate(int baudrate); int set_line_property(enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity); int set_line_property(enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity, enum ftdi_break_type break_type); + int get_usb_read_timeout() const; + void set_usb_read_timeout(int usb_read_timeout); + int get_usb_write_timeout() const; + void set_usb_write_timeout(int usb_write_timeout); /* 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(); @@ -104,7 +108,7 @@ public: /* 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); */ @@ -127,11 +131,11 @@ public: 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();