Skip to content

Commit

Permalink
core: improve variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes authored and mrpollo committed Sep 26, 2017
1 parent 12f8653 commit 65158e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions core/mavlink_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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();
Expand All @@ -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.
Expand All @@ -254,7 +254,7 @@ void MavlinkCommands::do_work()
continue;
}

++((*it)->num_sent);
++((*it)->num_command_sent);

std::shared_ptr<Work> work_ptr = *it;
// Let's set a timer for retransmission if needed.
Expand Down
2 changes: 1 addition & 1 deletion core/mavlink_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 65158e0

Please sign in to comment.