mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 00:43:34 +08:00
Mavlink: Use UUID for identifier in UTM_GLOBAL_POSITION
This commit is contained in:
committed by
Lorenz Meier
parent
33a9eb946a
commit
a154282fef
@@ -1775,9 +1775,16 @@ protected:
|
|||||||
msg.flags |= UTM_DATA_AVAIL_FLAGS_TIME_VALID;
|
msg.flags |= UTM_DATA_AVAIL_FLAGS_TIME_VALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef BOARD_HAS_NO_UUID
|
||||||
|
px4_guid_t px4_guid;
|
||||||
|
board_get_px4_guid(px4_guid);
|
||||||
|
static_assert(sizeof(px4_guid_t) == sizeof(msg.uas_id), "GUID byte length mismatch");
|
||||||
|
memcpy(&msg.uas_id, &px4_guid, sizeof(msg.uas_id));
|
||||||
|
msg.flags |= UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE;
|
||||||
|
#else
|
||||||
// TODO Fill ID with something reasonable
|
// TODO Fill ID with something reasonable
|
||||||
memset(&msg.uas_id[0], 0, sizeof(msg.uas_id));
|
memset(&msg.uas_id[0], 0, sizeof(msg.uas_id));
|
||||||
//msg.flags |= UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE;
|
#endif /* BOARD_HAS_NO_UUID */
|
||||||
|
|
||||||
// Handle global position
|
// Handle global position
|
||||||
if (_global_pos_time > 0) {
|
if (_global_pos_time > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user