Skip to main content
Open topic with navigation CAPL Functions » Ethernet » Function Overview » IP_Address::SetAddressAsArray

IP_Address::SetAddressAsArray

Valid for: CANoe DE • CANoe4SW DE

Method Syntax

  • long IP_Address::SetAddressAsArray(byte ipAddr[]); // form 1
  • long IP_Address::SetAddressAsArray(char ipAddr[]); // form 2

Description

Copies the byte array to the IP address value.

Parameters

Return Values

  • 0: Success
  • 1: Array size is neither four nor sixteen

Example

on start
{
  byte addrData[16] = { 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
  IP_Address addr;

  if(addr.SetAddressAsArray( addrData ) == 0)
  {
    // do something with addrData
  }
}