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).
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,EnumSupported 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
charandbytearray.
- is_float() bool¶
Return
Truefor float types (float32,float64).
- is_unsigned_integer() bool¶
Return
Truefor unsigned integer types.
- is_signed_integer() bool¶
Return
Truefor signed integer types.
- is_complex_datattype() bool¶
Return
Truefor complex datatypes.
- class Signal¶
Bases:
FLYNCBaseModelLogical 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_type
SignalDataType 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:
FLYNCBaseModelMapping 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:
FLYNCBaseModelShared 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:
InstancePlacementPlacement of a
Signalat a specific bit offset within a PDU.Parameters¶
- signal
Signal Signal being instantiated.
- signal
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:
FLYNCBaseModelA 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:
InstancePlacementPlacement of a
SignalGroupat a specific bit offset within a PDU.Parameters¶
- signal_group
SignalGroup Signal group being instantiated.
- signal_group
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.
There are three PDU types, distinguished by the type discriminator field:
|
Description |
|---|---|
|
Non-multiplexed PDU containing a flat list of signal (group) instances. |
|
PDU with a selector signal; the active signal group depends on its value. |
|
Ethernet Container PDU that packs several other PDUs into one payload. |
- class PDU¶
Bases:
UniqueNameProtocol 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¶
- class StandardPDU¶
Bases:
PDUNon-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.
- signalslist of
Multiplexed PDU¶
- class MultiplexedPDU¶
Bases:
PDUPDU with a selector signal that determines which signal group is active.
Parameters¶
- selector_signal
SignalInstance 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.
- selector_signal
- class MuxGroup¶
Bases:
FLYNCBaseModelSet of signals active for a specific multiplexer selector value.
Parameters¶
- selector_valueint
The value of the selector signal that activates this group.
- pdu
StandardPDU The PDU that is active for this selector_value.
Container PDU¶
- class ContainerPDUHeader¶
Bases:
FLYNCBaseModelPer-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:
PDUEthernet 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.
- header
ContainerPDUHeader 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:
FLYNCBaseModelReference 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:
FLYNCBaseModelPlacement 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.
- class Frame¶
Bases:
UniqueNameProtocol-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:
FrameShared 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.
- timing
FrameTransmissionTiming, optional Transmission timing for this frame.
- class CANFrame¶
Bases:
CANFrameBaseClassical 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:
CANFrameBaseCAN 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:
FrameLIN 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.
- timing
FrameTransmissionTiming, optional Transmission timing for this frame.
PDU Sender / Receiver Deployments¶
- class PDUSender¶
Bases:
FLYNCBaseModelDeployment 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
ContainerPDUin the PDU catalog.
- class PDUReceiver¶
Bases:
FLYNCBaseModelDeployment 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
ContainerPDUin 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:
FLYNCBaseModelFrame 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:
FLYNCBaseModelCyclic transmission timing.
Parameters¶
- cyclefloat
Cycle time in seconds.
- class FrameEventTiming¶
Bases:
FLYNCBaseModelEvent-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.