You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is similar to issue #31 but instead is to do the Unpack functions with multiplexed signals.
So currently the Unpack functions will decode all the signals in the CAN message structure regardless of whether they are multiplexed signals and what the multiplex master signal value is.
An example CAN message in a dbc file format is shown below:
So for example when decoding this message if the mux_master signal equals 1 then only the signals mux1_sig1, mux_master and signal1 should be decoded in the Unpack function and placed in the output MUX_SIG_TEST1_t* _m.
The above code will unfortunetly also incorrectly decode the signals mux2_sig1, mux3_sig1, mux0_sig4, mux0_sig3, mux5_sig1, mux7_sig1, mux7_sig2 , mux8_sig1, mux8_sig2 and put this incorrect decoded values in the output structure MUX_SIG_TEST1_t* _m.
This means you have to manually loop over the structure to find the mux_master value and then only look at the signals associated with the mux_master equalling 1, which is very cumbersome.
A better solution would be to generate if statements around the unpacking of each signal so only the signals associated with the mux_master value are decoded.
The text was updated successfully, but these errors were encountered:
Hello,
This is similar to issue #31 but instead is to do the Unpack functions with multiplexed signals.
So currently the Unpack functions will decode all the signals in the CAN message structure regardless of whether they are multiplexed signals and what the multiplex master signal value is.
An example CAN message in a dbc file format is shown below:
Currently c-coderdbc will generate the following Unpack_ function which just decodes all the signals.
So for example when decoding this message if the mux_master signal equals 1 then only the signals
mux1_sig1, mux_master and signal1 should be decoded in the Unpack function and placed in the output MUX_SIG_TEST1_t* _m.
The above code will unfortunetly also incorrectly decode the signals mux2_sig1, mux3_sig1, mux0_sig4, mux0_sig3, mux5_sig1, mux7_sig1, mux7_sig2 , mux8_sig1, mux8_sig2 and put this incorrect decoded values in the output structure MUX_SIG_TEST1_t* _m.
This means you have to manually loop over the structure to find the mux_master value and then only look at the signals associated with the mux_master equalling 1, which is very cumbersome.
A better solution would be to generate if statements around the unpacking of each signal so only the signals associated with the mux_master value are decoded.
The text was updated successfully, but these errors were encountered: