예제 #1
0
    def wait_for_transmit_complete(self, timeout=10):
        # type: (float) -> None
        """Wait for transmition to complete.

        All frames written for the session have been transmitted on the bus.
        This condition applies to CAN, LIN, and FlexRay. This condition is state
        based, and the state is Boolean (true/false).

        Args:
            timeout(float): The maximum amount of time to wait in seconds.
        """
        _funcs.nx_wait(self._handle, constants.Condition.TRANSMIT_COMPLETE, 0, timeout)
예제 #2
0
    def wait_for_intf_remote_wakeup(self, timeout=10):
        # type: (float) -> None
        """Wait for interface remote wakeup.

        Wait for the interface to wakeup due to activity by a remote node on the
        network. This wait is used for CAN, when you set the 'can_tcvr_state'
        property to 'constants.CanTcvrState.SLEEP'. Although the interface
        itself is ready to communicate, this places the transceiver into a sleep
        state. When a remote CAN node transmits a frame, the transceiver wakes
        up, and communication is restored. This wait detects that remote wakeup.

        This wait is used for LIN when you set 'lin_sleep' property to
        'constants.LinSleep.REMOTE_SLEEP' or 'constants.LinSleep.LOCAL_SLEEP'.
        When asleep, if a remote LIN ECU transmits the wakeup pattern (break),
        the XNET LIN interface detects this transmission and wakes up. This wait
        detects that remote wakeup.

        Args:
            timeout(float): The maximum amount of time to wait in seconds.
        """
        _funcs.nx_wait(self._handle, constants.Condition.INTF_REMOTE_WAKEUP, 0, timeout)
예제 #3
0
    def wait_for_intf_communicating(self, timeout=10):
        """Wait for the interface to begin communication on the network.

        If a start trigger is configured for the interface, this first waits for
        the trigger. Once the interface is started, this waits for the
        protocol's communication state to transition to a value that indicates
        communication with remote nodes.

        After this wait succeeds, calls to 'read_state' will return:
            :any:`nixnet._enums.CanCommState`: 'constants.CAN_COMM.ERROR_ACTIVE'

            :any:`nixnet._enums.CanCommState`: 'constants.CAN_COMM.ERROR_PASSIVE'

            'constants.ReadState.TIME_COMMUNICATING': Valid time for communication (invalid time of 0 prior)

        Args:
            timeout: A float representing the maximum amount of time to wait in
                seconds.
        """
        _funcs.nx_wait(self._handle, constants.Condition.INTF_COMMUNICATING, 0,
                       timeout)
예제 #4
0
 def wait_for_intf_remote_wakeup(self, timeout=10):
     _funcs.nx_wait(self._handle, constants.Condition.INTF_REMOTE_WAKEUP, 0,
                    timeout)
예제 #5
0
 def wait_for_intf_communicating(self, timeout=10):
     _funcs.nx_wait(self._handle, constants.Condition.INTF_COMMUNICATING, 0,
                    timeout)
예제 #6
0
 def wait_for_transmit_complete(self, timeout=10):
     _funcs.nx_wait(self._handle, constants.Condition.TRANSMIT_COMPLETE, 0,
                    timeout)