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

IP_Address::GetAddressAsArray

Valid for: CANoe DE • CANoe4SW DE

Method Syntax

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

Description

Copies the current IP address to the byte array whereas the byte array’s size needs to fit the current IP address value.

Parameters

Return Values

  • 0: Success
  • 1: Array size does not fit the current IP address
  • 2: Object has not been set to a valid address

Example

on start
{
  IP_Address FC00::0001 addr;
  byte addrData[16];

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