bfbs crc32
Some checks failed
🚀 Pack skyscraper8 / make-zip (push) Failing after 1m31s

This commit is contained in:
feyris-tan 2025-11-07 16:09:27 +01:00
parent 33d17a730b
commit 124bf9eb49

View File

@ -17,6 +17,7 @@ namespace skyscraper8.GS.GSE_BFBS
private readonly ISubTsHandler _subTsHandler;
private GseLabel lastLabel;
private int frameNo;
public BfbsGseReader(byte misId, ISubTsHandler subTsHandler)
{
@ -26,6 +27,7 @@ namespace skyscraper8.GS.GSE_BFBS
public void PushFrame(BBHeader bbHeader, ReadOnlySpan<byte> readOnlySpan)
{
frameNo++;
bool validCrc = DvbCrc32.ValidateCrc(readOnlySpan);
if (!validCrc)
return;
@ -36,7 +38,7 @@ namespace skyscraper8.GS.GSE_BFBS
StreamlikeSpan span = new StreamlikeSpan(readOnlySpan);
while (span.GetAvailableBytes() >= 1)
while (span.GetAvailableBytes() > 4)
{
byte byteA = span.ReadUInt8();
bool startIndicator = (byteA & 0x80) != 0;
@ -97,21 +99,20 @@ namespace skyscraper8.GS.GSE_BFBS
ReadOnlySpan<byte> gseDataBytes = span.ReadBytes(gseLength);
uint? crc32 = null;
if (!startIndicator && endIndicator)
{
uint crc32 = span.ReadUInt32BE();
throw new NotImplementedException("crc32");
crc32 = span.ReadUInt32BE();
}
HandleGseFrame(startIndicator, endIndicator, fragId, totalLength, label, protocolType,
gseDataBytes);
HandleGseFrame(startIndicator, endIndicator, fragId, totalLength, label, protocolType, gseDataBytes, crc32);
}
}
}
private void HandleGseFrame(bool startIndicator, bool endIndicator, byte? fragId, ushort? totalLength, GseLabel label, ushort? protocolType, ReadOnlySpan<byte> gseDataBytes)
private void HandleGseFrame(bool startIndicator, bool endIndicator, byte? fragId, ushort? totalLength, GseLabel label, ushort? protocolType, ReadOnlySpan<byte> gseDataBytes, uint? crc32)
{
throw new NotImplementedException();
//throw new NotImplementedException();
}
}
}