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

ethSetPhyState

Valid for: CANoe DE • CANoe4SW DE Note: Please note that this functionality is hardware dependent:
  • VT6303 supports this functionality in channel-based and network-based access.
  • The VN-family (e.g. VN5640) supports this functionality only in network-based access.

Function Syntax

long ethSetPhyState(long channel, long phyState ); // form 1
long ethSetPhyState(long channel, long hwChannel, long phyState ); // form 2
long ethSetPhyState(ethernetPort port, long phyState ); // form 3

Description

Sets the PHY state. Note:
  • This function can be used only for PHY types supporting this feature like TJA-1101.
  • Form 1 and form 2 is only for channel-based access.
  • Form 3 is only for network-based access.
  • TC10 Sleep/Wakeup events can be sent with this function.

Parameters

  • channel: Ethernet channel number. Value range: 1..32
  • phyState:
    • 1: ePhyNormalState
    • 2: ePhySleepState
    • 3: ePhyPowerOffState
    • 5: ePhySleepLocalState
    Note: State 5 can only be set with 10Base-T1S TC10-capable modules.
  • hwChannel: Hardware channel number. Vector network interface must support more than 1 hardware channel to use. Value range: 1..16
  • port: Ethernet port. Only supported for network-based configurations and physical measurement ports.

Return Values

  • 0: Success
  • 1: Invalid channel or port.
  • 2: Failed

Example

on key 's'
{
  ethSetPhyState(ethernetPort::MyNetworkName::MyPortName, 2 /*ePhySleepState*/);
}

on key 'n'
{
  ethSetPhyState(ethernetPort::MyNetworkName::MyPortName, 1 /*ePhyNormalState*/);
}
ethGetPhyState