ISIS Logo
NetShrVar
An EPICS support module to export National Instruments Network Shared Variables as process variables
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
NetShrVarDriver Class Reference

EPICS Asyn port driver class. More...

#include <NetShrVarDriver.h>

Inheritance diagram for NetShrVarDriver:
Inheritance graph

Public Member Functions

 NetShrVarDriver (NetShrVarInterface *netvarint, int poll_ms, const char *portName)
 Constructor for the NetShrVarDriver class. More...
 
virtual asynStatus writeInt32 (asynUser *pasynUser, epicsInt32 value)
 
virtual asynStatus writeFloat64 (asynUser *pasynUser, epicsFloat64 value)
 write a float to the driver More...
 
virtual asynStatus writeOctet (asynUser *pasynUser, const char *value, size_t maxChars, size_t *nActual)
 
virtual asynStatus writeInt8Array (asynUser *pasynUser, epicsInt8 *value, size_t nElements)
 
virtual asynStatus writeInt16Array (asynUser *pasynUser, epicsInt16 *value, size_t nElements)
 
virtual asynStatus writeInt32Array (asynUser *pasynUser, epicsInt32 *value, size_t nElements)
 
virtual asynStatus writeFloat32Array (asynUser *pasynUser, epicsFloat32 *value, size_t nElements)
 
virtual asynStatus writeFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements)
 
virtual asynStatus readInt32 (asynUser *pasynUser, epicsInt32 *value)
 
virtual asynStatus readFloat64 (asynUser *pasynUser, epicsFloat64 *value)
 
virtual asynStatus readOctet (asynUser *pasynUser, char *value, size_t maxChars, size_t *nActual, int *eomReason)
 
virtual asynStatus readFloat32Array (asynUser *pasynUser, epicsFloat32 *value, size_t nElements, size_t *nIn)
 
virtual asynStatus readFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements, size_t *nIn)
 
virtual asynStatus readInt8Array (asynUser *pasynUser, epicsInt8 *value, size_t nElements, size_t *nIn)
 
virtual asynStatus readInt16Array (asynUser *pasynUser, epicsInt16 *value, size_t nElements, size_t *nIn)
 
virtual asynStatus readInt32Array (asynUser *pasynUser, epicsInt32 *value, size_t nElements, size_t *nIn)
 
virtual void report (FILE *fp, int details)
 EPICS driver report function for iocsh dbior command. More...
 
int pollTime ()
 
void updateValues ()
 
void shuttingDown (bool state)
 
bool shuttingDown ()
 

Static Public Member Functions

static void epicsExitFunc (void *arg)
 

Private Member Functions

asynStatus readValue (asynUser *pasynUser, const char *functionName)
 
template<typename T >
asynStatus writeValue (asynUser *pasynUser, const char *functionName, T value)
 write a value to the driver More...
 
template<typename T >
asynStatus writeArrayValue (asynUser *pasynUser, const char *functionName, T *value, size_t nElements)
 write an array to the driver More...
 
template<typename T >
asynStatus readArrayValue (asynUser *pasynUser, const char *functionName, T *value, size_t nElements, size_t *nIn)
 

Static Private Member Functions

static void NetShrVarTask (void *arg)
 

Private Attributes

NetShrVarInterfacem_netvarint
 
int m_poll_ms
 
bool m_shutting_down
 

Detailed Description

EPICS Asyn port driver class.

Definition at line 19 of file NetShrVarDriver.h.

Constructor & Destructor Documentation

NetShrVarDriver::NetShrVarDriver ( NetShrVarInterface netvarint,
int  poll_ms,
const char *  portName 
)

Constructor for the NetShrVarDriver class.

Calls constructor for the asynPortDriver base class and sets up driver parameters.

Parameters
[in]netvarintinterface pointer created by NetShrVarConfigure()
[in]poll_msThe name of the asyn driver port we will create.
[in]portNamepoll period (ms) for BufferedReaders

Definition at line 357 of file NetShrVarDriver.cpp.

References NetShrVarInterface::createParams(), driverName, epicsExitFunc(), m_netvarint, and NetShrVarTask().

Member Function Documentation

void NetShrVarDriver::epicsExitFunc ( void *  arg)
static

Definition at line 389 of file NetShrVarDriver.cpp.

References shuttingDown().

Referenced by NetShrVarDriver().

void NetShrVarDriver::NetShrVarTask ( void *  arg)
staticprivate

Definition at line 400 of file NetShrVarDriver.cpp.

References pollTime(), shuttingDown(), and updateValues().

Referenced by NetShrVarDriver().

int NetShrVarDriver::pollTime ( )
inline

Definition at line 42 of file NetShrVarDriver.h.

References m_poll_ms.

Referenced by NetShrVarTask().

template<typename T >
asynStatus NetShrVarDriver::readArrayValue ( asynUser *  pasynUser,
const char *  functionName,
T *  value,
size_t  nElements,
size_t *  nIn 
)
private
asynStatus NetShrVarDriver::readFloat32Array ( asynUser *  pasynUser,
epicsFloat32 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Definition at line 257 of file NetShrVarDriver.cpp.

References readArrayValue().

asynStatus NetShrVarDriver::readFloat64 ( asynUser *  pasynUser,
epicsFloat64 *  value 
)
virtual

Definition at line 149 of file NetShrVarDriver.cpp.

References driverName, and readValue().

asynStatus NetShrVarDriver::readFloat64Array ( asynUser *  pasynUser,
epicsFloat64 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Definition at line 252 of file NetShrVarDriver.cpp.

References readArrayValue().

asynStatus NetShrVarDriver::readInt16Array ( asynUser *  pasynUser,
epicsInt16 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Definition at line 267 of file NetShrVarDriver.cpp.

References readArrayValue().

asynStatus NetShrVarDriver::readInt32 ( asynUser *  pasynUser,
epicsInt32 *  value 
)
virtual

Definition at line 166 of file NetShrVarDriver.cpp.

References driverName, and readValue().

asynStatus NetShrVarDriver::readInt32Array ( asynUser *  pasynUser,
epicsInt32 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Definition at line 262 of file NetShrVarDriver.cpp.

References readArrayValue().

asynStatus NetShrVarDriver::readInt8Array ( asynUser *  pasynUser,
epicsInt8 *  value,
size_t  nElements,
size_t *  nIn 
)
virtual

Definition at line 272 of file NetShrVarDriver.cpp.

References readArrayValue().

asynStatus NetShrVarDriver::readOctet ( asynUser *  pasynUser,
char *  value,
size_t  maxChars,
size_t *  nActual,
int *  eomReason 
)
virtual

Definition at line 183 of file NetShrVarDriver.cpp.

References driverName, and readValue().

asynStatus NetShrVarDriver::readValue ( asynUser *  pasynUser,
const char *  functionName 
)
private

Definition at line 76 of file NetShrVarDriver.cpp.

References driverName, m_netvarint, and NetShrVarInterface::readValue().

Referenced by readFloat64(), readInt32(), and readOctet().

void NetShrVarDriver::report ( FILE *  fp,
int  details 
)
virtual

EPICS driver report function for iocsh dbior command.

Definition at line 335 of file NetShrVarDriver.cpp.

References m_netvarint, and NetShrVarInterface::report().

void NetShrVarDriver::shuttingDown ( bool  state)
inline

Definition at line 48 of file NetShrVarDriver.h.

References m_shutting_down.

Referenced by epicsExitFunc(), and NetShrVarTask().

bool NetShrVarDriver::shuttingDown ( )
inline

Definition at line 49 of file NetShrVarDriver.h.

References m_shutting_down.

void NetShrVarDriver::updateValues ( )
inline

Definition at line 43 of file NetShrVarDriver.h.

References m_netvarint, and NetShrVarInterface::updateValues().

Referenced by NetShrVarTask().

template<typename T >
asynStatus NetShrVarDriver::writeArrayValue ( asynUser *  pasynUser,
const char *  functionName,
T *  value,
size_t  nElements 
)
private

write an array to the driver

Template Parameters
TData type of value
Parameters
[in]pasynUserpointer to AsynUser instance
[in]functionNameName of overloaded ASYN driver function that called us, used for diagnostics
[in]valueValue to write
[in]nElementsnumber of array elements

Definition at line 107 of file NetShrVarDriver.cpp.

References driverName, m_netvarint, and NetShrVarInterface::setArrayValue().

Referenced by writeFloat32Array(), writeFloat64Array(), writeInt16Array(), writeInt32Array(), and writeInt8Array().

asynStatus NetShrVarDriver::writeFloat32Array ( asynUser *  pasynUser,
epicsFloat32 *  value,
size_t  nElements 
)
virtual

Definition at line 329 of file NetShrVarDriver.cpp.

References writeArrayValue().

asynStatus NetShrVarDriver::writeFloat64 ( asynUser *  pasynUser,
epicsFloat64  value 
)
virtual

write a float to the driver

Parameters
[in]pasynUserpointer to AsynUser instance
[in]valueValue to write

Definition at line 137 of file NetShrVarDriver.cpp.

References writeValue().

asynStatus NetShrVarDriver::writeFloat64Array ( asynUser *  pasynUser,
epicsFloat64 *  value,
size_t  nElements 
)
virtual

Definition at line 324 of file NetShrVarDriver.cpp.

References writeArrayValue().

asynStatus NetShrVarDriver::writeInt16Array ( asynUser *  pasynUser,
epicsInt16 *  value,
size_t  nElements 
)
virtual

Definition at line 314 of file NetShrVarDriver.cpp.

References writeArrayValue().

asynStatus NetShrVarDriver::writeInt32 ( asynUser *  pasynUser,
epicsInt32  value 
)
virtual

Definition at line 143 of file NetShrVarDriver.cpp.

References writeValue().

asynStatus NetShrVarDriver::writeInt32Array ( asynUser *  pasynUser,
epicsInt32 *  value,
size_t  nElements 
)
virtual

Definition at line 309 of file NetShrVarDriver.cpp.

References writeArrayValue().

asynStatus NetShrVarDriver::writeInt8Array ( asynUser *  pasynUser,
epicsInt8 *  value,
size_t  nElements 
)
virtual

Definition at line 319 of file NetShrVarDriver.cpp.

References writeArrayValue().

asynStatus NetShrVarDriver::writeOctet ( asynUser *  pasynUser,
const char *  value,
size_t  maxChars,
size_t *  nActual 
)
virtual

Definition at line 221 of file NetShrVarDriver.cpp.

References driverName, m_netvarint, and NetShrVarInterface::setValue().

template<typename T >
asynStatus NetShrVarDriver::writeValue ( asynUser *  pasynUser,
const char *  functionName,
value 
)
private

write a value to the driver

Template Parameters
Tdata type of value
Parameters
[in]pasynUserpointer to AsynUser instance
[in]functionNameName of overloaded ASYN driver function that called us, used for diagnostics
[in]valueValue to write

Definition at line 49 of file NetShrVarDriver.cpp.

References convertToString(), driverName, m_netvarint, and NetShrVarInterface::setValue().

Referenced by writeFloat64(), and writeInt32().

Member Data Documentation

NetShrVarInterface* NetShrVarDriver::m_netvarint
private
int NetShrVarDriver::m_poll_ms
private

Definition at line 53 of file NetShrVarDriver.h.

Referenced by pollTime().

bool NetShrVarDriver::m_shutting_down
private

Definition at line 54 of file NetShrVarDriver.h.

Referenced by shuttingDown().


The documentation for this class was generated from the following files:
Copyright © 2013 Science and Technology Facilities Council | Generated by   doxygen 1.8.5