Class FirmwareMetadata
Represents information about the device, firmware version and hardware version numbers contained in a particular device or hex file.
public sealed class FirmwareMetadata : IEquatable<FirmwareMetadata>
- Inheritance
-
FirmwareMetadata
- Implements
- Inherited Members
Constructors
FirmwareMetadata(string, HarpVersion, HarpVersion, HarpVersion, int?, int?)
Initializes a new instance of the FirmwareMetadata class with the specified device name, the firmware version and compatible hardware versions.
public FirmwareMetadata(string deviceName, HarpVersion firmwareVersion, HarpVersion coreVersion, HarpVersion hardwareVersion, int? assemblyVersion = null, int? prereleaseVersion = null)
Parameters
deviceName
stringThe unique identifier of the device type on which the firmware should be installed.
firmwareVersion
HarpVersionThe version of the firmware contained in the device or hex file.
coreVersion
HarpVersionThe version of the Harp core implemented by the firmware.
hardwareVersion
HarpVersionThe hardware version of the device, or range of hardware versions supported by the firmware.
assemblyVersion
int?The board assembly version of the device, or range of assembly versions supported by the firmware.
prereleaseVersion
int?The optional prerelease number, for preview versions of the firmware.
Properties
AssemblyVersion
Gets the board assembly version of the device, or range of assembly versions supported by the firmware.
public int? AssemblyVersion { get; }
Property Value
- int?
CoreVersion
Gets the version of the Harp core implemented by the firmware.
public HarpVersion CoreVersion { get; }
Property Value
DeviceName
Gets the unique identifier of the device type on which the firmware should be installed.
public string DeviceName { get; }
Property Value
FirmwareVersion
Gets the version of the firmware contained in the device or hex file.
public HarpVersion FirmwareVersion { get; }
Property Value
HardwareVersion
Gets the hardware version of the device, or range of hardware versions supported by the firmware.
public HarpVersion HardwareVersion { get; }
Property Value
PrereleaseVersion
Gets the optional prerelease number, for preview versions of the firmware.
public int? PrereleaseVersion { get; }
Property Value
- int?
Methods
Equals(FirmwareMetadata)
Determines whether the specified metadata object is equal to the current metadata.
public bool Equals(FirmwareMetadata other)
Parameters
other
FirmwareMetadataThe metadata object to compare with the current metadata.
Returns
- bool
true if the specified metadata object is equal to the current metadata; otherwise, false.
Equals(object)
Determines whether the specified object is equal to the current metadata.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current metadata.
Returns
- bool
true if the specified object is equal to the current metadata; otherwise, false.
GetHashCode()
Computes the hash code for the current metadata object.
public override int GetHashCode()
Returns
- int
The hash code for the current metadata object, extracted from a combination of hashes for the device name and various version numbers.
Parse(string)
Converts a string representation of the FirmwareMetadata to its equivalent value.
public static FirmwareMetadata Parse(string input)
Parameters
input
stringThe string representing the FirmwareMetadata.
Returns
- FirmwareMetadata
The equivalent FirmwareMetadata object for the specified string representation.
Supports(string, HarpVersion, int)
Returns whether the firmware supports the specified hardware version and board assembly number.
public bool Supports(string deviceName, HarpVersion hardwareVersion, int assemblyVersion = 0)
Parameters
deviceName
stringThe identifier of the device to check for compatibility.
hardwareVersion
HarpVersionThe hardware version to check for compatibility.
assemblyVersion
intThe optional board assembly version to check for compatibility.
Returns
- bool
true if the firmware supports the specified
hardwareVersion
andassemblyVersion
; otherwise, false.
ToString()
Converts the FirmwareMetadata object to its equivalent string representation.
public override string ToString()
Returns
- string
The string representation of the FirmwareMetadata object.
TryParse(string, out FirmwareMetadata)
Converts a string representation of the FirmwareMetadata to its equivalent value. A return value indicates whether the conversion succeeded.
public static bool TryParse(string input, out FirmwareMetadata metadata)
Parameters
input
stringThe string representing the FirmwareMetadata.
metadata
FirmwareMetadataWhen this method returns, contains the equivalent FirmwareMetadata object for the specified string representation if the conversion was successful; otherwise, contains null.
Returns
- bool
true if the conversion was successful; otherwise, false.
Operators
operator ==(FirmwareMetadata, FirmwareMetadata)
Determines whether the values on both sides of the equality operator are equal.
public static bool operator ==(FirmwareMetadata lhs, FirmwareMetadata rhs)
Parameters
lhs
FirmwareMetadataThe value on the left-hand side of the operator.
rhs
FirmwareMetadataThe value on the right-hand side of the operator.
Returns
- bool
true if the value on the left-hand side of the operator is equal to the value on the right-hand side; otherwise, false.
operator !=(FirmwareMetadata, FirmwareMetadata)
Determines whether the values on both sides of the inequality operator are not equal.
public static bool operator !=(FirmwareMetadata lhs, FirmwareMetadata rhs)
Parameters
lhs
FirmwareMetadataThe value on the left-hand side of the operator.
rhs
FirmwareMetadataThe value on the right-hand side of the operator.
Returns
- bool
true if the value on the left-hand side of the operator is not equal to the value on the right-hand side; otherwise, false.