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

◆ PN_API_IOD_registerCallbacks()

uint32_t PN_API_IOD_registerCallbacks ( PN_API_IOD_Handle_t *const  pnHandle,
PN_API_IOD_Callbacks_t callbacksInst 
)

Register callback functions.

Register callback functions implemented by the user application.

Parameters
[in]pnHandleProfinet API Handle.
[in]callbacksInstList of implemented callback function names.
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_startup.h"
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
.setStationName = PN_APP_IOD_cbSetStationName,
.setIpAddr = PN_APP_IOD_cbSetIpAddr,
... }
status = PN_API_IOD_registerCallbacks(pnHandle, &callbacks);
PN_API_IOD_Handle_t * PN_API_IOD_new(void)
Creates Profinet API handle.
uint32_t PN_API_IOD_registerCallbacks(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_Callbacks_t *callbacksInst)
Register callback functions.
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
void PN_APP_IOD_cbArConnectInd(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_ArType_t arType, uint32_t arNum, uint16_t arSessionKey, uint16_t sendClock, uint16_t redRatioIoCrIn, uint16_t redRatioIoCrOut, uint32_t hostIp)
Callback function prototype to notify that a new connection to an IO controller has been established.
PN_API_IOD_arConnectCbf arConnect
Definition pn_api_iod_callbacks.h:42
Structure representing a set of callbacks.
Definition pn_api_iod_callbacks.h:41