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

on ethernetPhyState

Valid for: CANoe DE • CANoe4SW DE Note
This callback is only available in network-based configurations.

Function Syntax

  • on ethernetPhyState *; // form 1
  • on ethernetPhyState ethernetPort::<NetworkName>::<PortName>; // form 2

Description

The event procedure is called on the change of the state of an Ethernet PHY or if a relevant PHY activity has been triggered. To access the control information you would use selectors. The key word this is available within an on ethernetPhyState procedure, to access the information of the PHY state and event type.

Parameters

  • ethernetPort::<NetworkName>::<PortName>: Ethernet port qualification.

Selectors

  • hwPort: Port associated with the PHY. Type: ethernetPort. Access Limitation: network-based access only.
  • time_ns: Time stamp of the PHY event. Type: int64. Access Limitation: read only.
  • phystate:
    • 1: Normal state
    • 2: Sleep state
    • 3: PowerOff state
    • 4: SleepRequest state
    • 5: ePhySleepLocalState
    • 6: ePhySleepLocalRequestState Type: int32. Access Limitation: read only.
  • eventtype:
    • 1: Sleep received
    • 2: Sleep sent
    • 3: Sleep abort
    • 4: Sleep ACK received
    • 5: Sleep forwarded
    • 8: Wakeup received
    • 9: Wakeup sent
    • 10: Wakeup forwarded
    • 17: Power Off
    • 18: Power On
    • 25: PHY activated
    • 26: Sleep confirmed
    • 27: Local Sleep Requested Type: int32. Access Limitation: read only.

Example

on ethernetPhyState *
{
  ethernetport myPort;
  myPort = this.hwPort;
  switch(this.phyState)
  {
    case 1:
      write("Ethernet PHY on %s is in normal state", this.name);
      break;
    case 2:
      write("Ethernet PHY on %s is in sleep state", this.portname);
      break;
    case 3:
      write("Ethernet PHY %s of segment %s is in powerOff state",
      myPort.name, myPort.segmentName);
      break;
    case 4:
      write("Ethernet PHY on %s is in sleep_request state", myPort.name);
      break;
  }
}
ethGetPhyStateethSetPhyState