Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion documentation/pvaDriverDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ <h2 id="Configuration">
<pre>int pvaDriverConfig(const char *portName, const char *pvName,
int maxSizeX, int maxSizeY, int dataType,
int maxBuffers, size_t maxMemory,
int priority, int stackSize)
int priority, int stackSize, int pvaQueueSize)
</pre>
<p>
The pvaDriver-specific fields in this command are:</p>
<ul>
<li><code>pvName</code> Name of the PV to be monitored.</li>
<li><code>pvaQueueSize</code> The size of the queueSize parameter for the PVAccess request (optional).</li>
</ul>
<p>
For details on the meaning of the other parameters to this function refer to the
Expand Down
24 changes: 15 additions & 9 deletions pvaDriverApp/src/pvaDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
#include <epicsExport.h>
#include "pvaDriver.h"

//#define DEFAULT_REQUEST "record[queueSize=100]field()"
#define DEFAULT_REQUEST "field()"
#define PVA_REQUEST_SIZE 128

using namespace std;
using namespace epics::pvData;
Expand Down Expand Up @@ -53,11 +52,11 @@ static const char *driverName = "pvaDriver";
* ASYN_CANBLOCK is set in asynFlags.
*/
pvaDriver::pvaDriver (const char *portName, const char *pvName,
int maxBuffers, size_t maxMemory, int priority, int stackSize)
int maxBuffers, size_t maxMemory, int priority, int stackSize, const char *pvaRequest)

: ADDriver(portName, 1, NUM_PVA_DRIVER_PARAMS, maxBuffers, maxMemory, 0, 0, ASYN_CANBLOCK, 1,
priority, stackSize),
m_pvName(pvName), m_request(DEFAULT_REQUEST),
m_pvName(pvName), m_request(pvaRequest),
m_priority(ChannelProvider::PRIORITY_DEFAULT),
m_channel(), m_pvRequest(CreateRequest::create()->createRequest(m_request)),
m_thisPtr(tr1::shared_ptr<pvaDriver>(this))
Expand Down Expand Up @@ -454,9 +453,15 @@ void pvaDriver::report (FILE *fp, int details)

/** Configuration command, called directly or from iocsh */
extern "C" int pvaDriverConfig (const char *portName, char *pvName,
int maxBuffers, int maxMemory, int priority, int stackSize)
int maxBuffers, int maxMemory, int priority, int stackSize, int pvaQueueSize=0)
{
new pvaDriver(portName, pvName, maxBuffers, maxMemory, priority, stackSize);
char pvaRequest[PVA_REQUEST_SIZE] = {0};
if (pvaQueueSize <= 0) {
snprintf(pvaRequest, PVA_REQUEST_SIZE, "field()");
} else {
snprintf(pvaRequest, PVA_REQUEST_SIZE, "record[queueSize=%d]field()", pvaQueueSize);
}
new pvaDriver(portName, pvName, maxBuffers, maxMemory, priority, stackSize, pvaRequest);
return(asynSuccess);
}

Expand All @@ -467,17 +472,18 @@ static const iocshArg pvaDriverConfigArg2 = {"maxBuffers", iocshArgInt};
static const iocshArg pvaDriverConfigArg3 = {"maxMemory", iocshArgInt};
static const iocshArg pvaDriverConfigArg4 = {"priority", iocshArgInt};
static const iocshArg pvaDriverConfigArg5 = {"stackSize", iocshArgInt};
static const iocshArg pvaDriverConfigArg6 = {"pvaQueueSize", iocshArgInt};
static const iocshArg * const pvaDriverConfigArgs[] = {
&pvaDriverConfigArg0, &pvaDriverConfigArg1, &pvaDriverConfigArg2,
&pvaDriverConfigArg3, &pvaDriverConfigArg4, &pvaDriverConfigArg5};
&pvaDriverConfigArg3, &pvaDriverConfigArg4, &pvaDriverConfigArg5, &pvaDriverConfigArg6};

static const iocshFuncDef configpvaDriver = {"pvaDriverConfig", 6,
static const iocshFuncDef configpvaDriver = {"pvaDriverConfig", 7,
pvaDriverConfigArgs};

static void configpvaDriverCallFunc (const iocshArgBuf *args)
{
pvaDriverConfig(args[0].sval, args[1].sval, args[2].ival, args[3].ival,
args[4].ival, args[5].ival);
args[4].ival, args[5].ival, args[6].ival);
}

static void pvaDriverRegister (void)
Expand Down
2 changes: 1 addition & 1 deletion pvaDriverApp/src/pvaDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class epicsShareClass pvaDriver : public ADDriver,

public:
pvaDriver (const char *portName, const char *pvName, int maxBuffers,
size_t maxMemory, int priority, int stackSize);
size_t maxMemory, int priority, int stackSize, const char *pvaRequest);

// Overriden from ADDriver:
asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
Expand Down