PX4 Firmware
PX4 Autopilot Software http://px4.io
version.h File Reference

Tools for system version detection. More...

#include <px4_platform_common/px4_config.h>
#include <systemlib/px4_macros.h>
#include <stdint.h>
Include dependency graph for version.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static __BEGIN_DECLS const char * px4_board_name (void)
 get the board name as string (including the version if there are multiple) More...
 
static const char * px4_board_sub_type (void)
 get the board sub type More...
 
static int px4_board_hw_version (void)
 get the board HW version More...
 
static int px4_board_hw_revision (void)
 get the board HW revision More...
 
const char * px4_build_uri (void)
 get the build URI (used for crash logging) More...
 
__EXPORT uint32_t version_tag_to_number (const char *tag)
 Convert a version tag string to a number. More...
 
__EXPORT uint32_t px4_firmware_version (void)
 get the PX4 Firmware version More...
 
__EXPORT uint32_t version_tag_to_vendor_version_number (const char *tag)
 Convert a version tag string to a vendor version number. More...
 
__EXPORT uint32_t px4_firmware_vendor_version (void)
 get the PX4 Firmware vendor version More...
 
__EXPORT uint32_t px4_board_version (void)
 get the board version (last 8 bytes should be silicon ID, if any) More...
 
__EXPORT uint32_t px4_os_version (void)
 operating system version More...
 
__EXPORT const char * px4_os_version_string (void)
 Operating system version as human readable string (git tag) More...
 
__EXPORT const char * px4_os_name (void)
 name of the operating system More...
 
__EXPORT const char * px4_toolchain_name (void)
 Toolchain name used to compile PX4. More...
 
__EXPORT const char * px4_toolchain_version (void)
 Toolchain version used to compile PX4 (no particular format) More...
 
__EXPORT const char * px4_firmware_version_string (void)
 Firmware version as human readable string (git tag) More...
 
__EXPORT const char * px4_firmware_git_branch (void)
 get the git branch name (can be empty, for example if HEAD points to a tag) More...
 
__EXPORT uint64_t px4_firmware_version_binary (void)
 Firmware version in binary form (first part of the git tag) More...
 
__EXPORT const char * px4_ecl_lib_version_string (void)
 ECL lib version as human readable string (git tag) More...
 
__EXPORT uint64_t px4_mavlink_lib_version_binary (void)
 MAVLink lib version in binary form (first part of the git tag) More...
 
__EXPORT uint64_t px4_os_version_binary (void)
 Operating system version in binary form (first part of the git tag) More...
 

Detailed Description

Tools for system version detection.

Author
Anton Babushkin anton.nosp@m..bab.nosp@m.ushki.nosp@m.n@me.nosp@m..com
Beat Küng beat-.nosp@m.kuen.nosp@m.g@gmx.nosp@m..net

Definition in file version.h.

Function Documentation

◆ px4_board_hw_revision()

static int px4_board_hw_revision ( void  )
inlinestatic

get the board HW revision

Definition at line 78 of file version.h.

References __END_DECLS, px4_board_version(), px4_build_uri(), px4_ecl_lib_version_string(), px4_firmware_git_branch(), px4_firmware_vendor_version(), px4_firmware_version(), px4_firmware_version_binary(), px4_firmware_version_string(), px4_mavlink_lib_version_binary(), px4_os_name(), px4_os_version(), px4_os_version_binary(), px4_os_version_string(), px4_toolchain_name(), px4_toolchain_version(), version_tag_to_number(), and version_tag_to_vendor_version_number().

Referenced by ver_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ px4_board_hw_version()

static int px4_board_hw_version ( void  )
inlinestatic

get the board HW version

Definition at line 70 of file version.h.

Referenced by ver_main().

Here is the caller graph for this function:

◆ px4_board_name()

static __BEGIN_DECLS const char* px4_board_name ( void  )
inlinestatic

get the board name as string (including the version if there are multiple)

Definition at line 54 of file version.h.

Referenced by UavcanNode::getHardwareVersion(), ver_main(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ px4_board_sub_type()

static const char* px4_board_sub_type ( void  )
inlinestatic

get the board sub type

Definition at line 62 of file version.h.

Referenced by ver_main(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ px4_board_version()

__EXPORT uint32_t px4_board_version ( void  )

get the board version (last 8 bytes should be silicon ID, if any)

Definition at line 250 of file version.c.

References CONFIG_CDCACM_PRODUCTID.

Referenced by px4_board_hw_revision(), and Mavlink::send_autopilot_capabilites().

Here is the caller graph for this function:

◆ px4_build_uri()

const char* px4_build_uri ( void  )

get the build URI (used for crash logging)

Definition at line 61 of file version.c.

References STRINGIFY.

Referenced by px4_board_hw_revision(), ver_main(), and write_dump_info().

Here is the caller graph for this function:

◆ px4_ecl_lib_version_string()

__EXPORT const char* px4_ecl_lib_version_string ( void  )

ECL lib version as human readable string (git tag)

Definition at line 348 of file version.c.

References px4_mavlink_lib_version_binary().

Referenced by px4_board_hw_revision(), and px4::logger::Logger::write_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ px4_firmware_git_branch()

__EXPORT const char* px4_firmware_git_branch ( void  )

get the git branch name (can be empty, for example if HEAD points to a tag)

Definition at line 245 of file version.c.

Referenced by px4_board_hw_revision(), ver_main(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ px4_firmware_vendor_version()

__EXPORT uint32_t px4_firmware_vendor_version ( void  )

get the PX4 Firmware vendor version

Returns
version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type
See also
FIRMWARE_TYPE)

Definition at line 240 of file version.c.

References version_tag_to_vendor_version_number().

Referenced by px4_board_hw_revision(), Mavlink::send_autopilot_capabilites(), and px4::logger::Logger::write_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ px4_firmware_version()

__EXPORT uint32_t px4_firmware_version ( void  )

get the PX4 Firmware version

Returns
version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type
See also
FIRMWARE_TYPE)

Definition at line 149 of file version.c.

References version_tag_to_number().

Referenced by px4_board_hw_revision(), Mavlink::send_autopilot_capabilites(), ver_main(), and px4::logger::Logger::write_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ px4_firmware_version_binary()

__EXPORT uint64_t px4_firmware_version_binary ( void  )

Firmware version in binary form (first part of the git tag)

Definition at line 343 of file version.c.

Referenced by px4_board_hw_revision(), and Mavlink::send_autopilot_capabilites().

Here is the caller graph for this function:

◆ px4_firmware_version_string()

__EXPORT const char* px4_firmware_version_string ( void  )

Firmware version as human readable string (git tag)

Definition at line 338 of file version.c.

Referenced by UavcanEsc::fill_node_info(), UavcanNode::fill_node_info(), px4_board_hw_revision(), ver_main(), write_dump_info(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ px4_mavlink_lib_version_binary()

__EXPORT uint64_t px4_mavlink_lib_version_binary ( void  )

MAVLink lib version in binary form (first part of the git tag)

Referenced by px4_board_hw_revision(), px4_ecl_lib_version_string(), and Mavlink::send_protocol_version().

Here is the caller graph for this function:

◆ px4_os_name()

__EXPORT const char* px4_os_name ( void  )

name of the operating system

Returns
human readable string

Definition at line 297 of file version.c.

Referenced by px4_board_hw_revision(), ver_main(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ px4_os_version()

__EXPORT uint32_t px4_os_version ( void  )

operating system version

Returns
version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type
See also
FIRMWARE_TYPE)

Definition at line 259 of file version.c.

References version_tag_to_number().

Referenced by px4_board_hw_revision(), Mavlink::send_autopilot_capabilites(), ver_main(), and px4::logger::Logger::write_version().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ px4_os_version_binary()

__EXPORT uint64_t px4_os_version_binary ( void  )

Operating system version in binary form (first part of the git tag)

Returns
this is not available on all OSes and can return 0

Definition at line 364 of file version.c.

Referenced by px4_board_hw_revision(), and Mavlink::send_autopilot_capabilites().

Here is the caller graph for this function:

◆ px4_os_version_string()

__EXPORT const char* px4_os_version_string ( void  )

Operating system version as human readable string (git tag)

Returns
string or NULL if not defined

Definition at line 288 of file version.c.

Referenced by px4_board_hw_revision(), ver_main(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ px4_toolchain_name()

__EXPORT const char* px4_toolchain_name ( void  )

Toolchain name used to compile PX4.

Definition at line 314 of file version.c.

Referenced by px4_board_hw_revision(), ver_main(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ px4_toolchain_version()

__EXPORT const char* px4_toolchain_version ( void  )

Toolchain version used to compile PX4 (no particular format)

Definition at line 329 of file version.c.

Referenced by px4_board_hw_revision(), ver_main(), and px4::logger::Logger::write_version().

Here is the caller graph for this function:

◆ version_tag_to_number()

__EXPORT uint32_t version_tag_to_number ( const char *  tag)

Convert a version tag string to a number.

Parameters
tagversion tag in one of the following forms:
  • vendor: v1.4.0-0.2.0
  • dev: v1.4.0-rc3-7-g7e282f57
  • rc: v1.4.0-rc4
  • beta: v1.4.0-beta1
  • release: v1.4.0
  • linux: 7.9.3
Returns
version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type
See also
FIRMWARE_TYPE)

Definition at line 66 of file version.c.

References FIRMWARE_TYPE_ALPHA, FIRMWARE_TYPE_BETA, FIRMWARE_TYPE_DEV, FIRMWARE_TYPE_RC, and FIRMWARE_TYPE_RELEASE.

Referenced by VersioningTest::_test_tag_to_version_number(), px4_board_hw_revision(), px4_firmware_version(), and px4_os_version().

Here is the caller graph for this function:

◆ version_tag_to_vendor_version_number()

__EXPORT uint32_t version_tag_to_vendor_version_number ( const char *  tag)

Convert a version tag string to a vendor version number.

Parameters
tagversion tag in one of the following forms:
  • vendor: v1.4.0-0.2.0
  • dev: v1.4.0-rc3-7-g7e282f57
  • rc: v1.4.0-rc4
  • beta: v1.4.0-beta1
  • release: v1.4.0
  • linux: 7.9.3
Returns
version in the form 0xAABBCCTT (AA: Major, BB: Minor, CC: Patch, TT Type
See also
FIRMWARE_TYPE)

Definition at line 154 of file version.c.

References FIRMWARE_TYPE_ALPHA, FIRMWARE_TYPE_BETA, FIRMWARE_TYPE_DEV, FIRMWARE_TYPE_RC, and FIRMWARE_TYPE_RELEASE.

Referenced by VersioningTest::_test_tag_to_version_number(), px4_board_hw_revision(), and px4_firmware_vendor_version().

Here is the caller graph for this function: