MessageAnalog

Summary

Represents an analog message, aggregates multiple measurement samples only a physical value and a timestamp

Methods
Properties
Events

Structure

class MessageAnalog
close_writer()

Closes the file previously created with open_writer(file).

open_writer(file: str, fileFormat: FILEFORMAT or None = None)

Creates a PCAP or PCAPNG file for writing the received messages. If the file already exists, it will be overwritten (old file data will be lost). Use the store() method to record received messages into the file.

Parameters
  • file (str) – Absolute path of the file where the messages will be stored

  • fileFormat (FILEFORMAT or None) – Obsolete, you don't need to specify this argument anymore

send() bool

Sends the message (the one used to call the method) through the Ethernet bus.

Returns

Returns True if the message is sent successfully. Otherwise, an exception will be thrown.

Return type

bool

start_capture(filter: Filter = None)

Used for online capture(capturing network traffic from an adapter). Used with callback function(on_message_received()) and stop_capture() method.

Parameters

filter (Filter) – Filter to use to narrow down packets to capture

start_capture(file: str, wait_eof: bool, filter: Filter = None)

Used for offline capture(reading packets from pcap or asc file). Used with callback function(on_message_received()) and stop_capture() method.

Parameters
  • file (str) – The trace file from where the messages will be read.

  • wait_eof (bool) – If True the function would block until all frames in the file are read. If False the function would read the frames in the background.

  • filter (Filter) – Filter to use to narrow down packets to capture

stop_capture()

Stops capturing Ethernet messages, either directly from the bus or from a trace file (depending on the version used to start the capture).

store()

Writes the message into the trace file opened with open_writer(file).

@on_capture_start

The event is triggered when the capture of Ethernet messages is started. See start_capture .

@on_capture_stop

The event is triggered when the capture of Ethernet messages is stopped. See stop_capture .

capture_info

General information about the context in which the message was captured from. None if the message was not captured

Type

CaptureInfo

data_base

Takes the database object.

Type

Database

frame_number

Number of the frame received, in the context of all the ethernet traffic captured.

Type

int64

payload

Content, in bytes, of the payload of the message.

Type

Array[uint8]

samples

Aggregation of multiple measured values

Type

Array[MeasurementSample]

timestamp

Timestamp of the message.

Type

decimal