Class DriverId
Class representing a driver identifier
Inherited Members
Namespace: DuetAPI.Utility
Assembly: DuetAPI.dll
Syntax
[JsonConverter(typeof(DriverIdJsonConverter))]
public sealed class DriverId
Constructors
DriverId()
Default constructor of this class
Declaration
public DriverId()
DriverId(int, int)
Constructor for creating a new instance from a board and a port
Declaration
public DriverId(int board, int port)
Parameters
Type | Name | Description |
---|---|---|
int | board | Board number |
int | port | Port number |
DriverId(string?)
Constructor for creating a new instance from a string
Declaration
public DriverId(string? value)
Parameters
Type | Name | Description |
---|---|---|
string | value | String value |
Exceptions
Type | Condition |
---|---|
ArgumentException | Driver ID could not be parsed |
DriverId(uint)
Constructor for creating a new instance from an unsigned integer
Declaration
public DriverId(uint value)
Parameters
Type | Name | Description |
---|---|---|
uint | value | Unsigned integer |
Properties
Board
Board of this driver identifier
Declaration
public int Board { get; set; }
Property Value
Type | Description |
---|---|
int |
Port
Port of this driver identifier
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
Equals(object?)
Checks whether this instance is equal to another
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | Other instance |
Returns
Type | Description |
---|---|
bool | Whether this and the other instance are equal |
Overrides
GetHashCode()
Compute a hash code for this instance
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | Hash code |
Overrides
ToString()
Convert this instance to a string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | String representation |
Overrides
Operators
implicit operator string(DriverId)
Convert an instance to a string
Declaration
public static implicit operator string(DriverId id)
Parameters
Type | Name | Description |
---|---|---|
DriverId | id | Driver ID to convert |
Returns
Type | Description |
---|---|
string |
implicit operator uint(DriverId)
Convert an instance to an unsigned integer as expected by RepRapFirmware
Declaration
public static implicit operator uint(DriverId id)
Parameters
Type | Name | Description |
---|---|---|
DriverId | id | Driver ID to convert |
Returns
Type | Description |
---|---|
uint |