Libtrap: Internal development docs  1.16.1
Functions
Collaboration diagram for File_receiver:

Functions

int file_recv (void *priv, void *data, uint32_t *size, int timeout)
 Read data from a file. More...
 
char * file_recv_ifc_get_id (void *priv)
 
uint8_t file_recv_ifc_is_conn (void *priv)
 
int create_file_recv_ifc (trap_ctx_priv_t *ctx, const char *params, trap_input_ifc_t *ifc, uint32_t idx)
 Allocate and initiate file input interface. This function is called by TRAP library to initialize one input interface. More...
 

Detailed Description

Function Documentation

◆ create_file_recv_ifc()

int create_file_recv_ifc ( trap_ctx_priv_t ctx,
const char *  params,
trap_input_ifc_t ifc,
uint32_t  idx 
)

Allocate and initiate file input interface. This function is called by TRAP library to initialize one input interface.

Parameters
[in,out]ctxPointer to the private libtrap context data (trap_ctx_init()).
[in]paramsConfiguration string containing file_name, where file_name is a path to a file from which data is to be read
[in,out]ifcIFC interface used for calling file module.
[in]idxIndex of IFC that is created.
Returns
0 on success (TRAP_E_OK), TRAP_E_MEMORY, TRAP_E_BADPARAMS on error

Definition at line 432 of file ifc_file.c.

◆ file_recv()

int file_recv ( void *  priv,
void *  data,
uint32_t *  size,
int  timeout 
)

Read data from a file.

Parameters
[in]privpointer to module private data
[out]datapointer to a memory block in which data is to be stored
[out]sizepointer to a memory block in which size of read data is to be stored
[in]timeoutNOT USED IN THIS INTERFACE
Returns
0 on success (TRAP_E_OK), TRAP_E_IO_ERROR if error occurs during reading, TRAP_E_TERMINATED if interface was terminated.

Definition at line 309 of file ifc_file.c.

◆ file_recv_ifc_get_id()

char* file_recv_ifc_get_id ( void *  priv)

Definition at line 404 of file ifc_file.c.

◆ file_recv_ifc_is_conn()

uint8_t file_recv_ifc_is_conn ( void *  priv)

Definition at line 409 of file ifc_file.c.