EtherNet/IP™ Adapter3.09.00
 
Loading...
Searching...
No Matches

◆ EI_API_ADP_setModuleNetworkStatusFunc()

uint32_t EI_API_ADP_setModuleNetworkStatusFunc ( T *  pAdp_p,
EI_API_ADP_CBStatus  callback_p 
)

Handle module and network status changes.

This function is used to register a callback function which will be triggered if the adapter status (network or module) changes. The knowledge of the adapter status enables the user to set Network Status and Module Status indicators.

Parameters
[in]pAdp_pPointer to the adapter.
[in]callback_pCallback function of EI_API_ADP_CBStatus type.
Returns
EI_API_ADP_EError_t as uint32_t value.
Return values
EI_API_ADP_eERR_OKSuccess.
EI_API_ADP_eERR_GENERALGeneral error.
Example
#include "EI_API.h"
void cbStatus(EI_API_ADP_T* pAdp_p, EI_API_ADP_SModNetStatus_t status_p)
{
printf("Module status: %d\n", status_p.mod);
printf("Network status: %d\n", status_p.net);
}
void registerStatusCallback()
{
uint32_t errCode;
// Set callback for status replies
EI_API_ADP_CBStatus ptr_cb = cbStatus;
errCode = EI_API_ADP_setModuleNetworkStatusFunc(pEI_API_ADP, ptr_cb);
}
ETHIP_API uint32_t EI_API_ADP_setModuleNetworkStatusFunc(T *pAdp_p, EI_API_ADP_CBStatus callback_p)
Handle module and network status changes.
Definition EI_API_ADP_stub.c:533
void(* EI_API_ADP_CBStatus)(EI_API_ADP_T *pAdp_p, EI_API_ADP_SModNetStatus_t status_p)
Function prototype for adapter status (MS, NS) callback function.
Definition EI_API_def.h:459
EI_API_ADP_EStatus_t mod
Definition EI_API_def.h:197
EI_API_ADP_EStatus_t net
Definition EI_API_def.h:198
General adapter status collection.
Definition EI_API_def.h:196
See also
EI_API_ADP_CBStatus EI_API_ADP_getModuleNetworkStatus EI_API_ADP_SModNetStatus_t EI_API_ADP_EError_t