EtherNet/IP™ Adapter  1.04.06
User Reference Manual

◆ EI_API_ADP_new()

T* EI_API_ADP_new ( uint8_t  numInterfaces_p)

Create a new EtherNet/IP adapter.

All adapter related API functions require an ADP object as input parameter. The ADP object (or a pointer to it) is created by this function.

Warning
Currently only one adapter interface is supported (numInterfaces_p = 1). Note that the API function EI_API_ADP_new() shall be called only once. If called multiple times, always the pointer to the initially created adapter is returned.
Remarks
The adapter pointer returned by this function is a mandatory parameter of all other API adapter functions.
Parameters
[in]numInterfaces_pNumber of network interfaces of the EthetNet/IP adapter. One interface has 2 Ethernet ports as one ring pair.
Value range: 1.
Returns
Pointer EI_API_ADP_T* to the newly created adapter. In case of an error NULL is returned.
Example
#include <api/EI_API.h>
// Adapter pointer
EI_API_ADP_T* pEI_API_ADP = NULL;
uint8_t numInterfaces = 1;
// Create an adapter with one interface
pEI_API_ADP = EI_API_ADP_new(numInterfaces);
See also
EI_API_ADP_delete EI_API_ADP_init
EI_API_ADP_new
ETHIP_API T * EI_API_ADP_new(uint8_t numInterfaces_p)
Create a new EtherNet/IP adapter.
Definition: EI_API_ADP_main.c:235