TECMP messages tutorial

Get Capture Module Status from a Tecmp Capture Module Status message.

#example code for getting capture module status from ethernet message
from andi.tecmp import get_cm_status
eth_message = message_builder.create_ethernet_message()
data = System.Array[Byte](bytearray.fromhex('01 00 5e 00 00 00 00 50 c2 e4 30 00 99 fe'\
         '00 40 12 06 01 01 00 80 00 00 00 0f'\
         '00 00 00 0a 80 00 00 00 b8 39 20 c0 00 24 00 00'\
         '0c'\
         '01'\
         '08'\
         '00'\
         '00 17'\
         'ff 00'\
         '71 fb a0 8d'\
         '00'\
         '0c 06 fd'\
         '03 01'\
         '00'\
         '00'\
         '00 00 00 08'\
         '00 00 00 10 13 dd b9 77'\
         '0b'\
         '1e'\
         '14'\
         '14'))

eth_message.set_bytes(data)
cm_status = get_cm_status(eth_message)
print(cm_status.vendor_data.temperature)

Get Bus Status from a Tecmp Bus Status message.

#example code for getting bus status from ethernet message
from andi.tecmp import get_bus_status
eth_message = message_builder.create_ethernet_message()
data = System.Array[Byte](bytearray.fromhex('10 00 5e 00 00 00 00 50 c2 e4 30 00 99 fe'\
         '00 40 12 06 01 02 00 80 00 00 00 0f'\
         '00 00 00 0a 80 00 00 00 b8 39 20 c0 00 2c 00 00'\
         '0c'\
         '01'\
         '08'\
         '00'\
         '00 04'\
         'ff 00'\
         '71 fb a0 8d'\
         '00 00 00 01'\
         '00 00 00 00'\
         '00 00 00 00'\
         '00'\
         '01'\
         '00 00'\
         '00 00 00 02'\
         '00 00 00 00'\
         '00 00 00 00'\
         '00'\
         '02'\
         '00 00'))

eth_message.set_bytes(data)
bus_status = get_bus_status(eth_message)
print(bus_status.bus_data[0].vendor_data.link_quality)

Get Control Message Data from a Tecmp Control message.

#example code for getting control message event id from ethernet message
from andi.tecmp import get_control_data
eth_message = message_builder.create_ethernet_message()
data = System.Array[Byte](bytearray.fromhex('01 00 5e 00 00 00 00 50 c2 e4 30 00 99 fe'\
        '00 40 12 06 01 00 00 80 00 00 00 0f'\
        '00 00 00 0a 80 00 00 00 b8 39 20 c0 00 24 00 00'\
        '00 30'\
        '00 10'\
        '0c'\
        '01'\
        '08'\
        '00'\
        '00 04'\
        'ff 00'\
        '71 fb a0 8d'\
        '00 00 00 01'\
        '00 00 00 00'\
        '00 00 00 00'\
        '00'\
        '01'\
        '00 00'\
        '00 00 00 02'\
        '00 00 00 00'\
        '00 00 00 00'\
        '00'\
        '02'\
        '00 00'))

eth_message.set_bytes(data)
control_data = get_control_data(eth_message)
print(control_data.device_id)
print(control_data.control_message_id)
print(control_data.timestamp)
print(control_data.vendor_data)