Table of Contents

Class FirmwareMetadata

Namespace
Bonsai.Harp
Assembly
Bonsai.Harp.dll

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 string

The unique identifier of the device type on which the firmware should be installed.

firmwareVersion HarpVersion

The version of the firmware contained in the device or hex file.

coreVersion HarpVersion

The version of the Harp core implemented by the firmware.

hardwareVersion HarpVersion

The 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

HarpVersion

DeviceName

Gets the unique identifier of the device type on which the firmware should be installed.

public string DeviceName { get; }

Property Value

string

FirmwareVersion

Gets the version of the firmware contained in the device or hex file.

public HarpVersion FirmwareVersion { get; }

Property Value

HarpVersion

HardwareVersion

Gets the hardware version of the device, or range of hardware versions supported by the firmware.

public HarpVersion HardwareVersion { get; }

Property Value

HarpVersion

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 FirmwareMetadata

The 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 object

The 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 string

The 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 string

The identifier of the device to check for compatibility.

hardwareVersion HarpVersion

The hardware version to check for compatibility.

assemblyVersion int

The optional board assembly version to check for compatibility.

Returns

bool

true if the firmware supports the specified hardwareVersion and assemblyVersion; 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 string

The string representing the FirmwareMetadata.

metadata FirmwareMetadata

When 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 FirmwareMetadata

The value on the left-hand side of the operator.

rhs FirmwareMetadata

The 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 FirmwareMetadata

The value on the left-hand side of the operator.

rhs FirmwareMetadata

The 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.