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

Revise network message-passing protocol for inter-language implementations #1

Closed
superdan-t opened this issue Jun 19, 2022 · 3 comments
Assignees
Labels
design Research or design is required enhancement New feature or request

Comments

@superdan-t
Copy link
Collaborator

superdan-t commented Jun 19, 2022

No description provided.

@superdan-t superdan-t self-assigned this Jun 19, 2022
@superdan-t
Copy link
Collaborator Author

Ways of identifying message type without the hacky C++ struct wrapper/runtime registration trick from last year:

  • Protobuf message descriptor full name (string). Protobuf can provide the full name (message name + package) in string form, which can be used to identify the message's type. Very easy, reliable, few limitations. The only con is that mapping a received message to its handler will require string comparison. Messages need to be handled with low latency on Raspberry Pi and desktop. Test whether string comparison vs direct mapping even makes a measurable difference on these platforms.
  • Protobuf message descriptor index. Protobuf provides the index of a message in the package. This adds the limitation that all messages must be defined in the same proto package/file, but an integer index allows a direct-mapped table of message type to handler.
  • Manually specifying message types using a Protobuf enum. Documenting this method since it was our original plan. It is like the message descriptor index, but worse.

@superdan-t superdan-t added the design Research or design is required label Jun 19, 2022
@Levi-Lesches
Copy link
Member

Levi-Lesches commented Jul 21, 2022

From our last discussion and BinghamtonRover/Dashboard#8, it seems:

  • Move all .proto files from BurtOS-2/src/network/rover_system_messages to this repo
  • Add a wrapper .proto file that can wrap another message (as a string) and its ID (also a string)
  • Include this repo as a submodule in the dashboard and rover-side networking repositories to generate code
  • Implement networking code on both sides that pass around instances of the wrapper message

@Levi-Lesches
Copy link
Member

Done. The Protobuf repository (here) has a new wrapper.proto file and the Dashboard and Subsystems-Computer repositories can include this repository as a submodule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Research or design is required enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants