CANalyze.Messages

CANalyze.MessagesModule

The module provides the Message type that bundles signals.

CANalyze.Messages.MessageType
Message

Messages model bundles of signals and enable the decoding of multiple signals. Additionally, messages are defined using the number of bytes (dlc), a message name (name), and the internal signals (signals).

Fields

  • dlc::UInt8: the number of required bytes
  • name::String: the name of the message
  • signals::Dict{String, Signals.NamedSignal}: a mapping of string
Base.getMethod
Base.get(message::Message, key::String, default)

Returns the signal with the name key inside message if a signal with such a name exists, otherwise we return default.

Arguments

  • message::Message: the message
  • key::String: the index, i.e., the name of the signal we want to retrieve
  • default: a default value
Base.getindexMethod
Base.getindex(message::Message, index::String) -> Signals.NamedSignal

Returns the signal with the name index inside message.

Arguments

  • message::Message: the message
  • index::String: the index, i.e., the name of the signal we want to retrieve

Throws

  • KeyError: the signal with the name index does not exist inside message
Base.iterateMethod
Base.iterate(iter::Message, state)

Enables the iteration over the inside dictionary signals.

Arguments

  • iter::Message: the message
  • state: the state of the iterator
Base.iterateMethod
Base.iterate(iter::Message)

Enables the iteration over the inside dictionary signals.

Arguments

  • iter::Message: the message
CANalyze.Messages.dlcMethod
dlc(message::Message) -> UInt8

Returns the number of bytes that the message requires and operates on.

Arguments

  • message::Message: the message
CANalyze.Messages.nameMethod
name(message::Message) -> String

Returns the message name.

Arguments

  • message::Message: the message