Const correctness for char* strings
[libftdi] / ftdipp / ftdi.hpp
index 2ac4bc2..a438d96 100644 (file)
@@ -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-2014 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-2014 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).
@@ -32,7 +32,7 @@ on this file might be covered by the GNU General Public License.
 #include <list>
 #include <string>
 #include <boost/shared_ptr.hpp>
-#include "ftdi.h"
+#include <ftdi.h>
 
 namespace Ftdi
 {
@@ -93,6 +93,10 @@ 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);
@@ -123,12 +127,11 @@ public:
     /* BitBang mode */
     int set_bitmode(unsigned char bitmask, unsigned char mode);
     int set_bitmode(unsigned char bitmask, enum ftdi_mpsse_mode mode);
-    int DEPRECATED(bitbang_enable(unsigned char bitmask));
     int bitbang_disable();
     int read_pins(unsigned char *pins);
 
     /* Misc */
-    char* error_string();
+    const char* error_string();
 
 protected:
     int get_strings();
@@ -175,7 +178,7 @@ public:
     List(struct ftdi_device_list* devlist = 0);
     ~List();
 
-    static List* find_all(int vendor, int product);
+    static List* find_all(Context &context, int vendor, int product);
 
     /// List type storing "Context" objects
     typedef std::list<Context> ListType;