flync_4_signal

The flync_4_signal module contains the building blocks for describing communication data at every level of abstraction: from individual Signals (raw bit-level data elements), through PDUs (Protocol Data Units that group signals), up to Frames (the protocol-specific transport units that carry PDUs on a bus).

Expand for Schematic
        classDiagram

    class SignalDataType {
        <<Enumeration>>
        UINT8: str = 'uint8'
        UINT16: str = 'uint16'
        UINT32: str = 'uint32'
        UINT64: str = 'uint64'
        INT8: str = 'int8'
        INT16: str = 'int16'
        INT32: str = 'int32'
        INT64: str = 'int64'
        FLOAT32: str = 'float32'
        FLOAT64: str = 'float64'
        CHAR: str = 'char'
        BYTEARRAY: str = 'bytearray'
    }

    class SignalInstance {
        bit_position: int | None = None
        update_indication_bit_position: int | None = None
        endianness: Literal['BE', 'LE'] = 'LE'
        signal: Signal
    }

    class SignalGroup {
        name: str
        description: str | None = None
        signals: list[Signal]
    }

    class SignalGroupInstance {
        bit_position: int | None = None
        update_indication_bit_position: int | None = None
        endianness: Literal['BE', 'LE'] = 'LE'
        signal_group: SignalGroup
    }

    class Signal {
        name: str
        description: str | None = None
        bit_length: int
        data_type: SignalDataType
        factor: float = 1.0
        offset: float = 0.0
        lower_limit: float | None = None
        upper_limit: float | None = None
        unit: str | None = None
        initial_value: float | int | bytes | str | None = None
        value_descriptions: list[ValueDescription] = list
    }

    class FLYNCBaseModel {
    }

    class ValueDescription {
        value: int
        description: str
    }

    class InstancePlacement {
        bit_position: int | None = None
        update_indication_bit_position: int | None = None
        endianness: Literal['BE', 'LE'] = 'LE'
    }

    Signal ..> bytes
    Signal ..> ValueDescription
    Signal ..> SignalDataType
    SignalInstance ..> Signal
    SignalGroup ..> Signal
    SignalGroupInstance ..> SignalGroup


    

Signal

A Signal is the smallest data element in FLYNC. It describes a physical or logical value that is transmitted on a bus, including how raw bits are scaled and interpreted. Signals are bus-agnostic: the same signal definition can be reused across CAN, LIN, or Ethernet transport layers.

Signals are not placed directly into PDUs; instead a SignalInstance wraps a signal with its placement information (bit offset and byte order).

class SignalDataType

Bases: str, Enum

Supported signal base data types for CAN, LIN, FlexRay, and Ethernet.

UINT8 = 'uint8'
UINT16 = 'uint16'
UINT32 = 'uint32'
UINT64 = 'uint64'
INT8 = 'int8'
INT16 = 'int16'
INT32 = 'int32'
INT64 = 'int64'
FLOAT32 = 'float32'
FLOAT64 = 'float64'
CHAR = 'char'
BYTEARRAY = 'bytearray'
natural_bit_width() int | None

Canonical bit width for this type. Size for single element for char and bytearray.

is_float() bool

Return True for float types (float32, float64).

is_unsigned_integer() bool

Return True for unsigned integer types.

is_signed_integer() bool

Return True for signed integer types.

is_complex_datattype() bool

Return True for complex datatypes.

class Signal

Bases: FLYNCBaseModel

Logical or physical data element transmitted within a communication message.

Parameters

namestr

Name of the signal.

descriptionstr, optional

Optional textual description of the signal.

bit_lengthint

Length of the signal in bits.

data_typeSignalDataType

Base data type of the signal.

factorfloat

Multiplication factor applied to the raw value to obtain the physical value. Defaults to 1.0.

offsetfloat

Additive offset applied after scaling to obtain the physical value. Defaults to 0.0.

lower_limitfloat, optional

Minimum physical value of the signal.

upper_limitfloat, optional

Maximum physical value of the signal.

unitstr, optional

Physical unit of the signal (e.g. "km/h", "°C").

initial_valuefloat | int | bytes | str, optional

Optional initial value of the signal at startup.

value_descriptionslist of ValueDescription

Discrete value-to-label mappings for enumerated signals.

class ValueDescription

Bases: FLYNCBaseModel

Mapping from a raw integer value to a human-readable label.

Parameters

valueint

The raw integer value of the signal.

descriptionstr

Human-readable label for this value (e.g. "Off", "Active").

class InstancePlacement

Bases: FLYNCBaseModel

Shared placement metadata for signal and signal-group instances within a PDU.

Parameters

bit_positionint, optional

Non-negative bit offset in the PDU.

update_indication_bit_positionint, optional

Bit position used to indicate that the value has been updated.

endiannessLiteral[“BE”, “LE”]

Byte order for this instance. Defaults to "little_endian".

class SignalInstance

Bases: InstancePlacement

Placement of a Signal at a specific bit offset within a PDU.

Parameters

signalSignal

Signal being instantiated.

Signal Groups

A SignalGroup collects several signals that are always transmitted together. A SignalGroupInstance places the entire group at a single bit offset within a PDU, analogous to how SignalInstance places a single signal.

class SignalGroup

Bases: FLYNCBaseModel

A reusable group of signals transmitted together within a PDU.

Parameters

namestr

Name of the signal group.

descriptionstr, optional

Optional textual description of the group.

signalslist of Signal

Non-empty list of signal definitions contained in this group.

class SignalGroupInstance

Bases: InstancePlacement

Placement of a SignalGroup at a specific bit offset within a PDU.

Parameters

signal_groupSignalGroup

Signal group being instantiated.

PDU

A PDU (Protocol Data Unit) is the container that groups signals for transmission. PDUs are defined independently of any specific bus and stored in general/channels/pdus/. A PDUInstance then places a named PDU at a given bit offset inside a frame.

Expand for Schematic
        classDiagram

    class ContainedPDURef {
        pdu_id: int
        pdu_ref: str
        offset: int | None = 0
    }

    class UniqueName {
        name: str
    }

    class PDU {
        name: str
        length: int
        pdu_usage: str | None = None
        description: str | None = None
    }

    class ContainerPDU {
        name: str
        length: int
        pdu_usage: str | None = None
        description: str | None = None
        type: Literal['container'] = 'container'
        pdu_id: int
        header: ContainerPDUHeader
        contained_pdus: list[ContainedPDURef] = list
    }

    class MultiplexedPDU {
        name: str
        length: int
        pdu_usage: str | None = None
        description: str | None = None
        type: Literal['multiplexed'] = 'multiplexed'
        selector_signal: SignalInstance
        static_group: StandardPDU | None = None
        mux_groups: list[MuxGroup] = list
    }

    class SignalInstance {
        bit_position: int | None = None
        update_indication_bit_position: int | None = None
        endianness: Literal['BE', 'LE'] = 'LE'
        signal: Signal
    }

    class StandardPDU {
        name: str
        length: int
        pdu_usage: str | None = None
        description: str | None = None
        type: Literal['standard'] = 'standard'
        signals: list[SignalInstance] = list
        signal_groups: list[SignalGroupInstance] = list
    }

    class PDUInstance {
        pdu_ref: str
        bit_position: int | None = None
        update_bit_position: int | None = None
    }

    class SignalGroupInstance {
        bit_position: int | None = None
        update_indication_bit_position: int | None = None
        endianness: Literal['BE', 'LE'] = 'LE'
        signal_group: SignalGroup
    }

    class FLYNCBaseModel {
    }

    class ContainerPDUHeader {
        id_length_bits: int
        length_field_bits: int
    }

    class MuxGroup {
        selector_value: int
        pdu: StandardPDU
    }

    SignalGroupInstance ..> SignalGroup
    SignalInstance ..> Signal
    StandardPDU ..> SignalGroupInstance
    StandardPDU ..> SignalInstance
    MuxGroup ..> StandardPDU
    MultiplexedPDU ..> StandardPDU
    MultiplexedPDU ..> MuxGroup
    MultiplexedPDU ..> SignalInstance
    ContainerPDU ..> ContainedPDURef
    ContainerPDU ..> ContainerPDUHeader


    

There are three PDU types, distinguished by the type discriminator field:

type

Description

standard

Non-multiplexed PDU containing a flat list of signal (group) instances.

multiplexed

PDU with a selector signal; the active signal group depends on its value.

container

Ethernet Container PDU that packs several other PDUs into one payload.

class PDU

Bases: UniqueName

Protocol Data Unit base class.

Parameters

namestr

Unique name of the PDU.

lengthint

Length of the PDU payload in bytes.

pdu_usagestr, optional

Optional string describing the usage of the PDU.

descriptionstr, optional

Optional human-readable description.

Standard PDU

Expand for a YAML example - 📄 general/channels/pdus/PDU_EngineStatus.flync.yaml

Note

Each PDU is stored in its own .flync.yaml file under general/channels/pdus/. This directory is optional and may be omitted when no PDUs are defined.

name: PDU_EngineStatus
type: standard
length: 8
description: >-
  Engine speed, torque, coolant temperature and operating state.
  Transmitted cyclically at 10 ms by EngineECU on PowertrainCAN.

signals:
  - bit_position: 0
    endianness: LE

    signal:
      name: EngineSpeed
      description: Crankshaft rotational speed.
      bit_length: 16
      data_type: uint16
      factor: 0.25
      offset: 0.0
      lower_limit: 0.0
      upper_limit: 16383.75
      unit: rpm
      value_descriptions:
        - value: 65535
          description: Signal_Not_Available
  - bit_position: 16
    endianness: LE

    signal:
      name: EngineTorque
      description: Indicated engine torque at crankshaft.
      bit_length: 16
      data_type: int16
      factor: 0.1
      offset: -3276.8
      lower_limit: -3276.8
      upper_limit: 3276.7
      unit: Nm
  - bit_position: 32
    endianness: LE

    signal:
      name: EngineCoolantTemp
      description: Engine coolant temperature.
      bit_length: 8
      data_type: uint8
      factor: 1.0
      offset: -40.0
      lower_limit: -40.0
      upper_limit: 215.0
      unit: degC
      value_descriptions:
        - value: 254
          description: Sensor_Error
        - value: 255
          description: Signal_Not_Available
  - bit_position: 40
    endianness: LE

    signal:
      name: EngineStatus
      description: Engine operating state.
      bit_length: 4
      data_type: uint8
      value_descriptions:
        - value: 0
          description: Stopped
        - value: 1
          description: Cranking
        - value: 2
          description: Running
        - value: 3
          description: Stall
        - value: 15
          description: Error
class StandardPDU

Bases: PDU

Non-multiplexed PDU containing a flat list of signal instances.

Parameters

signalslist of SignalInstance

Signal instances placed within this PDU.

signal_groupslist of SignalGroupInstance

Signal group instances placed within this PDU.

Multiplexed PDU

Expand for a YAML example - 📄 general/channels/pdus/PDU_TransmissionStatus.flync.yaml

Note

A multiplexed PDU uses a selector_signal (the MUX switch) to select which mux_groups block of signals is active on each transmission cycle. This corresponds to the DBC M/mN multiplexer notation.

name: PDU_TransmissionStatus
type: multiplexed
length: 8
description: Transmission status, multiplexed on GearInfoMux selector.

selector_signal:
  bit_position: 0
  endianness: LE
  signal:
    name: GearInfoMux
    description: Multiplexer selector for TransmissionStatus PDU.
    bit_length: 4
    data_type: uint8

mux_groups:
  - selector_value: 0
    pdu:
      name: PDU_TransmissionStatus_Gear
      type: standard
      length: 8
      signals:
        - bit_position: 8
          endianness: LE

          signal:
            name: CurrentGear
            description: Currently engaged gear.
            bit_length: 8
            data_type: uint8
            value_descriptions:
              - value: 0
                description: Park
              - value: 1
                description: Reverse
              - value: 2
                description: Neutral
              - value: 3
                description: Drive_D1
              - value: 4
                description: Drive_D2
              - value: 5
                description: Drive_D3
              - value: 6
                description: Drive_D4
        - bit_position: 16
          endianness: LE

          signal:
            name: GearShiftMode
            description: Automatic / manual / sport shift mode.
            bit_length: 4
            data_type: uint8
            value_descriptions:
              - value: 0
                description: Automatic
              - value: 1
                description: Manual
              - value: 2
                description: Sport
  - selector_value: 1
    pdu:
      name: PDU_TransmissionStatus_Torque
      type: standard
      length: 8
      signals:
        - bit_position: 8
          endianness: LE

          signal:
            name: TorqueConverterSlipSpeed
            description: Slip speed of the torque converter.
            bit_length: 16
            data_type: uint16
            factor: 0.1
            offset: 0.0
            unit: rpm
        - bit_position: 24
          endianness: LE

          signal:
            name: TorqueConverterLockup
            description: Torque converter lock-up clutch state.
            bit_length: 2
            data_type: uint8
            value_descriptions:
              - value: 0
                description: Open
              - value: 1
                description: Slipping
              - value: 2
                description: Locked
              - value: 3
                description: Error
class MultiplexedPDU

Bases: PDU

PDU with a selector signal that determines which signal group is active.

Parameters

selector_signalSignalInstance

The selector signal whose value determines the active mux group.

static_signalslist of SignalInstance

Signals that are always present regardless of the active mux group.

mux_groupslist of MuxGroup

One entry per distinct selector value.

class MuxGroup

Bases: FLYNCBaseModel

Set of signals active for a specific multiplexer selector value.

Parameters

selector_valueint

The value of the selector signal that activates this group.

pduStandardPDU

The PDU that is active for this selector_value.

Container PDU

Expand for a YAML example - 📄 general/channels/ethernet_pdu_containers/eth_powertrain_container.flync.yaml

Note

An Ethernet Container PDU is stored in its own .flync.yaml file under general/channels/pdus/, alongside all other PDU types. It bundles several application PDUs into one Ethernet payload. The per-slot header format is configured via the header block, which specifies id_length_bits and length_field_bits.

name: EthPowertrainContainer
type: container
pdu_id: 1
length: 31
header:
  id_length_bits: 16
  length_field_bits: 8
description: >-
  Container PDU bundling powertrain PDUs (engine status, vehicle dynamics,
  transmission state) into a single Ethernet payload.

contained_pdus:
  - pdu_id: 257
    pdu_ref: PDU_EngineStatus
    offset: 0
  - pdu_id: 513
    pdu_ref: PDU_VehicleDynamics
    offset: 11
  - pdu_id: 769
    pdu_ref: PDU_TransmissionStatus
    offset: 20
class ContainerPDUHeader

Bases: FLYNCBaseModel

Per-slot header configuration for a ContainerPDU.

Parameters

id_length_bitsint

Bit length of the PDU ID field

length_field_bitsint

Bit length of the payload-length field

class ContainerPDU

Bases: PDU

Ethernet Container PDU that packs multiple PDUs into one frame payload.

Each contained PDU is prefixed with a header carrying its ID and length, allowing the receiver to demultiplex the slots at runtime.

Parameters

pdu_idint

Numeric identifier for this container PDU on the network.

headerContainerPDUHeader

Per-slot header format specifying the bit widths of the ID and length fields.

contained_pduslist of ContainedPDURef

PDUs packed inside this container, each referenced by name.

class ContainedPDURef

Bases: FLYNCBaseModel

Reference to a PDU packed inside a ContainerPDU.

Parameters

pdu_idint

Numeric identifier placed in the slot header for this contained PDU.

pdu_refstr

Name of the referenced PDU.

offsetint, optional

Bit offset of this slot (header + payload) within the container payload. When multiple PDUs are packed sequentially this encodes the start position of each slot so receivers can locate it without parsing preceding slots.

class PDUInstance

Bases: FLYNCBaseModel

Placement of a PDU at a specific bit offset within a CAN or LIN frame.

Parameters

pdu_refstr

Name of the referenced PDU.

bit_positionint, optional

Non-negative bit offset where this PDU begins within the frame.

update_bit_positionint, optional

Bit position of the update indication bit, when applicable.

Frame

A Frame is the protocol-specific transport unit that carries one or more PDUs on a physical bus. CAN and CAN FD frames are defined inside general/channels/can/; LIN frames inside general/channels/lin/. All frame types reference PDUs by name via PDUInstance.

For Ethernet, there is no frame layer — sockets reference a ContainerPDU directly via a pdu_sender or pdu_receiver deployment.

Expand for Schematic
        classDiagram

    class CANFrame {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
        can_id: int
        id_format: Literal['standard_11bit', 'extended_29bit']
        packed_pdus: list[PDUInstance] = list
        timing: FrameTransmissionTiming | None = None
        type: Literal['can'] = 'can'
        is_remote_frame: bool = False
    }

    class UniqueName {
        name: str
    }

    class Frame {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
    }

    class FrameTransmissionTiming {
        debounce_time: float | None = None
        cyclic_timings: list[FrameCyclicTiming] = list
        event_timings: list[FrameEventTiming] = list
    }

    class CANFDFrame {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
        can_id: int
        id_format: Literal['standard_11bit', 'extended_29bit']
        packed_pdus: list[PDUInstance] = list
        timing: FrameTransmissionTiming | None = None
        type: Literal['can_fd'] = 'can_fd'
        bit_rate_switch: bool = True
        error_state_indicator: bool = False
    }

    class PDUSender {
        deployment_type: Literal['pdu_sender'] = 'pdu_sender'
        pdu_ref: str
    }

    class PDUInstance {
        pdu_ref: str
        bit_position: int | None = None
        update_bit_position: int | None = None
    }

    class FrameCyclicTiming {
        cycle: float
    }

    class CANFrameBase {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
        can_id: int
        id_format: Literal['standard_11bit', 'extended_29bit']
        packed_pdus: list[PDUInstance] = list
        timing: FrameTransmissionTiming | None = None
    }

    class FLYNCBaseModel {
    }

    class PDUReceiver {
        deployment_type: Literal['pdu_receiver'] = 'pdu_receiver'
        pdu_ref: str
    }

    class LINFrame {
        name: str
        length: int
        frame_usage: str | None = None
        description: str | None = None
        type: Literal['lin'] = 'lin'
        lin_id: int
        checksum_type: Literal['classic', 'enhanced'] = 'enhanced'
        packed_pdus: list[PDUInstance] = list
        timing: FrameTransmissionTiming | None = None
    }

    class FrameEventTiming {
        final_repetitions: int = 0
        repeating_time_range: float = 0.0
    }

    FrameTransmissionTiming ..> FrameEventTiming
    FrameTransmissionTiming ..> FrameCyclicTiming
    CANFrameBase ..> FrameTransmissionTiming
    CANFrameBase ..> PDUInstance
    CANFrame ..> FrameTransmissionTiming
    CANFrame ..> PDUInstance
    CANFDFrame ..> FrameTransmissionTiming
    CANFDFrame ..> PDUInstance
    LINFrame ..> FrameTransmissionTiming
    LINFrame ..> PDUInstance


    
class Frame

Bases: UniqueName

Protocol-agnostic frame base class.

Parameters

namestr

Unique name of the frame.

lengthint

Length of the frame payload in bytes.

frame_usagestr, optional

Optional string describing the usage of the frame.

descriptionstr, optional

Optional human-readable description.

class CANFrameBase

Bases: Frame

Shared fields for CAN 2.0 and CAN FD frames.

Parameters

can_idint

CAN message identifier.

id_formatLiteral[“standard_11bit”, “extended_29bit”]

Identifier format.

packed_pduslist of PDUInstance

PDU instances placed at fixed bit offsets within this frame.

timingFrameTransmissionTiming, optional

Transmission timing for this frame.

class CANFrame

Bases: CANFrameBase

Classical CAN frame (CAN 2.0A/B).

Parameters

can_idint

CAN message identifier. Range: [0, 0x7FF] for "standard_11bit", [0, 0x1FFFFFFF] for "extended_29bit".

id_formatLiteral[“standard_11bit”, “extended_29bit”]

Identifier format.

is_remote_framebool

Whether this is a Remote Transmission Request (RTR) frame. Defaults to False.

class CANFDFrame

Bases: CANFrameBase

CAN FD frame.

Supports payloads up to 64 bytes and an optional bit-rate switch for the data phase.

Parameters

can_idint

CAN message identifier. Same range rules as CANFrame.

id_formatLiteral[“standard_11bit”, “extended_29bit”]

Identifier format.

bit_rate_switchbool

Enables a higher bit rate during the data phase. Defaults to True.

error_state_indicatorbool

Error State Indicator flag. Defaults to False.

class LINFrame

Bases: Frame

LIN unconditional frame.

Parameters

lin_idint

6-bit LIN frame identifier in the range [0, 0x3F].

checksum_typeLiteral[“classic”, “enhanced”]

LIN checksum model. Defaults to "enhanced".

packed_pduslist of PDUInstance

PDU instances placed at fixed bit offsets within this frame.

timingFrameTransmissionTiming, optional

Transmission timing for this frame.

PDU Sender / Receiver Deployments

Expand for a YAML example - 📄 ecus/high_performance_compute/controllers/hpc_controller1/ethernet_interfaces/hpc_c1_iface1/sockets/socket_pdu.flync.yaml

Note

A pdu_sender deployment binds a ContainerPDU to a socket on the publishing ECU. A pdu_receiver deployment does the same for the subscribing ECU. Both are added to the deployments list of a SocketTCP or SocketUDP.

vlan_id: 20
sockets:

  - name: pdu_powertrain_tx
    endpoint_address: 10.0.20.5
    endpoint_type: unicast
    port_no: 30800
    protocol: udp
    deployments:
      - deployment_type: pdu_sender
        pdu_ref: EthPowertrainContainer
class PDUSender

Bases: FLYNCBaseModel

Deployment that publishes a Container PDU onto a socket.

Transport (TCP/UDP, IP address, port) is owned by the enclosing socket; this model only binds a PDU to that socket. The publishing ECU is the owner of the socket carrying this deployment.

Parameters

deployment_typeLiteral[“pdu_sender”]

Discriminator value for DeploymentUnion.

pdu_refstr

Name of a ContainerPDU in the PDU catalog.

class PDUReceiver

Bases: FLYNCBaseModel

Deployment that subscribes to a Container PDU on a socket.

Transport (TCP/UDP, IP address, port) is owned by the enclosing socket; this model only binds a PDU to that socket. The receiving ECU is the owner of the socket carrying this deployment.

Parameters

deployment_typeLiteral[“pdu_receiver”]

Discriminator value for DeploymentUnion.

pdu_refstr

Name of a ContainerPDU in the PDU catalog.

Frame Timing

Transmission timing is configured at the frame layer for every protocol. Each CAN, CAN FD, or LIN frame may carry an optional timing field that drives cyclic, event-driven, and debounce scheduling of the frame as a whole on the wire.

class FrameTransmissionTiming

Bases: FLYNCBaseModel

Frame transmission timing configuration.

Parameters

debounce_timefloat, optional

Debounce delay in seconds before transmission occurs.

cyclic_timingslist of FrameCyclicTiming

Cyclic timing configurations.

event_timingslist of FrameEventTiming

Event-driven timing configurations.

class FrameCyclicTiming

Bases: FLYNCBaseModel

Cyclic transmission timing.

Parameters

cyclefloat

Cycle time in seconds.

class FrameEventTiming

Bases: FLYNCBaseModel

Event-based transmission timing.

Parameters

final_repetitionsint

Number of repetitions after an event is triggered. Defaults to 0.

repeating_time_rangefloat

Time interval in seconds between repetitions. Defaults to 0.0.