port_state
Utility functions for PTP port states.
Functions:
-
diagnose_port_state–Diagnose a given port state enum value.
-
port_state_name–Return the canonical name for the given port state enum value.
-
port_state_value–Return the enum value for the given canonical port state name.
diagnose_port_state
diagnose_port_state(state: ValueType) -> DiagTree
Diagnose a given port state enum value.
For valid operational states, the diagnostic tree is of type Ok. For transient states
and invalid states, the diagnostic tree is of type Error.
Specifically, the state is only Ok if the port state is PS_MASTER, PS_SLAVE,
PS_DISABLED, PS_PASSIVE, or PS_GRAND_MASTER.
Parameters:
-
state(ValueType) –The port state enum value to diagnose
Returns:
port_state_name
port_state_name(state: ValueType) -> str
Return the canonical name for the given port state enum value.
port_state_value
port_state_value(name: str) -> ValueType
Return the enum value for the given canonical port state name.