asyn icon indicating copy to clipboard operation
asyn copied to clipboard

Problems with error checking in asynPortDriver functions

Open MarkRivers opened this issue 4 years ago • 0 comments

In asynPortDriver.cpp most of the asynPortDriver::writeXXX() methods do this:

 /* Set the parameter in the parameter library. */
    status = (asynStatus) setXXXParam(addr, function, ...);

    /* Do callbacks so higher layers see any changes */
    status = (asynStatus) callParamCallbacks(addr, addr);

    if (status)

whereas asynPortDriver::writeFloat64() does this:

    /* Set the parameter and readback in the parameter library. */
    status = setDoubleParam(addr, function, value);

    /* Do callbacks so higher layers see any changes */
    callParamCallbacks(addr, addr);
    if (status)

I see problems in both versions: In the first case the status from the setXXXParam() call is being discarded; in the second the status from callParamCallbacks() is lost. Whatever the correct behavior should be I would expect all the types to implement the same error handling.

MarkRivers avatar May 28 '21 17:05 MarkRivers