MAVLink: Update complete app to support MAVLink 1 & MAVLink 2. Add MAV_PROTO_VER param to switch between them

This commit is contained in:
Lorenz Meier
2016-05-19 20:13:32 +02:00
parent acb2e52389
commit 84800dfd87
5 changed files with 70 additions and 24 deletions
+4
View File
@@ -2084,6 +2084,10 @@ MavlinkReceiver::receive_thread(void *arg)
/* if read failed, this loop won't execute */
for (ssize_t i = 0; i < nread; i++) {
if (mavlink_parse_char(_mavlink->get_channel(), buf[i], &msg, &status)) {
/* check if we received version 2 */
// XXX todo _mavlink->set_proto_version(2);
/* handle generic messages and commands */
handle_message(&msg);