PDU messages tutorial

Get the list of PDU from ethernet message using scripting environment

#example code for getting the list of pdu from ethernet message
from andi.autosar import SocketAdaptor
adaptor = SocketAdaptor()
eth_message = message_builder.create_udp_message()
data = System.Array[Byte](bytearray.fromhex('a7 f2 a6 3d 00 40 9f 42 00 00 00 b8 00 00 00 08 a2 e8 bf ff 00 14'\
         '00 00 00 00 01 bb 00 00 00 20 2b 0d 00 fe 07 00 00 28 fe 07 fe 10 00 00 00 00 00'\
         '00 00 00 00 00 00 00 00 00 00 00 00 09 00 3f '))

@adaptor.transform
def on_msg_eth_received(pdu):
        print(pdu)
eth_message.on_message_received += on_msg_eth_received
eth_message.set_bytes(data)
eth_message.start_capture()
eth_message.send()