christianrauch / msp

Implementation of the MultiWii Serial Protocol (MSP) for MultiWii and Cleanflight flight controller
http://www.multiwii.com/wiki/index.php?title=Multiwii_Serial_Protocol
GNU Lesser General Public License v3.0
73 stars 26 forks source link

draft MSPv2 support #27

Closed humanoid2050 closed 5 years ago

humanoid2050 commented 5 years ago

This has most of my internal changes to support MSPv2. Converted all messages to inherit from msp::msg::Message class. Turned ByteVector into an actual class. Added a new value type to support optional decoding of message fields. No changes to MSP, Client, and FlightController APIs.

christianrauch commented 5 years ago

There are quite a lot of changes. I won't be able to address all of them now. But thanks for contributing to begin with :-)

My comments so far by looking on the diff:

I decided to but the message IDs (enum msp::ID) in its own header so that it can be available without loading all the message definitions. We could use a forward declaration of the enum class msp::ID in message.hpp and move the IDs into the header for the message definitions (msp_msg.hpp). This would gather all the message definition stuff that might change with firmware in a single header file.

I will test your changes later on the most recent betaflight release.

Edit: For future pull requests, I would recommend to use a dedicated feature branch (with a reasonable name) and keep your master branch in sync with the upstream project.

humanoid2050 commented 5 years ago

To address your comments,

christianrauch commented 5 years ago
humanoid2050 commented 5 years ago
christianrauch commented 5 years ago

How large is your MSP2 feature branch? If it helps you, you could create a new MSP2 pull request that adds MSP2 support and everything that needs to be changed to enable MSP2 (e.g. including this PR).

It's just that it becomes difficult to review the PR if it adds too many changes.

humanoid2050 commented 5 years ago

Its only 25ish files including examples, about like master is now. There is a lot of resemblance to the master code base, but its all been changed in subtle but pervasive ways.

christianrauch commented 5 years ago

You can give it a try. If it's too much, I will continue with this PR.

humanoid2050 commented 5 years ago

ok so new PR against my full MSPv2 changes?

christianrauch commented 5 years ago

Yes. Can you create a new PR (and leave this open for now) that includes all the MSP2 support changes? I.e. the features that you originally wanted to merge, where I initially proposed to split these changes into multiple PRs. Let's try to do all of these changes in a single PR.

christianrauch commented 5 years ago

Superseded by https://github.com/christianrauch/msp/pull/28.