31 lines
648 B
C#
31 lines
648 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HardwareControl.Core
|
|
{
|
|
public enum HardwareErrorKind
|
|
{
|
|
NotConnected,
|
|
ConnectFailed,
|
|
CommunicationFailed,
|
|
Timeout,
|
|
Unknown,
|
|
InvalidArgument,
|
|
InvalidState,
|
|
NotSupported
|
|
}
|
|
|
|
public class HardwareException : Exception
|
|
{
|
|
public HardwareErrorKind Kind { get; }
|
|
|
|
public HardwareException(HardwareErrorKind kind, string message, Exception? inner = null) : base(message, inner)
|
|
{
|
|
Kind = kind;
|
|
}
|
|
}
|
|
}
|