Firmware
version.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2013 PX4 Development Team. All rights reserved.
4  * Author: Anton Babushkin <anton.babushkin@me.com>
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * 3. Neither the name PX4 nor the names of its contributors may be
17  * used to endorse or promote products derived from this software
18  * without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  *
33  ****************************************************************************/
34 
44 #pragma once
45 
46 #include <px4_config.h>
47 #include <systemlib/px4_macros.h>
48 #include <stdint.h>
49 
50 __BEGIN_DECLS
51 
55 static inline const char *px4_board_name(void)
56 {
57  return PX4_BOARD_NAME;
58 }
59 
63 static inline const char *px4_board_sub_type(void)
64 {
65  return board_get_hw_type_name();
66 }
67 
71 static inline int px4_board_hw_version(void)
72 {
73  return board_get_hw_version();
74 }
75 
79 static inline int px4_board_hw_revision(void)
80 {
81  return board_get_hw_revision();
82 }
83 
87 const char *px4_build_uri(void);
88 
99 __EXPORT uint32_t version_tag_to_number(const char *tag);
100 
105 __EXPORT uint32_t px4_firmware_version(void);
106 
117 __EXPORT uint32_t version_tag_to_vendor_version_number(const char *tag);
118 
124 
128 __EXPORT uint32_t px4_board_version(void);
129 
134 __EXPORT uint32_t px4_os_version(void);
135 
140 __EXPORT const char *px4_os_version_string(void);
141 
146 __EXPORT const char *px4_os_name(void);
147 
151 __EXPORT const char *px4_toolchain_name(void);
152 
156 __EXPORT const char *px4_toolchain_version(void);
157 
161 __EXPORT const char *px4_firmware_version_string(void);
162 
166 __EXPORT const char *px4_firmware_git_branch(void);
167 
172 
176 __EXPORT const char *px4_ecl_lib_version_string(void);
177 
182 
187 __EXPORT uint64_t px4_os_version_binary(void);
188 
189 __END_DECLS
190 
__EXPORT uint64_t px4_mavlink_lib_version_binary(void)
MAVLink lib version in binary form (first part of the git tag)
__EXPORT uint32_t version_tag_to_number(const char *tag)
Convert a version tag string to a number.
Definition: version.c:66
const char * px4_build_uri(void)
get the build URI (used for crash logging)
Definition: version.c:61
Configuration flags used in code.
A set of useful macros for enhanced runtime and compile time error detection and warning suppression...
__EXPORT uint32_t px4_board_version(void)
get the board version (last 8 bytes should be silicon ID, if any)
Definition: version.c:250
__EXPORT uint64_t px4_firmware_version_binary(void)
Firmware version in binary form (first part of the git tag)
Definition: version.c:343
__EXPORT uint32_t px4_firmware_vendor_version(void)
get the PX4 Firmware vendor version
Definition: version.c:240
Definition: I2C.hpp:51
__EXPORT const char * px4_ecl_lib_version_string(void)
ECL lib version as human readable string (git tag)
Definition: version.c:348
__EXPORT uint64_t px4_os_version_binary(void)
Operating system version in binary form (first part of the git tag)
Definition: version.c:364
__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: version.c:245
__EXPORT uint32_t px4_firmware_version(void)
get the PX4 Firmware version
Definition: version.c:149
__EXPORT const char * px4_os_version_string(void)
Operating system version as human readable string (git tag)
Definition: version.c:288
__EXPORT const char * px4_firmware_version_string(void)
Firmware version as human readable string (git tag)
Definition: version.c:338
__EXPORT const char * px4_toolchain_version(void)
Toolchain version used to compile PX4 (no particular format)
Definition: version.c:329
__EXPORT const char * px4_os_name(void)
name of the operating system
Definition: version.c:297
__EXPORT uint32_t px4_os_version(void)
operating system version
Definition: version.c:259
__EXPORT const char * px4_toolchain_name(void)
Toolchain name used to compile PX4.
Definition: version.c:314
__EXPORT uint32_t version_tag_to_vendor_version_number(const char *tag)
Convert a version tag string to a vendor version number.
Definition: version.c:154