@@ -423,7 +423,13 @@ bool
423423MavlinkMissionManager::int_mode ()
424424{
425425 auto status = _mavlink->get_service_version_stream ()->get_service_status (MAVLINK_SERVICE_ID_MISSION);
426- return status.selected_version > 1 ;
426+
427+ if (status.status != microservice_versions::handshake_status::SELECTED) {
428+ return _int_mode_fallback;
429+
430+ } else {
431+ return status.selected_version > 1 ;
432+ }
427433}
428434
429435void
@@ -630,11 +636,11 @@ MavlinkMissionManager::handle_mission_ack(const mavlink_message_t *msg)
630636 if (wpa.type == MAV_MISSION_UNSUPPORTED) {
631637
632638 if (int_mode ()) {
633- // int_mode() = false;
639+ _int_mode_fallback = false ;
634640 send_mission_request (_transfer_partner_sysid, _transfer_partner_compid, _transfer_seq);
635641
636642 } else {
637- // int_mode() = true;
643+ _int_mode_fallback = true ;
638644 send_mission_request (_transfer_partner_sysid, _transfer_partner_compid, _transfer_seq);
639645 }
640646
742748MavlinkMissionManager::handle_mission_request (const mavlink_message_t *msg)
743749{
744750 // The request comes in the old float mode, so we switch to it.
745- // if (int_mode()) {
746- // int_mode() = false;
747- // }
751+ if (int_mode ()) {
752+ _int_mode_fallback = false ;
753+ }
748754
749755 handle_mission_request_both (msg);
750756}
753759MavlinkMissionManager::handle_mission_request_int (const mavlink_message_t *msg)
754760{
755761 // The request comes in the new int mode, so we switch to it.
756- // if (!int_mode()) {
757- // int_mode() = true;
758- // }
762+ if (!int_mode ()) {
763+ _int_mode_fallback = true ;
764+ }
759765
760766 handle_mission_request_both (msg);
761767}
@@ -978,21 +984,21 @@ MavlinkMissionManager::switch_to_idle_state()
978984void
979985MavlinkMissionManager::handle_mission_item (const mavlink_message_t *msg)
980986{
981- // if (int_mode()) {
982- // // It seems that we should be using the float mode, let's switch out of int mode.
983- // int_mode() = false;
984- // }
987+ if (int_mode ()) {
988+ // It seems that we should be using the float mode, let's switch out of int mode.
989+ _int_mode_fallback = false ;
990+ }
985991
986992 handle_mission_item_both (msg);
987993}
988994
989995void
990996MavlinkMissionManager::handle_mission_item_int (const mavlink_message_t *msg)
991997{
992- // if (!int_mode()) {
993- // // It seems that we should be using the int mode, let's switch to it.
994- // int_mode() = true;
995- // }
998+ if (!int_mode ()) {
999+ // It seems that we should be using the int mode, let's switch to it.
1000+ _int_mode_fallback = true ;
1001+ }
9961002
9971003 handle_mission_item_both (msg);
9981004}
@@ -1279,10 +1285,10 @@ MavlinkMissionManager::parse_mavlink_mission_item(const mavlink_mission_item_t *
12791285 mavlink_mission_item->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT_INT))) {
12801286
12811287 // Switch to int mode if that is what we are receiving
1282- // if ((mavlink_mission_item->frame == MAV_FRAME_GLOBAL_INT ||
1283- // mavlink_mission_item->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT_INT)) {
1284- // int_mode() = true;
1285- // }
1288+ if ((mavlink_mission_item->frame == MAV_FRAME_GLOBAL_INT ||
1289+ mavlink_mission_item->frame == MAV_FRAME_GLOBAL_RELATIVE_ALT_INT)) {
1290+ _int_mode_fallback = true ;
1291+ }
12861292
12871293 if (int_mode ()) {
12881294 /* The argument is actually a mavlink_mission_item_int_t in int_mode.
0 commit comments