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

Added classes for handling specific frame types and any frame #767

Merged
merged 2 commits into from
Jan 9, 2020

Conversation

jbangelo
Copy link
Contributor

@jbangelo jbangelo commented Jan 3, 2020

It was recently brought up that it might be helpful to have a way to handle any SBP message using the C++ classes. This PR adds the missing wrappers for handling raw frames of specific classes (corresponding to the sbp_register_frame_callback() C function), and for handling all incoming frames/messages (corresponding to the sbp_register_all_msg_callback() C function).

The interface for these were meant to be similar to the existing MessageHandler class. They differ in that they only define a single virtual function to be implemented instead of one for each message type. This was done since these classes would typically be used for lower level access than is typical, and the such application code would probably want access to the raw bytes of data instead of a type safe reference.

In addition to the code and example usage, a minor issue with the CMake files for the example was fixed as a part of this PR to help test the example.

@jbangelo jbangelo force-pushed the jbangelo/add-cpp-frame-handler branch from f1fc44e to c2c1ecd Compare January 3, 2020 20:44
Copy link
Contributor

@RReichert RReichert left a comment

Choose a reason for hiding this comment

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

Great addition to the libsbp library, thanks for doing that, it will vastly facilitate our work later on.

c/example/cpp_example/cpp_example.cc Outdated Show resolved Hide resolved
c/include/libsbp/cpp/frame_handler.h Outdated Show resolved Hide resolved
c/include/libsbp/cpp/frame_handler.h Show resolved Hide resolved
c/include/libsbp/cpp/frame_handler.h Show resolved Hide resolved
@jbangelo jbangelo merged commit 1e9409e into master Jan 9, 2020
@jbangelo jbangelo deleted the jbangelo/add-cpp-frame-handler branch January 9, 2020 16:36
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