Skip to content

First pass at adding additional interfaces and simplifying the layout…#13

Merged
zeerekahmad merged 4 commits intomainfrom
zeerek/add_multi_mcm_support
Feb 23, 2026
Merged

First pass at adding additional interfaces and simplifying the layout…#13
zeerekahmad merged 4 commits intomainfrom
zeerek/add_multi_mcm_support

Conversation

@zeerekahmad
Copy link
Contributor

@zeerekahmad zeerekahmad commented Feb 11, 2026

  • Add multiple MCMs to socketcan interface
  • Simplify getters for MCM state
  • Use optional so bad data is rejected


constexpr uint32_t MAX_SYGNAL_INTERFACES = 6;
constexpr uint32_t MAX_SYGNAL_SUBSYSTEMS = 1;
constexpr uint32_t MAX_SYGNAL_SUBSYSTEMS = 2;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would MAX_SYGNAL_SUBSYSTEMS be 2? It's a boolean, it's 0 or 1?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage was comparing like this:

  if (subsystem_id >= MAX_SYGNAL_SUBSYSTEMS) {
    error_message = error_message + "Subsystem ID exceeds maximum allowed subsystems. \n";
    return std::nullopt;
  }

The Use of >= made me assume it was the max number of subsystems, not the value of the highest subsystem id.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So when MAX_SYGNAL_SUBSYSTEMS = 1, this would error out when I tried to send a command to subsystem 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, subsystem ID and # of subsystems are off by 1. This is good enough.

@zeerekahmad zeerekahmad merged commit 98dd968 into main Feb 23, 2026
2 checks passed
@zeerekahmad zeerekahmad deleted the zeerek/add_multi_mcm_support branch February 23, 2026 19:57
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

Successfully merging this pull request may close these issues.

2 participants