PROFINET Device4.2.0
 
Loading...
Searching...
No Matches

◆ PN_API_IOD_recordWriteResponse()

uint32_t PN_API_IOD_recordWriteResponse ( PN_API_IOD_Handle_t *const  pnHandle,
void *  requestHandle,
uint32_t  dataLength,
PN_API_IOD_ErrState_t pnioStat 
)

Responds to an asynchronous record write request.

If the record write request from the IO controller is to be handled asynchronously, the user application needs to use this function to send the record write response message to the IO controller. The stack expects this function only when PN_API_IOD_recordSetResponseAsync() is used.

Parameters
[in]pnHandleProfinet API Handle.
[in]requestHandleRequest handle obtained from PN_API_IOD_recordSetResponseAsync().
[in]dataLengthLength of provided data.
[in]pnioStatProfinet status.
Returns
result of the operation as uint32_t.
Return values
PN_API_OKSuccess.
PN_API_NOT_OKSomething went wrong.
PN_API_ERR_PARAMInvalid parameter.
Example
#include "pn_api_iod_record.h"
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
//Within the implementation of record read/write callback function
void* asyncHandle = NULL;
status = PN_API_IOD_recordSetResponseAsync(pnHandle, &asyncHandle);
//Later in the user application
uint32_t userDataLength;
//Fill up userDataLength, pnioStat. Then:
status = PN_API_IOD_recordWriteResponse(pnHandle, asyncHandle,
userDataLength, &pnioStat);
PN_API_IOD_Handle_t * PN_API_IOD_new(void)
Creates Profinet API handle.
uint32_t PN_API_IOD_recordSetResponseAsync(PN_API_IOD_Handle_t *const pnHandle, void **requestHandle)
Informs Profinet stack that data provisioning will happen asynchronously.
uint32_t PN_API_IOD_recordWriteResponse(PN_API_IOD_Handle_t *const pnHandle, void *requestHandle, uint32_t dataLength, PN_API_IOD_ErrState_t *pnioStat)
Responds to an asynchronous record write request.
struct PN_API_IOD_Handle PN_API_IOD_Handle_t
API handle instance which holds IO device's info.
Definition pn_api_iod_types.h:61
Definition pn_api_iod_types.h:740