My Project
Typedefs | Functions
devMrmBuf.h File Reference

C interface for data buffer sending and receiving. More...

#include <epicsTypes.h>

Go to the source code of this file.

Typedefs

typedef struct mrmBufferInfo mrmBufferInfo_t
 The buffer information data structure. More...
 
typedef void(* mrmBufRecievedCallback) (void *arg, epicsStatus status, epicsUInt32 length, const epicsUInt8 *buffer)
 Buffer received callback function. More...
 

Functions

mrmBufferInfo_t epicsShareFunc * mrmBufInit (const char *dev_name)
 Initialize buffer data structure. More...
 
epicsStatus epicsShareFunc mrmBufRxSupported (mrmBufferInfo_t *data)
 Checks whether receive buffer is supported. More...
 
epicsStatus epicsShareFunc mrmBufTxSupported (mrmBufferInfo_t *data)
 Checks whether transferring buffer is supported. More...
 
epicsStatus epicsShareFunc mrmBufEnable (mrmBufferInfo_t *data)
 Disable buffer sending logic. More...
 
epicsStatus epicsShareFunc mrmBufDisable (mrmBufferInfo_t *data)
 Disable buffer sending logic. More...
 
epicsStatus epicsShareFunc mrmBufMaxLen (mrmBufferInfo_t *data, epicsUInt32 *maxLength)
 Get maximum supported buffer length. More...
 
epicsStatus epicsShareFunc mrmBufSend (mrmBufferInfo_t *data, epicsUInt32 len, epicsUInt8 *buf)
 Send buffer data. More...
 
epicsStatus epicsShareFunc mrmBufRegCallback (mrmBufferInfo_t *data, mrmBufRecievedCallback callback, void *param)
 Register data receive callback function. More...
 

Detailed Description

C interface for data buffer sending and receiving.

Author
Jure Krasna jure..nosp@m.kras.nosp@m.na@co.nosp@m.syla.nosp@m.b.com

Typedef Documentation

◆ mrmBufferInfo_t

typedef struct mrmBufferInfo mrmBufferInfo_t

The buffer information data structure.

This structure holds references to receive and send classes for a specific device - either a receiver or a generator.

◆ mrmBufRecievedCallback

typedef void(* mrmBufRecievedCallback) (void *arg, epicsStatus status, epicsUInt32 length, const epicsUInt8 *buffer)

Buffer received callback function.

Parameters
argParameter which is assigned at callback registration
statusStatus of the receive action (0 = ok)
lengthLength of the buffer in bytes
bufferBuffer data

Function Documentation

◆ mrmBufInit()

mrmBufferInfo_t epicsShareFunc* mrmBufInit ( const char *  dev_name)

Initialize buffer data structure.

This function allocates and initializes the structure for use with other functions. Device name should correspond to the same name as is used when initializing EVR or EVG device with either mrmEv*SetupVME or mrmEv*SetupPCI functions / iocsh commands.

Parameters
dev_nameThe name of the device to use for buffer sending and receiving
Returns
Returns the structure pointer on success and NULL on failure.

References mrf::Object::getObject().

◆ mrmBufRxSupported()

epicsStatus epicsShareFunc mrmBufRxSupported ( mrmBufferInfo_t data)

Checks whether receive buffer is supported.

Since some devices (EVR or EVG) might only support transfer functionality this function allows you to check whether you can call all receive-related functions for this device.

Parameters
dataThe buffer information data structure
Returns
Returns 1 if supported, 0 if not and -1 if data is NULL.

◆ mrmBufTxSupported()

epicsStatus epicsShareFunc mrmBufTxSupported ( mrmBufferInfo_t data)

Checks whether transferring buffer is supported.

Since some devices (EVR or EVG) might only support receive functionality this function allows you to check whether you can call all transfer-related functions for this device.

Parameters
dataThe buffer information data structure
Returns
Returns 1 if supported, 0 if not and -1 if data is NULL.

◆ mrmBufEnable()

epicsStatus epicsShareFunc mrmBufEnable ( mrmBufferInfo_t data)

Disable buffer sending logic.

Enables data buffer logic for both transfer and receive functionality. This is already called by the enable record so it is only needed if the records for buffer enabling are not present.

Parameters
dataThe buffer information data structure
Returns
Returns 0 on success -1 on failure.

◆ mrmBufDisable()

epicsStatus epicsShareFunc mrmBufDisable ( mrmBufferInfo_t data)

Disable buffer sending logic.

Disables data buffer logic for both transfer and receive functionality.

Parameters
dataThe buffer information data structure
Returns
Returns 0 on success -1 on failure.

◆ mrmBufMaxLen()

epicsStatus epicsShareFunc mrmBufMaxLen ( mrmBufferInfo_t data,
epicsUInt32 *  maxLength 
)

Get maximum supported buffer length.

Parameters
dataThe buffer information data structure
maxLengthMaximum buffer length in bytes
Returns
Returns 0 on success -1 on failure.

◆ mrmBufSend()

epicsStatus epicsShareFunc mrmBufSend ( mrmBufferInfo_t data,
epicsUInt32  len,
epicsUInt8 *  buf 
)

Send buffer data.

The function blocks until data is sent completely.

Parameters
dataThe buffer information data structure
lenBuffer length in bytes
bufArray of buffer data
Returns
Returns 0 on success -1 on failure.

◆ mrmBufRegCallback()

epicsStatus epicsShareFunc mrmBufRegCallback ( mrmBufferInfo_t data,
mrmBufRecievedCallback  callback,
void *  param 
)

Register data receive callback function.

Parameters
dataThe buffer information data structure
callbackCallback function to be registered
paramParameter which is passed to the calllback when it is executed
Returns
Returns 0 on success -1 on failure.