Class FirmwareVersion
public class FirmwareVersion
- Inheritance
-
objectFirmwareVersion
- Derived
Constructors
FirmwareVersion()
public FirmwareVersion()
FirmwareVersion(byte, byte, byte)
public FirmwareVersion(byte major, byte minor = 0, byte patch = 0)
Parameters
majorbyteminorbytepatchbyte
Properties
Major
public byte Major { get; set; }
Property Value
- byte
Minor
public byte Minor { get; set; }
Property Value
- byte
Patch
public byte Patch { get; set; }
Property Value
- byte
Methods
CompareTo(object?)
Compares the relative sort order of the specified object to the current object.
public int CompareTo(object? obj)
Parameters
objobject
Returns
- int
An integer that indicates whether the current instance precedes (negative value), follows (positive value), or occurs in the same position (0) in the sort order as the other object.
Remarks
By definition any object compares greater than null.
CompareTo(FirmwareVersion)
Compares the relative sort order of the current instance with another object of the same type.
public int CompareTo(FirmwareVersion other)
Parameters
otherFirmwareVersion
Returns
- int
An integer that indicates whether the current instance precedes (negative value), follows (positive value), or occurs in the same position (0) in the sort order as the other object.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
- bool
Equals(FirmwareVersion)
public bool Equals(FirmwareVersion other)
Parameters
otherFirmwareVersion
Returns
- bool
FromBytes(ReadOnlySpan<byte>)
Creates a FirmwareVersion from a byte array. The byte array must contain exactly three bytes, representing the major, minor, and patch versions.
public static FirmwareVersion FromBytes(ReadOnlySpan<byte> bytes)
Parameters
bytesReadOnlySpan<byte>A byte array containing the version information.
Returns
- FirmwareVersion
A FirmwareVersion instance.
Remarks
The first byte represents the major version, the second byte represents the minor version, and the third byte represents the patch version.
Exceptions
- ArgumentException
Thrown if the byte array does not contain exactly three bytes.
GetHashCode()
public override int GetHashCode()
Returns
- int
Parse(string)
Parse a string of the form "major.minor.patch"
public static FirmwareVersion Parse(string versionString)
Parameters
versionStringstring
Returns
- FirmwareVersion
Returns a FirmwareVersion instance
Exceptions
- ArgumentNullException
- ArgumentException
ToString()
public override string ToString()
Returns
- string
Operators
operator ==(FirmwareVersion, FirmwareVersion)
public static bool operator ==(FirmwareVersion left, FirmwareVersion right)
Parameters
leftFirmwareVersionrightFirmwareVersion
Returns
- bool
operator >(FirmwareVersion, FirmwareVersion)
public static bool operator >(FirmwareVersion left, FirmwareVersion right)
Parameters
leftFirmwareVersionrightFirmwareVersion
Returns
- bool
operator >=(FirmwareVersion, FirmwareVersion)
public static bool operator >=(FirmwareVersion left, FirmwareVersion right)
Parameters
leftFirmwareVersionrightFirmwareVersion
Returns
- bool
operator !=(FirmwareVersion, FirmwareVersion)
public static bool operator !=(FirmwareVersion left, FirmwareVersion right)
Parameters
leftFirmwareVersionrightFirmwareVersion
Returns
- bool
operator <(FirmwareVersion, FirmwareVersion)
public static bool operator <(FirmwareVersion left, FirmwareVersion right)
Parameters
leftFirmwareVersionrightFirmwareVersion
Returns
- bool
operator <=(FirmwareVersion, FirmwareVersion)
public static bool operator <=(FirmwareVersion left, FirmwareVersion right)
Parameters
leftFirmwareVersionrightFirmwareVersion
Returns
- bool