1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Problems sending \x0 with devGpib driver |
From: | Dirk Zimoch <[email protected]> |
To: | Eric Norum <[email protected]> |
Cc: | "[email protected] talk" <[email protected]> |
Date: | Fri, 09 Nov 2012 14:29:13 +0100 |
On 08.11.2012 18:02, Eric Norum wrote:
Although not directly related to this thread, an issue I've encountered when attempting to write StreamDevice support for devices with "esoteric" command/reply formats is the inability to provide a custom conversion routine as provided by devGpib. I went digging through my (very) old e-mail messages and recovered this one proposing an addition to StreamDevice that would allow for user-supplied conversion code. It's still not quite as general a solution as that provided by the devGpib GPIBCVTIO support but it does allow for message format conversions beyond those provided by StreamDevice. Perhaps others might find this useful enough that it could be made part of the StreamDevice distribution. =============================================================================== New format string modifier<function_name>. For example, %<function_name>ld %<function_name>f %<function_name>lf Where function_name is the name of a conversion function [...]
Hi EricThis is quite similar to the checksum functions I already have implemented, and which use the %<...> format. And if I remember correctly, this was indeed based on your ideas.
Maybe I can modify this a bit in order to allow general user supplied functions. Checksums would then be a part of the user function model.
I have to think about this and play a bit.Escaping to user code is of course always "dangerous". You never know how much stack the call uses, if it blocks, if it throws exceptions etc.
Dirk