Skip to content

Commit

Permalink
Target system ID check fixed (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
irsdkv authored and julianoes committed Sep 25, 2019
1 parent fe06d5b commit b9bd5fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/udp_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ bool UdpConnection::send_message(const mavlink_message_t& message)
// on the matching link.
const mavlink_msg_entry_t* entry = mavlink_get_msg_entry(message.msgid);
const uint8_t target_system_id =
(entry ? reinterpret_cast<const uint8_t*>(message.payload64)[entry->target_system_ofs] : 0);
(entry && (entry->flags & MAV_MSG_ENTRY_FLAG_HAVE_TARGET_SYSTEM) ?
reinterpret_cast<const uint8_t*>(message.payload64)[entry->target_system_ofs] :
0);

bool send_successful = true;
for (auto& remote : _remotes) {
Expand Down

0 comments on commit b9bd5fe

Please sign in to comment.