pms5003/PMS5003/Exceptions/InvalidStartByteException.cs
2021-04-10 17:49:36 +03:00

16 lines
No EOL
494 B
C#

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}]")
{
}
}
}