Re: [Haskell-cafe] ByteString questions
isn't this sufficient? might require some more Win32 bindings... http://msdn.microsoft.com/en-us/library/ms810467.aspx 2009/2/27 Galchin, Vasili vigalc...@gmail.com ;^) On Thu, Feb 26, 2009 at 11:15 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 26, at 23:58, Galchin, Vasili wrote: i.e. protocol events seem to leak into an application = yuck On Thu, Feb 26, 2009 at 10:57 PM, Galchin, Vasili vigalc...@gmail.comwrote: I already looked at MSDN examples and am not seriously enccouraged ;^( So, next stop: look for a serial library in C (or C++ with appropriate wrappers) for Win32 and make an FFI binding for it. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
On 2009 Feb 26, at 18:50, Galchin, Vasili wrote: 1) I noticed there is no open function in Data.ByteString. So when I call writeFile or readFile is there an implicit open? Correct; they're modeled after the writeFile and readFile functions in System.IO. 2) For both readFile and writeFile, the first parameter is of type FilePath (which is of course alliased to just String). In any case, for Windows and POSIX OS's like Linux can read and write to a serial device like RS232 by specfiying the device path, e.g. /dev/ tty01? Only if the default port configuration is sufficient. You may need to use System.IO.Posix functions to set things up, then wrap in a Handle and pass to getContents. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
On 2009 Feb 26, at 23:16, Galchin, Vasili wrote: h but at work I am surreptitiously writing in Haskell to test firmware and the platform in Windows XP, Brandon. So if I want something other than the default port configuration I am out of luck? (the default is 9600, ??,??,??)? I didn't mention how to do it on Windows because I have no idea how to do it. You can look in the Win32 hierarchy in the hierarchical libraries: http://www.haskell.org/ghc/docs/latest/html/libraries/index.html -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
Hi Brandon, I have forgotten about RS232 protocol. Can I just reads and writes from the RS232 device from an application to handle data? Or do I need to handle RS232 protocol events in the application? Thanks, Vasili On Thu, Feb 26, 2009 at 10:30 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 26, at 23:16, Galchin, Vasili wrote: h but at work I am surreptitiously writing in Haskell to test firmware and the platform in Windows XP, Brandon. So if I want something other than the default port configuration I am out of luck? (the default is 9600, ??,??,??)? I didn't mention how to do it on Windows because I have no idea how to do it. You can look in the Win32 hierarchy in the hierarchical libraries: http://www.haskell.org/ghc/docs/latest/html/libraries/index.html -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
On 2009 Feb 26, at 23:45, Galchin, Vasili wrote: I have forgotten about RS232 protocol. Can I just reads and writes from the RS232 device from an application to handle data? Or do I need to handle RS232 protocol events in the application? Usually the OS handles protocol events, although you have to tell it what kind of events matter (carrier? does it use hardware flow control, ^S/^Q, or ETX/ACK?) I suggest heading to MSDN and digging up documentation on how serial devices work on Windows. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
I already looked at MSDN examples and am not seriously enccouraged ;^( Vasili On Thu, Feb 26, 2009 at 10:51 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 26, at 23:45, Galchin, Vasili wrote: I have forgotten about RS232 protocol. Can I just reads and writes from the RS232 device from an application to handle data? Or do I need to handle RS232 protocol events in the application? Usually the OS handles protocol events, although you have to tell it what kind of events matter (carrier? does it use hardware flow control, ^S/^Q, or ETX/ACK?) I suggest heading to MSDN and digging up documentation on how serial devices work on Windows. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
i.e. protocol events seem to leak into an application = yuck On Thu, Feb 26, 2009 at 10:57 PM, Galchin, Vasili vigalc...@gmail.comwrote: I already looked at MSDN examples and am not seriously enccouraged ;^( Vasili On Thu, Feb 26, 2009 at 10:51 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 26, at 23:45, Galchin, Vasili wrote: I have forgotten about RS232 protocol. Can I just reads and writes from the RS232 device from an application to handle data? Or do I need to handle RS232 protocol events in the application? Usually the OS handles protocol events, although you have to tell it what kind of events matter (carrier? does it use hardware flow control, ^S/^Q, or ETX/ACK?) I suggest heading to MSDN and digging up documentation on how serial devices work on Windows. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
On 2009 Feb 26, at 23:58, Galchin, Vasili wrote: i.e. protocol events seem to leak into an application = yuck On Thu, Feb 26, 2009 at 10:57 PM, Galchin, Vasili vigalc...@gmail.com wrote: I already looked at MSDN examples and am not seriously enccouraged ;^( So, next stop: look for a serial library in C (or C++ with appropriate wrappers) for Win32 and make an FFI binding for it. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ByteString questions
;^) On Thu, Feb 26, 2009 at 11:15 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 26, at 23:58, Galchin, Vasili wrote: i.e. protocol events seem to leak into an application = yuck On Thu, Feb 26, 2009 at 10:57 PM, Galchin, Vasili vigalc...@gmail.comwrote: I already looked at MSDN examples and am not seriously enccouraged ;^( So, next stop: look for a serial library in C (or C++ with appropriate wrappers) for Win32 and make an FFI binding for it. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe