2017-08-18 19:42:25 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2022-07-08 00:10:25 -03:00
|
|
|
#include <AP_Common/AP_Common.h>
|
|
|
|
#include <AP_HAL/AP_HAL_Boards.h>
|
2017-08-18 19:42:25 -03:00
|
|
|
|
2020-09-23 12:09:28 -03:00
|
|
|
class PACKED AP_FWVersion {
|
2018-06-13 07:28:40 -03:00
|
|
|
|
|
|
|
public:
|
2020-09-23 12:09:28 -03:00
|
|
|
/**
|
|
|
|
* @brief Struct to hold infomation about the software version struct
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
// First 7 MSBs are a start sequence, LSB is a checksum
|
|
|
|
const uint64_t header;
|
|
|
|
// MSB (major version breaks compatibility), LSB (minor version no compatibility break)
|
|
|
|
const uint16_t header_version;
|
|
|
|
// Pointer size to extract pointer values
|
|
|
|
const uint8_t pointer_size;
|
|
|
|
|
|
|
|
const uint8_t reserved; // padding
|
|
|
|
const uint8_t vehicle_type;
|
|
|
|
const uint8_t board_type;
|
|
|
|
const uint16_t board_subtype;
|
2020-09-23 10:00:27 -03:00
|
|
|
const uint8_t major;
|
|
|
|
const uint8_t minor;
|
|
|
|
const uint8_t patch;
|
2020-09-23 12:09:28 -03:00
|
|
|
const uint8_t fw_type; /*FIRMWARE_VERSION_TYPE*/
|
|
|
|
const uint32_t os_sw_version;
|
2017-08-18 19:42:25 -03:00
|
|
|
const char *fw_string;
|
2017-09-05 02:56:19 -03:00
|
|
|
const char *fw_hash_str;
|
2022-02-01 20:45:39 -04:00
|
|
|
const uint32_t fw_hash;
|
2022-01-14 06:33:43 -04:00
|
|
|
const char *fw_string_original;
|
2021-06-01 17:40:51 -03:00
|
|
|
const char *fw_short_string;
|
2018-06-13 07:28:40 -03:00
|
|
|
const char *middleware_name;
|
2017-09-05 02:56:19 -03:00
|
|
|
const char *middleware_hash_str;
|
2018-06-13 07:28:40 -03:00
|
|
|
const char *os_name;
|
2017-09-05 02:56:19 -03:00
|
|
|
const char *os_hash_str;
|
2018-06-13 07:28:40 -03:00
|
|
|
|
|
|
|
static const AP_FWVersion &get_fwverz() { return fwver; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
static const AP_FWVersion fwver;
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace AP {
|
|
|
|
const AP_FWVersion &fwversion();
|
|
|
|
};
|