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

◆ PN_API_IOD_recordReadResponse()

uint32_t PN_API_IOD_recordReadResponse ( PN_API_IOD_Handle_t *const  pnHandle,
void *  requestHandle,
uint8_t *  data,
uint32_t  dataLength,
PN_API_IOD_ErrState_t pnioStat 
)

Responds to an asynchronous record read request.

If the record read request from the IO controller is to be handled asynchronously, the user application needs to use this function to send the record read 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]dataData provided by the user application.
[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
uint8_t *userData;
uint32_t userDataLength;
//Fill up userData, userDataLength, pnioStat. Then:
status = PN_API_IOD_recordReadResponse(pnHandle, asyncHandle,
userData, 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_recordReadResponse(PN_API_IOD_Handle_t *const pnHandle, void *requestHandle, uint8_t *data, uint32_t dataLength, PN_API_IOD_ErrState_t *pnioStat)
Responds to an asynchronous record read 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