sonar/layers/ethernet.py
def stream(self, thread, interface, stream_mode="frame", endian="little"):
        """
        Stream data over an interface as part of a thread

        Args:
            thread (Thread): Thread to stream in
            interface (BaseInterface): An interface that supports streaming
            stream_mode (str, optional): frame|payload. Defaults to "frame".
            endian (str, optional): little|big. Defaults to "little".
        """
        # TODO add support for x to validate reading partial words
        if stream_mode == "frame":
            frame = (
                self.get_field("mac_dst").value
                + self.get_field("mac_src").value
                + self.get_field("ether_type").value
                + self.payload
            )
        elif stream_mode == "payload":
            frame = self.payload
        else:
            raise NotImplementedError
        interface.data_to_stream(thread, frame, endian=endian)

        Stream data over an interface as part of a thread

        Args:
            thread (Thread): Thread to stream in
            interface (BaseInterface): An interface that supports streaming
            stream_mode (str, optional): frame|payload. Defaults to "frame".
            endian (str, optional): little|big. Defaults to "little".
        
Stream data over an interface as part of a thread
Stream data over an interface as part of a thread
def stream(self, thread, interface, stream_mode="frame", endian="little"):
        if stream_mode == "frame":
            frame = (
                self.get_field("mac_dst").value
                + self.get_field("mac_src").value
                + self.get_field("ether_type").value
                + self.payload
            )
        elif stream_mode == "payload":
            frame = self.payload
        else:
            raise NotImplementedError
        interface.data_to_stream(thread, frame, endian=endian)
def stream ( self , thread , interface , stream_mode = "frame" , endian = "little" ) : if stream_mode == "frame" : frame = ( self . get_field ( "mac_dst" ) . value + self . get_field ( "mac_src" ) . value + self . get_field ( "ether_type" ) . value + self . payload ) elif stream_mode == "payload" : frame = self . payload else : raise NotImplementedError interface . data_to_stream ( thread , frame , endian = endian )
Stream data over an interface as part of a thread
Stream data over an interface as part of a thread
"""
        Stream data over an interface as part of a thread

        Args:
            thread (Thread): Thread to stream in
            interface (BaseInterface): An interface that supports streaming
            stream_mode (str, optional): frame|payload. Defaults to "frame".
            endian (str, optional): little|big. Defaults to "little".
        """ # TODO add support for x to validate reading partial words
self
thread
Thread to stream in
Thread to stream in
interface
An interface that supports streaming
An interface that supports streaming
stream_mode
frame|payload. Defaults to "frame".
frame|payload . Defaults to " frame " .
"frame"
endian
little|big. Defaults to "little".
little|big . Defaults to " little " .
"little"