|
MIP_SDK
v3.0.0
MicroStrain Communications Library for embedded systems
|
Represents the device firmware version. More...
#include <firmware_version.hpp>
Public Member Functions | |
| FirmwareVersion ()=default | |
| FirmwareVersion (uint8_t major, uint8_t minor, uint8_t patch) | |
| FirmwareVersion (uint16_t version) | |
| FirmwareVersion (const FirmwareVersion &)=default | |
| FirmwareVersion & | operator= (const FirmwareVersion &)=default |
| FirmwareVersion & | operator= (uint16_t version) |
| bool | isNull () const |
| bool | isValid () const |
| bool | isDevVersion () const |
| bool | isReleaseVersion () const |
| bool | isSpecialVersion () const |
| uint16_t | asU16 () const |
| uint16_t & | asU16 () |
| void | fromParts (uint8_t major, uint8_t minor, uint8_t patch) |
| uint8_t | major () const |
| uint8_t | minor () const |
| uint8_t | patch () const |
| bool | operator== (FirmwareVersion other) const |
| bool | operator!= (FirmwareVersion other) const |
| bool | operator<= (FirmwareVersion other) const |
| bool | operator>= (FirmwareVersion other) const |
| bool | operator< (FirmwareVersion other) const |
| bool | operator> (FirmwareVersion other) const |
| void | toString (char *buffer, size_t buffer_size) const |
| Convert the version to a string in the standard X.Y.ZZ format. More... | |
| bool | fromString (const char *str, size_t length=-1) |
| Reads a standard-format string (X.Y.ZZ\0 or XYZZ\0). More... | |
| std::string | toString () const |
| Convert a FirmwareVersion to a string separated by periods. More... | |
Represents the device firmware version.
Device firmware is of the form X.Y.ZZ, where:
Internally this class stores the version as a 16-bit unsigned integer.
|
default |
|
inline |
|
inlineexplicit |
|
default |
|
inline |
|
inline |
|
inline |
| bool mip::FirmwareVersion::fromString | ( | const char * | str, |
| size_t | length = -1 |
||
| ) |
Reads a standard-format string (X.Y.ZZ\0 or XYZZ\0).
| str | Input string. Can be unterminated if length is specified. |
| length | Length of input string. Assumed to be NULL-terminated if -1. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| std::string mip::FirmwareVersion::toString | ( | ) | const |
Convert a FirmwareVersion to a string separated by periods.
This is different from Version::toString in that the patch number uses zero-padding.
| void mip::FirmwareVersion::toString | ( | char * | buffer, |
| size_t | buffer_size | ||
| ) | const |
Convert the version to a string in the standard X.Y.ZZ format.
Note: The result is unspecified for invalid version numbers.
| buffer | Character buffer to write into. |
| buffer_size | Length (including space for null terminator) of buffer. |
1.8.17