Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement multiplexed signals #19

Open
marcelbuesing opened this issue Mar 19, 2021 · 3 comments
Open

Implement multiplexed signals #19

marcelbuesing opened this issue Mar 19, 2021 · 3 comments

Comments

@marcelbuesing
Copy link
Contributor

marcelbuesing commented Mar 19, 2021

Messages may contain multiplexed signals e.g.

MessageA:
SignalA (Plain / Normal signal)
Signal multiplexorX
SignalY multiplexed by multiplexorX
SignalZ multiplexed by multiplexorX

Basically this means here the multiplexorX indicates whether SignalY or SignalZ ist send as part of this frame. A "plain" signal is always included in the frame (not multiplexed). A message may contain zero, one or multiple multiplexors.
Whether a signal is multiplexed or not is indicated by the MultiplexIndicator.

@marcelbuesing
Copy link
Contributor Author

Designwise I think multiplexed signals can be represented in two ways:

  • A function that returns an Option e.g. here signal_y_raw(&self) -> Option<...>
  • A function that returns an Enum e.g. here signal_x_raw(&self) -> SignalXMultiplexed where the SignalXMultiplexed enum would basically be Y or Z.

I think from an API perspective it's actually more convenient to use the enum variant as it makes it clear what signals are part of which multiplexor and saves some comparsions with Option values that can not even be Some.

@andresv
Copy link
Contributor

andresv commented Mar 19, 2021

An example: http://socialledge.com/sjsu/index.php/DBC_Format#Multiplexed_Message

@andresv
Copy link
Contributor

andresv commented Mar 19, 2021

I would also prefer enum variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants