mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 15:43:33 +08:00
version cleanup: move all version information into version.c and use a common API
The provided versioning information is the same, except for some additions, like OS version (which still need to be implemented on NuttX).
This commit is contained in:
@@ -38,10 +38,12 @@
|
||||
* Tools for system version detection.
|
||||
*
|
||||
* @author Anton Babushkin <anton.babushkin@me.com>
|
||||
* @author Beat Küng <beat-kueng@gmx.net>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FREEZE_STR(s) #s
|
||||
#define STRINGIFY(s) FREEZE_STR(s)
|
||||
@@ -79,7 +81,60 @@ static inline const char *px4_board_name(void)
|
||||
return BOARD_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the PX4 Firmware version
|
||||
* @return version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type @see FIRMWARE_TYPE)
|
||||
*/
|
||||
__EXPORT uint32_t px4_firmware_version(void);
|
||||
|
||||
/**
|
||||
* get the board version (last 8 bytes should be silicon ID, if any)
|
||||
*/
|
||||
__EXPORT uint32_t px4_board_version(void);
|
||||
|
||||
/**
|
||||
* operating system version
|
||||
* @return version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type @see FIRMWARE_TYPE)
|
||||
*/
|
||||
__EXPORT uint32_t px4_os_version(void);
|
||||
|
||||
/**
|
||||
* Operating system version as human readable string (git tag)
|
||||
* @return string or NULL if not defined
|
||||
*/
|
||||
__EXPORT const char *px4_os_version_string(void);
|
||||
|
||||
/**
|
||||
* name of the operating system
|
||||
* @return human readable string
|
||||
*/
|
||||
__EXPORT const char *px4_os_name(void);
|
||||
|
||||
/**
|
||||
* Toolchain name used to compile PX4
|
||||
*/
|
||||
__EXPORT const char *px4_toolchain_name(void);
|
||||
|
||||
/**
|
||||
* Toolchain version used to compile PX4 (no particular format)
|
||||
*/
|
||||
__EXPORT const char *px4_toolchain_version(void);
|
||||
|
||||
/**
|
||||
* Firmware version as human readable string (git tag)
|
||||
*/
|
||||
__EXPORT const char *px4_firmware_version_string(void);
|
||||
|
||||
/**
|
||||
* Firmware version in binary form (first part of the git tag)
|
||||
*/
|
||||
__EXPORT uint64_t px4_firmware_version_binary(void);
|
||||
|
||||
/**
|
||||
* Operating system version in binary form (first part of the git tag)
|
||||
* @return this is not available on all OSes and can return 0
|
||||
*/
|
||||
__EXPORT uint64_t px4_os_version_binary(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user