Firmware
Functions
version.h File Reference

Tools for system version detection. More...

#include <px4_config.h>
#include <systemlib/px4_macros.h>
#include <stdint.h>

Go to the source code of this file.

Functions

const char * px4_build_uri (void)
 get the build URI (used for crash logging)
 
__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)
 
__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.
 
__EXPORT const char * px4_toolchain_version (void)
 Toolchain version used to compile PX4 (no particular format)
 
__EXPORT const char * px4_firmware_version_string (void)
 Firmware version as human readable string (git tag)
 
__EXPORT const char * px4_firmware_git_branch (void)
 get the git branch name (can be empty, for example if HEAD points to a tag)
 
__EXPORT uint64_t px4_firmware_version_binary (void)
 Firmware version in binary form (first part of the git tag)
 
__EXPORT const char * px4_ecl_lib_version_string (void)
 ECL lib version as human readable string (git tag)
 
__EXPORT uint64_t px4_mavlink_lib_version_binary (void)
 MAVLink lib version in binary form (first part of the git tag)
 
__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

Function Documentation

§ 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)

§ 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)

§ px4_os_name()

__EXPORT const char* px4_os_name ( void  )

name of the operating system

Returns
human readable string

§ 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)

§ 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

§ 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

§ 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.0rc3-7-g7e282f57
  • rc: v1.4.0rc4
  • 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)

§ 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.0rc3-7-g7e282f57
  • rc: v1.4.0rc4
  • 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)