My Project
|
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... | |
C interface for data buffer sending and receiving.
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.
typedef void(* mrmBufRecievedCallback) (void *arg, epicsStatus status, epicsUInt32 length, const epicsUInt8 *buffer) |
Buffer received callback function.
arg | Parameter which is assigned at callback registration |
status | Status of the receive action (0 = ok) |
length | Length of the buffer in bytes |
buffer | Buffer data |
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.
dev_name | The name of the device to use for buffer sending and receiving |
References mrf::Object::getObject().
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.
data | The buffer information data structure |
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.
data | The buffer information data structure |
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.
data | The buffer information data structure |
epicsStatus epicsShareFunc mrmBufDisable | ( | mrmBufferInfo_t * | data | ) |
Disable buffer sending logic.
Disables data buffer logic for both transfer and receive functionality.
data | The buffer information data structure |
epicsStatus epicsShareFunc mrmBufMaxLen | ( | mrmBufferInfo_t * | data, |
epicsUInt32 * | maxLength | ||
) |
Get maximum supported buffer length.
data | The buffer information data structure |
maxLength | Maximum buffer length in bytes |
epicsStatus epicsShareFunc mrmBufSend | ( | mrmBufferInfo_t * | data, |
epicsUInt32 | len, | ||
epicsUInt8 * | buf | ||
) |
Send buffer data.
The function blocks until data is sent completely.
data | The buffer information data structure |
len | Buffer length in bytes |
buf | Array of buffer data |
epicsStatus epicsShareFunc mrmBufRegCallback | ( | mrmBufferInfo_t * | data, |
mrmBufRecievedCallback | callback, | ||
void * | param | ||
) |
Register data receive callback function.
data | The buffer information data structure |
callback | Callback function to be registered |
param | Parameter which is passed to the calllback when it is executed |