Support timeouts.
authorJelmer Vernooij <jelmer@palmsens>
Tue, 11 Jul 2006 11:59:41 +0000 (13:59 +0200)
committerJelmer Vernooij <jelmer@palmsens>
Tue, 11 Jul 2006 11:59:41 +0000 (13:59 +0200)
ftdi.cs

diff --git a/ftdi.cs b/ftdi.cs
index 7ca3ed0333d858aaba3ad13cd802fd56b13ec4dd..81059dd9b0b77f145f446cd76ed64d47affb9611 100644 (file)
--- a/ftdi.cs
+++ b/ftdi.cs
@@ -79,8 +79,8 @@ namespace FTDI
        [StructLayout(LayoutKind.Sequential)] struct ftdi_context {
                // USB specific
                IntPtr usb_dev;
-               int usb_read_timeout;
-               int usb_write_timeout;
+               internal int usb_read_timeout;
+               internal int usb_write_timeout;
        
                // FTDI specific
                ChipType type;
@@ -150,6 +150,16 @@ namespace FTDI
                        CheckRet(ftdi_usb_open(ref ftdi, vendor, product));
                }
 
+               public int ReadTimeout {
+                       get { return ftdi.usb_read_timeout; }
+                       set { ftdi.usb_read_timeout = value; }
+               }
+
+               public int WriteTimeout {
+                       get { return ftdi.usb_write_timeout; }
+                       set { ftdi.usb_write_timeout = value; }
+               }
+
                public FTDIContext(int vendor, int product, string description, string serial) : this() {
                        int ret = ftdi_usb_open_desc(ref ftdi, vendor, product, description, serial);
                        CheckRet(ret);