Skip to content

Conversation

@matt001k
Copy link
Contributor

@matt001k matt001k commented Aug 26, 2025

Update Python script for serial communications.
Allows subscribing to topics, and handling received data from another serial device.

Comment on lines 90 to 91
for sub_cb in self.sub_cbs:
sub_cb(node_id, type, version, topic_len, topic, data_len, data)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this looks like it runs each message through every sub_cb. We should document that so that we know to make sure the message info is checked within the sub_cb and rejected if not appropriate. Alternatively we could track the sub_cb <-> topic so we only call the sub_cb that is appropriate to the message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update with new logic to only call the subbed callback associated with that topic.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Woot!

Copy link
Collaborator

@victorsowa12 victorsowa12 left a comment

Choose a reason for hiding this comment

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

Looks good to me! I only had a small suggestion for providing more info on how to use the raw-messages api

@matt001k matt001k merged commit 4e147d8 into develop Sep 4, 2025
1 check passed
@matt001k matt001k deleted the feature/serial_bridge_subscribe branch September 4, 2025 21:56
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.

4 participants