mavlink hash check: return early in case of hash check parameter (#10861)

*  a request for setting the '_HASH_CHECK' parameter is handled differently
than the same request for a standard parameter. Make sure we don't actually
try to set the parameter.

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman Bapst 2018-11-25 20:01:23 +01:00 committed by Daniel Agar
parent eb8a3de987
commit bef8b6b949
1 changed files with 6 additions and 2 deletions

View File

@ -134,8 +134,12 @@ MavlinkParametersManager::handle_message(const mavlink_message_t *msg)
name[MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN] = '\0';
/* Whatever the value is, we're being told to stop sending */
if (strncmp(name, "_HASH_CHECK", sizeof(name)) == 0 && _mavlink->hash_check_enabled()) {
_send_all_index = -1;
if (strncmp(name, "_HASH_CHECK", sizeof(name)) == 0) {
if (_mavlink->hash_check_enabled()) {
_send_all_index = -1;
}
/* No other action taken, return */
return;
}