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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: USBTMC, Can't get device capability and Can't clear buffers |
From: | Eric Norum via Tech-talk <tech-talk at aps.anl.gov> |
To: | "(대학원생) 문석호 (물리학과)" <msh3069 at unist.ac.kr> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Mon, 18 Oct 2021 09:32:27 -0700 |
What version of libusb are you using? I see that there’s an error in the message generation code in drvAsynUSBTMC.c. I’ve committed the following fix which should be in the next ASYN release. Please apply it ind see what is printed when you run your test again. I suspect that there’s a permissions problem. I tried the drvAsynUSBTMC.c driver just now with a Rohde&Schwarz USBTMC oscilloscope and all seemed to work fine. eric@FlashyBook 220> diff -u drvAsynUSBTMC.c.orig drvAsynUSBTMC.c --- drvAsynUSBTMC.c.orig 2021-10-17 18:12:48.000000000 -0700 +++ drvAsynUSBTMC.c 2021-10-17 18:14:51.000000000 -0700 @@ -628,15 +628,19 @@ return asynError; } if (getCapabilities(pdpvt, pasynUser) != asynSuccess) { + char *msg = epicsStrDup(pasynUser->errorMessage); libusb_close(pdpvt->handle); epicsSnprintf(pasynUser->errorMessage, pasynUser->errorMessageSize, - "Can't get device capabilities: %s", pasynUser->errorMessage); + "Can't get device capabilities: %s", msg); + free(msg); return asynError; } if (clearBuffers(pdpvt, pasynUser) != asynSuccess) { + char *msg = epicsStrDup(pasynUser->errorMessage); libusb_close(pdpvt->handle); epicsSnprintf(pasynUser->errorMessage, pasynUser->errorMessageSize, - "Can't clear buffers: %s", pasynUser->errorMessage); + "Can't clear buffers: %s", msg); + free(msg); return asynError; } pdpvt->bulkInPacketFlags = 0;
|