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

◆ PN_API_IOD_errorLogCbf

typedef void(* PN_API_IOD_errorLogCbf) (PN_API_IOD_Handle_t *const pnHandle, const uint32_t errorLevel)

Callback function prototype to indicate the need to log an error.

When the stack detects and error, it sends an error log indication to the application. The indication contains information about how critical the error is (error level), which is described by the values between PN_API_IOD_LOG_CHAT and PN_API_IOD_LOG_DEACTIVATED. The application then decides to take a corresponding action which can range from ignoring the error to completely shutting down Profinet service.

Parameters
[in]pnHandleProfinet API Handle.
[in]errorLevelLevel of the error.
Example
#include "pn_api_iod_callbacks.h"
#include "pn_api_iod_utils.h"
#include "pn_api_iod_startup.h"
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
//Store callback functions implemented by the user application
...}
//Register callback function
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_cbErrorLog(PN_API_IOD_Handle_t *const pnHandle, const uint32_t errorLevel)
Callback function to log an error.
PN_API_IOD_errorLogCbf errorLog
Definition pn_api_iod_callbacks.h:68
Structure representing a set of callbacks.
Definition pn_api_iod_callbacks.h:41