mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 09:23:33 +08:00
mavlink: Fix GIT string transmission
This commit is contained in:
@@ -49,8 +49,11 @@ ifneq ($(words $(GIT_DESC)),1)
|
|||||||
GIT_DESC := "unknown_git_version"
|
GIT_DESC := "unknown_git_version"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
GIT_DESC_SHORT := $(shell echo $(GIT_DESC) | cut -c1-16)
|
||||||
|
|
||||||
$(shell echo "#include <systemlib/git_version.h>" > $(BUILD_DIR)git_version.c)
|
$(shell echo "#include <systemlib/git_version.h>" > $(BUILD_DIR)git_version.c)
|
||||||
$(shell echo "const char* px4_git_version = \"$(GIT_DESC)\";" >> $(BUILD_DIR)git_version.c)
|
$(shell echo "const char* px4_git_version = \"$(GIT_DESC)\";" >> $(BUILD_DIR)git_version.c)
|
||||||
|
$(shell echo "const uint64_t px4_git_version_binary = 0x$(GIT_DESC_SHORT);" >> $(BUILD_DIR)git_version.c)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Canned firmware configurations that we (know how to) build.
|
# Canned firmware configurations that we (know how to) build.
|
||||||
|
|||||||
@@ -922,8 +922,6 @@ void Mavlink::send_autopilot_capabilites() {
|
|||||||
if (status_sub->update(&status)) {
|
if (status_sub->update(&status)) {
|
||||||
mavlink_autopilot_version_t msg = {};
|
mavlink_autopilot_version_t msg = {};
|
||||||
|
|
||||||
const char* git_version = px4_git_version;
|
|
||||||
|
|
||||||
msg.capabilities = MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
|
msg.capabilities = MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
|
||||||
msg.capabilities |= MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT;
|
msg.capabilities |= MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT;
|
||||||
msg.capabilities |= MAV_PROTOCOL_CAPABILITY_COMMAND_INT;
|
msg.capabilities |= MAV_PROTOCOL_CAPABILITY_COMMAND_INT;
|
||||||
@@ -936,8 +934,8 @@ void Mavlink::send_autopilot_capabilites() {
|
|||||||
msg.middleware_sw_version = 0;
|
msg.middleware_sw_version = 0;
|
||||||
msg.os_sw_version = 0;
|
msg.os_sw_version = 0;
|
||||||
msg.board_version = 0;
|
msg.board_version = 0;
|
||||||
memcpy(&msg.flight_custom_version, git_version, sizeof(msg.flight_custom_version));
|
memcpy(&msg.flight_custom_version, &px4_git_version_binary, sizeof(msg.flight_custom_version));
|
||||||
memcpy(&msg.middleware_custom_version, git_version, sizeof(msg.middleware_custom_version));
|
memcpy(&msg.middleware_custom_version, &px4_git_version_binary, sizeof(msg.middleware_custom_version));
|
||||||
memset(&msg.os_custom_version, 0, sizeof(msg.os_custom_version));
|
memset(&msg.os_custom_version, 0, sizeof(msg.os_custom_version));
|
||||||
#ifdef CONFIG_CDCACM_VENDORID
|
#ifdef CONFIG_CDCACM_VENDORID
|
||||||
msg.vendor_id = CONFIG_CDCACM_VENDORID;
|
msg.vendor_id = CONFIG_CDCACM_VENDORID;
|
||||||
|
|||||||
@@ -39,8 +39,11 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
__EXPORT extern const char* px4_git_version;
|
__EXPORT extern const char* px4_git_version;
|
||||||
|
__EXPORT extern const uint64_t px4_git_version_binary;
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|||||||
Reference in New Issue
Block a user