Skip to main content
Open topic with navigation CAPL Functions » Ethernet » Function Overview » ethGetLinkStatus

ethGetLinkStatus

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

  • long ethGetLinkStatus( long channel ); // form 1
  • long ethGetLinkStatus( long channel, long hwChannel ); // form 2
  • long ethGetLinkStatus( ethernetPort port ); // form 3

Description

Returns the link status of the channel.

Parameters

  • channel: Ethernet channel number. Value range: 1..32
  • hwChannel: Hardware channel number. Vector network interface must support more than 1 hardware channel to use. Value range: 1..16
  • port: Ethernet port, described by network name and port name.

Return Values

  • 0: Link down
  • 1: Link up
  • -1: Read link status failed

Example

Example 1
on key 'i'
{
  write("Link status has the value: %d", ethGetLinkStatus(1));
}
Example 2
on key 'i'
{
  write("Link status has the value: %d", ethGetLinkStatus(ethernetPort::MyNetworkName::MyPortName));
}
See Also