Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
Typedefs | Functions

Functions handling I/O requests. More...

Collaboration diagram for I/O Request Handler Functions:

Typedefs

typedef void(* pptxIoRqCompletion_t) (struct ptxIoRq *ioRq, void *cplUpperLayer, void *data, size_t dataLength, ptxStatus_t cplStatus)
 I/O Completion Callback.
 

Functions

ptxStatus_t ptxIoRq_Init (ptxIoRq_t *ioCpl)
 Initialise the I/O Request Structure.
 
ptxStatus_t ptxIoRq_Push (ptxIoRq_t *ioCpl, pptxIoRqCompletion_t ioCompletionFn, void *ioData, size_t ioDataLength, void *ioCompletionComp)
 Push a new stack location to the I/O request object.
 
ptxStatus_t ptxIoRq_Pop (ptxIoRq_t *ioCpl, pptxIoRqCompletion_t *ioCompletionFn, void **ioData, size_t *ioDataLength, void **ioCompletionComp)
 Pop the next stack location from the I/O request object.
 
ptxStatus_t ptxIoRq_CallCompletion (pptxIoRqCompletion_t followingCompletion, struct ptxIoRq *ioRq, void *cplUpperLayer, void *data, size_t dataLength, ptxStatus_t cplStatus)
 I/O Completion Callback Invocation Helper.
 
ptxStatus_t ptxIoRq_PopCallCompletion (struct ptxIoRq *ioRq, struct ptxLog *logComp, void *ioData, size_t ioDataLength, ptxStatus_t cplStatus)
 Pop next item and call following completion.
 
ptxStatus_t ptxIoRq_SetPoolItem (ptxIoRq_t *ioRqItem, ptxBufferPool_Item_t *bufferItem)
 Set buffer item linked to the IO RQ object.
 
ptxBufferPool_Item_tptxIoRq_GetPoolItem (ptxIoRq_t *ioRqItem)
 Get buffer item linked to the IO RQ object.
 
ptxStatus_t ptxFifo_IoRq_Get (ptxFifoIoRq_t *fifoIoRq, ptxIoRq_t **ioRq)
 Get the entry of the FIFO that stores I/O requests.
 

Detailed Description

Functions handling I/O requests.

Typedef Documentation

◆ pptxIoRqCompletion_t

typedef void(* pptxIoRqCompletion_t) (struct ptxIoRq *ioRq, void *cplUpperLayer, void *data, size_t dataLength, ptxStatus_t cplStatus)

I/O Completion Callback.

Parameters
[in]ioRqPointer to the I/O request object.
[in]cplUpperLayerPointer to a component further up the stack.
[in]dataPointer to data to be process on the completion function.
[in]dataLengthLength of the data to be processed on the completion function.
[in]cplStatusStatus of the I/O completion.

Function Documentation

◆ ptxFifo_IoRq_Get()

ptxStatus_t ptxFifo_IoRq_Get ( ptxFifoIoRq_t * fifoIoRq,
ptxIoRq_t ** ioRq )

Get the entry of the FIFO that stores I/O requests.

This function provides the caller with a pointer to the first IORQ object available in the FIFO. The caller assumes that this pointer has been properly allocated before.

Parameters
[in]fifoIoRqPointer to the structure of the FIFO.
[out]ioRqDouble Pointer to the IO RQ that will get it.
Returns
Status of the operation. See definition of ptxStatus_t.

◆ ptxIoRq_CallCompletion()

ptxStatus_t ptxIoRq_CallCompletion ( pptxIoRqCompletion_t followingCompletion,
struct ptxIoRq * ioRq,
void * cplUpperLayer,
void * data,
size_t dataLength,
ptxStatus_t cplStatus )

I/O Completion Callback Invocation Helper.

Parameters
[in]followingCompletionPointer to the upper layer completion function.
[in]ioRqPointer to the I/O request object.
[in]cplUpperLayerPointer to a component further up the stack.
[in]dataPointer to data to be processed on the completion function.
[in]dataLengthLength of the data to be processed on the completion function.
[in]cplStatusStatus of the I/O completion.
Returns
Status of the operation. See definition of ptxStatus_t.

◆ ptxIoRq_GetPoolItem()

ptxBufferPool_Item_t * ptxIoRq_GetPoolItem ( ptxIoRq_t * ioRqItem)

Get buffer item linked to the IO RQ object.

Parameters
[in]ioRqItemAllocated and initialized item of ptxIoRq_t.
Returns
Buffer pool item linked to the IO RQ. NULL in case of an error.

◆ ptxIoRq_Init()

ptxStatus_t ptxIoRq_Init ( ptxIoRq_t * ioCpl)

Initialise the I/O Request Structure.

Initializes the IORQ. Requires an already-allocated IORQ object. Call this function before starting the use of the IORQ.

Parameters
[in]ioCplPointer to the I/O Completion structure.
Returns
Status of the operation. See definition of ptxStatus_t.

◆ ptxIoRq_Pop()

ptxStatus_t ptxIoRq_Pop ( ptxIoRq_t * ioCpl,
pptxIoRqCompletion_t * ioCompletionFn,
void ** ioData,
size_t * ioDataLength,
void ** ioCompletionComp )

Pop the next stack location from the I/O request object.

The I/O Request Structure will provide the next stack location through this function: When calling up the stack for completion each caller of the next higher layer will call this function to get the location of the upper layer from the stack of the used I/O Request object. The caller (top layer) will deallocate or return to a pool the I/O Request object.

Parameters
[in]ioCplPointer to the I/O Completion structure.
[out]ioCompletionFnPointer to a location that will receive the completion function pointer of the next component.
[out]ioDataPointer to data to be handled by completion function.
[out]ioDataLengthPointer of the Length of data to be handled by completion function.
[out]ioCompletionCompPointer to the component further up in the stack.
Returns
Status of the operation. See definition of ptxStatus_t.

◆ ptxIoRq_PopCallCompletion()

ptxStatus_t ptxIoRq_PopCallCompletion ( struct ptxIoRq * ioRq,
struct ptxLog * logComp,
void * ioData,
size_t ioDataLength,
ptxStatus_t cplStatus )

Pop next item and call following completion.

The function pops the next item and calls following completion. Data can be provided via the parameters. Alternatively, using a special, reserved value for data length, the function takes the data from the I/O request item.

Parameters
[in]ioRqPointer to the I/O request object.
[in]logCompPointer to a logger component.
[in]ioDataPointer to data to be processed in the completion function. May be NULL.
[in]ioDataLengthLength of the data to be processed in the completion function. May be 0. The special value PTX_IORQ_DATA_POP lets the function take the data from the I/O request item (through POP). Otherwise data is supplied via the parameters.
[in]cplStatusStatus of the I/O completion.
Returns
Status of the operation. See definition of ptxStatus_t.

◆ ptxIoRq_Push()

ptxStatus_t ptxIoRq_Push ( ptxIoRq_t * ioCpl,
pptxIoRqCompletion_t ioCompletionFn,
void * ioData,
size_t ioDataLength,
void * ioCompletionComp )

Push a new stack location to the I/O request object.

The I/O Request Structure will receive a new stack location by this function: The caller allocates/reserves a new I/O request object. When calling down the stack each layer will call this function to put its location and reference on the stack within the I/O Request Object used for the call and referenced by the first parameter.

Parameters
[in]ioCplPointer to the I/O Completion structure.
[in]ioCompletionFnPointer to the completion function of the current component.
[in]ioDataPointer to data to be used by completion function in the response path for thi IO Request.
[in]ioDataLengthLength of data to be handled by completion function.
[in]ioCompletionCompPointer to the current component.
Returns
Status of the operation. See definition of ptxStatus_t.

◆ ptxIoRq_SetPoolItem()

ptxStatus_t ptxIoRq_SetPoolItem ( ptxIoRq_t * ioRqItem,
ptxBufferPool_Item_t * bufferItem )

Set buffer item linked to the IO RQ object.

Parameters
[in]ioRqItemAllocated and initialized item of ptxIoRq_t.
[in]bufferItemAllocated and initialized buffer pool item to set ioRqItem.
Returns
Status of the operation. See definition of ptxStatus_t.