pms5003/PMS5003/Exceptions/InvalidStartByteException.cs

16 lines
494 B
C#
Raw Normal View History

2021-04-10 14:48:03 +00:00
using System;
namespace PMS5003.Exceptions
{
/// <summary>
/// Exception that is thrown by the PMS5003 sensor when the read contains an invalid start sequence.
/// </summary>
[Serializable]
public class InvalidStartByteException : Exception
{
public InvalidStartByteException(short firstByte, short secondByte) : base(
$"Invalid start characters, expected 0x42 0x4d got [{firstByte:X}, {secondByte:X}]")
{
}
}
}