EtherNet/IP™ Adapter3.07.03

◆ EI_API_ADP_getIpConfig()

uint32_t EI_API_ADP_getIpConfig ( T *  pAdp,
EI_API_ADP_SCurrentIpData_t currentIpData 
)

Get current ip data.

This function delivers the current ip data also when the module runs in BOOTP or DHCP mode. These data are the IP address, the network mask, the gateway address, the addresses of nameServer1 and nameServer2 and the domain name.

Remarks
In case of BOOTP or DHCP mode the ip data are set to zero until a valid ip address is received.
Parameters
[in]pAdpPointer to the adapter.
[out]currentIpDataPointer to the current ip data.
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"
#include "EI_API_def.h"
char *methodName[3] = { "static", "bootp", "dhcp" };
EI_API_ADP_getCurrentIpData(pAdapter, &currentIpData);
OSAL_printf("confMethod %s ip %x mask %x gw %x ns1 %x ns2 %x domainname %s\r\n",
methodName[currentIpData.configurationMethod],
currentIpData.ipAddr, currentIpData.networkMask, currentIpData.gatewayAdress,
currentIpData.nameServer1, currentIpData.nameServer2, currentIpData.domainName);
EI_API_ADP_SCurrentIpData::domainName
char domainName[EI_API_CIP_DOMAIN_NAME_LENGTH+1]
Definition: EI_API_ADP_define.h:247
EI_API_ADP_SCurrentIpData::ipAddr
uint32_t ipAddr
Definition: EI_API_ADP_define.h:242
EI_API_ADP_SCurrentIpData::nameServer1
uint32_t nameServer1
Definition: EI_API_ADP_define.h:245
EI_API_ADP_SCurrentIpData::gatewayAdress
uint32_t gatewayAdress
Definition: EI_API_ADP_define.h:244
EI_API_ADP_SCurrentIpData::networkMask
uint32_t networkMask
Definition: EI_API_ADP_define.h:243
EI_API_ADP_SCurrentIpData
Definition: EI_API_ADP_define.h:239
EI_API_ADP_SCurrentIpData::nameServer2
uint32_t nameServer2
Definition: EI_API_ADP_define.h:246
EI_API_ADP_SCurrentIpData::configurationMethod
EIP_EConfigurationMethod_t configurationMethod
Definition: EI_API_ADP_define.h:241