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

Add a way to simulate messages #49

Open
jr1221 opened this issue Sep 12, 2024 · 0 comments
Open

Add a way to simulate messages #49

jr1221 opened this issue Sep 12, 2024 · 0 comments

Comments

@jr1221
Copy link
Contributor

jr1221 commented Sep 12, 2024

Include new YAML param inside CANMsg:
CANMsg:

  • sim_freq (frequency in ms)

inside each CANPoint:

  • sim_min (min number to present)
  • sim_max (max number to present)
  • sim_inc_max (max step of the number)
  • sim_inc_min (min step of the number

Add a new flag to switch to simulate mode.
Somehow iterate through the messages and send them appropriately, maybe with a giant futures::select! generated by the YAML perhaps??? This may require a switch to tokio but would certainly be the cleanest.
Use a random generator at boot to select the value between sim_max and sim_min, and then randomly increment by a number between sim_inc_min and sim_inc_max. If the number is going to exceed the bounds of sim_max and/or sim_min, reject it. Use the correct primitive size to ensure overflow is less likely, for bitwise encodables use the smallest possible primitive, unless a 1 bit message that should be automatically pretty easy.
Note we do not need to convert to CAN message and back in this ticket, its not like EncodableCANMsg. This is purely to emit good mock data for the Odyssey framework to consume.

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

1 participant