@@ -25,11 +25,17 @@ namespace dbcppp
2525 MaschinesFloatEncodingNotSupported = 1 ,
2626 MaschinesDoubleEncodingNotSupported = 2 ,
2727 SignalExceedsMessageSize = 4 ,
28- WrongBitSizeForExtendedDataType = 8
28+ WrongBitSizeForExtendedDataType = 8 ,
29+ ConflictingMultiplexDefinition = 16 ,
2930 };
3031 enum class EMultiplexer
3132 {
32- NoMux, MuxSwitch, MuxValue
33+ NoMux,
34+ MuxSwitch = 1 ,
35+ MuxValue = 2 ,
36+ // For advanced multiplexing with ISignalMultiplexerValue, nesting is possible.
37+ // This results in signals being both a multiplexor switch and a multiplexed value.
38+ MuxSwitchAndValue = MuxSwitch | MuxValue
3339 };
3440 enum class EByteOrder
3541 {
@@ -44,7 +50,7 @@ namespace dbcppp
4450 {
4551 Integer, Float, Double
4652 };
47-
53+
4854 static std::unique_ptr<ISignal> Create (
4955 uint64_t message_size
5056 , std::string&& name
@@ -65,13 +71,21 @@ namespace dbcppp
6571 , std::string&& comment
6672 , EExtendedValueType extended_value_type
6773 , std::vector<std::unique_ptr<ISignalMultiplexerValue>>&& signal_multiplexer_values);
68-
74+
6975 virtual std::unique_ptr<ISignal> Clone () const = 0;
7076
7177 virtual ~ISignal () = default ;
7278 virtual const std::string& Name () const = 0;
7379 virtual EMultiplexer MultiplexerIndicator () const = 0;
80+ // / \brief Single multiplexor value for simple multiplexing.
81+ // /
82+ // / Invalid if ISignal::SignalMultiplexerValues is not empty.
7483 virtual uint64_t MultiplexerSwitchValue () const = 0;
84+ // / \brief Least significant bit of the signal.
85+ // /
86+ // / \note DBC uses the least signficant bit as start bit for both big and little endian.
87+ // / This means that for big endian, the StartBit points into the highest byte.
88+ // / This differs from FIBEX/Autosar where big endian signals are instead using the least significant bit in the lowest byte as offset.
7589 virtual uint64_t StartBit () const = 0;
7690 virtual uint64_t BitSize () const = 0;
7791 virtual EByteOrder ByteOrder () const = 0;
@@ -121,6 +135,12 @@ namespace dbcppp
121135 DBCPPP_MAKE_ITERABLE (ISignal, Receivers, std::string);
122136 DBCPPP_MAKE_ITERABLE (ISignal, ValueEncodingDescriptions, IValueEncodingDescription);
123137 DBCPPP_MAKE_ITERABLE (ISignal, AttributeValues, IAttribute);
138+
139+ // / \brief Mapping of this multiplexed signal to specific value ranges of a selected multiplexor switch signal.
140+ // /
141+ // / In a valid DBC, this can only have 0 or 1 entries.
142+ // / Requires EMultiplexer::MuxValue to be set in MultiplexerIndicator in order to be valid.
143+ // / If empty, simple multiplexing rules by ISignal::MultiplexerSwitchValue and IMessage::MuxSignal apply instead.
124144 DBCPPP_MAKE_ITERABLE (ISignal, SignalMultiplexerValues, ISignalMultiplexerValue);
125145
126146 protected:
0 commit comments