From 65158e04d6204ba400dd84d43966aedc7bb91027 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 26 Sep 2017 12:22:10 +0200 Subject: [PATCH] core: improve variable name --- core/mavlink_commands.cpp | 8 ++++---- core/mavlink_commands.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/mavlink_commands.cpp b/core/mavlink_commands.cpp index 28e955abfd..a1b461c2c3 100644 --- a/core/mavlink_commands.cpp +++ b/core/mavlink_commands.cpp @@ -203,7 +203,7 @@ void MavlinkCommands::do_work() for (auto it = _work_list.begin(); it != _work_list.end(); /* ++it */) { // We ignore what has already been sent and is not timed out yet. - if ((*it)->num_sent != 0 && !(*it)->timed_out) { + if ((*it)->num_command_sent != 0 && !(*it)->timed_out) { // Mark it as active. active_command_ids.push_back((*it)->mavlink_command); @@ -212,7 +212,7 @@ void MavlinkCommands::do_work() } // We remove what has already been resent a few times. - if ((*it)->timed_out && (*it)->num_sent >= RETRIES) { + if ((*it)->timed_out && (*it)->num_command_sent >= RETRIES) { if ((*it)->callback) { auto callback_tmp = (*it)->callback; _mutex.unlock(); @@ -235,7 +235,7 @@ void MavlinkCommands::do_work() } // Now we can actually send it. - LogDebug() << "Sending command " << (*it)->num_sent + LogDebug() << "Sending command " << (*it)->num_command_sent << " time (" << (int)(*it)->mavlink_command << ")"; // Reset timeout flag for next re-send. @@ -254,7 +254,7 @@ void MavlinkCommands::do_work() continue; } - ++((*it)->num_sent); + ++((*it)->num_command_sent); std::shared_ptr work_ptr = *it; // Let's set a timer for retransmission if needed. diff --git a/core/mavlink_commands.h b/core/mavlink_commands.h index f1a8102005..de132451c5 100644 --- a/core/mavlink_commands.h +++ b/core/mavlink_commands.h @@ -59,7 +59,7 @@ class MavlinkCommands static constexpr int RETRIES = 3; struct Work { - int num_sent = 0; + int num_command_sent = 0; bool timed_out = true; double timeout_s = DEFAULT_TIMEOUT_NORMAL_S; uint16_t mavlink_command = 0;