EtherNet/IP™ Adapter  1.04.06
User Reference Manual

◆ EI_API_ADP_setHostName()

uint32_t EI_API_ADP_setHostName ( T pAdp_p,
const char *  pHostName_p 
)

Set the host name (Instance Attribute ID: 6).

Function that sets the host name of the adapter selected by parameter pAdp_p.

Remarks
The maximum length of the host name is set to 64. If parameter pHostName_p exceeds 64 characters it will be truncated before being written to the internal adapter structures and a warning EI_API_ADP_eERR_LENGTH is returned.
Parameters
[in]pAdp_pPointer to the adapter.
[in]pHostName_pPointer to new host name as NULL terminated cstring.
Returns
EI_API_ADP_EError_t as uint32_t value.
Return values
EI_API_ADP_eERR_OKSuccess.
EI_API_ADP_eERR_GENERALGeneral error.
EI_API_ADP_eERR_LENGTHIllegal parameter length, parameter pHostName_p is truncated.
Example
#include <api/EI_API.h>
EI_API_ADP_T* pEI_API_ADP = NULL;
uint32_t errCode;
uint8_t numInterfaces = 1;
pEI_API_ADP = EI_API_ADP_new(numInterfaces);
errCode = EI_API_ADP_setHostName(pEI_API_ADP, "MyHostName");
See also
EI_API_ADP_getHostName EI_API_ADP_EError_t
EI_API_ADP_setHostName
ETHIP_API uint32_t EI_API_ADP_setHostName(T *pAdp_p, const char *pHostName_p)
Set the host name (Instance Attribute ID: 6).
Definition: EI_API_ADP_main.c:4049
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