diff --git a/libraries/AP_Common/AP_FWVersion.cpp b/libraries/AP_Common/AP_FWVersion.cpp new file mode 100644 index 0000000000..82ce117718 --- /dev/null +++ b/libraries/AP_Common/AP_FWVersion.cpp @@ -0,0 +1,10 @@ +#include "AP_FWVersion.h" + +namespace AP { + +const AP_FWVersion &fwversion() +{ + return AP_FWVersion::get_fwverz(); +} + +} diff --git a/libraries/AP_Common/AP_FWVersion.h b/libraries/AP_Common/AP_FWVersion.h index 7ec8905831..f191a57592 100644 --- a/libraries/AP_Common/AP_FWVersion.h +++ b/libraries/AP_Common/AP_FWVersion.h @@ -3,13 +3,28 @@ #include #include -typedef struct { +class AP_FWVersion { + +public: + uint8_t major; uint8_t minor; uint8_t patch; FIRMWARE_VERSION_TYPE fw_type; const char *fw_string; const char *fw_hash_str; + const char *middleware_name; const char *middleware_hash_str; + const char *os_name; const char *os_hash_str; -} AP_FWVersion; + + static const AP_FWVersion &get_fwverz() { return fwver; } + +private: + + static const AP_FWVersion fwver; +}; + +namespace AP { + const AP_FWVersion &fwversion(); +};