> The solution was to include “asynDrvUserMask” as part of the interface mask in the base class constructor even though
> I am not using drvUserCreate method (But I am using pasynOctetSyncIO).
> This was the call to the base class constructor:
> asynPortDriver(port_name, 255, asynInt32Mask | asynFloat64Mask | asynDrvUserMask,
> 0, ASYN_CANBLOCK | ASYN_MULTIDEVICE, 1, 0, 0)
> So what is the purpose of this interface?
The asynDrvUser interface is used to parse the drvInfo string in the record link string:
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))SCOPE_VOLT_OFFSET")
In the above example SCOPE_VOLT_OFFSET is the drvInfo string.
In the asynPortDriver base class implementation that string is converted to the integer pasynUser->reason. But your driver can override that method to handle the drvInfo string differently.
The drvUser interface is optional, although it is needed if your driver will handle multiple parameters, which nearly all drivers do.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Abdalla Ahmad
via Tech-talk <tech-talk at aps.anl.gov>
Sent: Sunday, April 25, 2021 3:42 AM
To: tech-talk at aps.anl.gov
Subject: Purpose of the asynDrvUserMask interface
Hi
I am working on a driver based on asynPortDriver interface, the problem is that this statement
int function = pasynUser->reason;
Will always return 0 no matter which parameter string I pass in the INP field. The solution was to include “asynDrvUserMask” as part of the interface mask in the base class constructor
even though I am not using drvUserCreate method (But I am using pasynOctetSyncIO). This was the call to the base class constructor:
asynPortDriver(port_name, 255, asynInt32Mask | asynFloat64Mask | asynDrvUserMask, 0, ASYN_CANBLOCK | ASYN_MULTIDEVICE, 1, 0, 0)
So what is the purpose of this interface?
Best Regards,
Abdalla