summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/command_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/commands/command_impl.cc')
-rw-r--r--src/components/application_manager/src/commands/command_impl.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc
index 8875895cb7..a9fbff5ece 100644
--- a/src/components/application_manager/src/commands/command_impl.cc
+++ b/src/components/application_manager/src/commands/command_impl.cc
@@ -209,5 +209,19 @@ bool CommandImpl::ReplaceHMIWithMobileAppId(
return true;
}
+uint32_t CommandImpl::CalcCommandInternalConsecutiveNumber(
+ ApplicationConstSharedPtr app) {
+ LOG4CXX_AUTO_TRACE(logger_);
+ const DataAccessor<CommandsMap> accessor = app->commands_map();
+ const CommandsMap& commands = accessor.GetData();
+
+ uint32_t last_command_number = 0u;
+ if (!commands.empty()) {
+ last_command_number = commands.rbegin()->first;
+ }
+
+ return last_command_number + 1;
+}
+
} // namespace commands
} // namespace application_manager