|
|
Experimental Physics and
| ||||||||||||||||
|
|
I like #2. I think this patch ought to do it. It seems that the upstream tpmac project is not on Github, who should I submit this to?Bruno On Thu, Feb 15, 2018 at 12:37 PM, Mark Rivers <[email protected]> wrote:
diff --git a/pmacApp/pmacAsynMotorPortSrc/pmacController.cpp b/pmacApp/pmacAsynMotorPortSrc/pmacController.cpp
index 36cc123..aba5b37 100644
--- a/pmacApp/pmacAsynMotorPortSrc/pmacController.cpp
+++ b/pmacApp/pmacAsynMotorPortSrc/pmacController.cpp
@@ -322,23 +322,19 @@ asynStatus pmacController::lowLevelWriteRead(const char *command, char *response
//Use the controller-wide param PMAC_C_CommsError_
getIntegerParam(PMAC_C_CommsError_, &commsError);
- status = pasynOctetSyncIO->writeRead(lowLevelPortUser_ ,
+ if (!commsError) {
+ status = pasynOctetSyncIO->writeRead(lowLevelPortUser_ ,
command, strlen(command),
response, PMAC_MAXBUF_,
PMAC_TIMEOUT_,
&nwrite, &nread, &eomReason );
- if (status) {
- asynInterface *pasynInterface = pasynManager->findInterface(lowLevelPortUser_,
- asynCommonType, true);
- asynCommon *pasynCommon = (asynCommon*) pasynInterface->pinterface;
-
- asynPrint(lowLevelPortUser_, ASYN_TRACE_ERROR, "%s: Error from pasynOctetSyncIO->writeRead. command: %s, status=%d\n", functionName, command, status);
- setIntegerParam(PMAC_C_CommsError_, PMAC_ERROR_);
- pasynCommon->disconnect(pasynInterface->drvPvt, lowLevelPortUser_);
-
- } else {
- setIntegerParam(PMAC_C_CommsError_, PMAC_OK_);
+ if (status) {
+ asynPrint(lowLevelPortUser_, ASYN_TRACE_ERROR, "%s: Error from pasynOctetSyncIO->writeRead. command: %s\n", functionName, command);
+ setIntegerParam(PMAC_C_CommsError_, PMAC_ERROR_);
+ } else {
+ setIntegerParam(PMAC_C_CommsError_, PMAC_OK_);
+ }
}
asynPrint(lowLevelPortUser_, ASYN_TRACEIO_DRIVER, "%s: response: %s\n", functionName, response);
| ||||||||||||||||
| ANJ, 15 Feb 2018 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |