Loading files
namespace Cubley.Diseqc
{
public static class DiseqcFrameCodec
{
public static bool TryValidateFrame(byte[] frame, out string reason)
{
if (frame == null)
{
reason = "null_frame";
return false;
}
if (frame.Length < DiseqcLimits.MinFrameBytes)
{
reason = "frame_too_short";
return false;
}
if (frame.Length > DiseqcLimits.MaxFrameBytes)
{
reason = "frame_too_long";
return false;
}
reason = string.Empty;
return true;
}
public static int GetEncodedBitCount(byte[] frame)
{
return frame == null ? 0 : frame.Length * DiseqcLimits.EncodedBitsPerByte;
}
}
}
86fa6c123This file is pinned to the selected release. Download the original to open it in your design tool.