namespace skyscraper8.GSE.GSE;

public class GsePacket
{
    public bool StartIndicator { get; }
    public bool EndIndicator { get; }
    public int LabelTypeIndicator { get; }
    public byte? FragmentId { get; set; }
    public ushort? TotalLength { get; set; }
    public ushort? ProtocolType { get; set; }
    public GseLabel Label { get; set; }
    public byte[] GseDataBytes { get; set; }
    public uint Crc32 { get; set; }

    public GsePacket(bool startIndicator, bool endIndicator, int labelTypeIndicator)
    {
        StartIndicator = startIndicator;
        EndIndicator = endIndicator;
        LabelTypeIndicator = labelTypeIndicator;
    }

    public override string ToString()
    {
        return
            $"{nameof(StartIndicator)}: {StartIndicator}, {nameof(EndIndicator)}: {EndIndicator}, {nameof(LabelTypeIndicator)}: {LabelTypeIndicator}, {nameof(FragmentId)}: {FragmentId}, {nameof(TotalLength)}: {TotalLength}, {nameof(ProtocolType)}: {ProtocolType}, {nameof(Label)}: {Label}";
    }
}