Initial Commit
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
namespace TuneBoss.Core.Protocol;
|
||||
|
||||
/// <summary>
|
||||
/// Checksum helpers for the TuneBoss BLE packet protocol.
|
||||
///
|
||||
/// genCheckSumDW: accumulates payload as little-endian uint32 DWords,
|
||||
/// sums them (wrapping uint32), then returns the bitwise inverse (~sum).
|
||||
/// Verified against debug log 17-Mar-2026.
|
||||
/// </summary>
|
||||
public static class ChecksumHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Computes the DWord checksum over a byte span.
|
||||
/// The span length must be a multiple of 4 (pad before calling if needed).
|
||||
/// </summary>
|
||||
public static uint GenChecksumDW(ReadOnlySpan<byte> data)
|
||||
{
|
||||
if (data.Length % 4 != 0)
|
||||
throw new ArgumentException("Data length must be a multiple of 4.", nameof(data));
|
||||
|
||||
uint cumResult = 0;
|
||||
for (int i = 0; i < data.Length; i += 4)
|
||||
{
|
||||
uint dword = data[i]
|
||||
| ((uint)data[i + 1] << 8)
|
||||
| ((uint)data[i + 2] << 16)
|
||||
| ((uint)data[i + 3] << 24);
|
||||
cumResult += dword; // wrapping uint32 addition
|
||||
}
|
||||
|
||||
return ~cumResult; // bitwise inverse
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the 4-byte little-endian checksum into <paramref name="dest"/>.
|
||||
/// </summary>
|
||||
public static void WriteChecksumDW(ReadOnlySpan<byte> data, Span<byte> dest)
|
||||
{
|
||||
uint cs = GenChecksumDW(data);
|
||||
dest[0] = (byte)(cs);
|
||||
dest[1] = (byte)(cs >> 8);
|
||||
dest[2] = (byte)(cs >> 16);
|
||||
dest[3] = (byte)(cs >> 24);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the single-byte header inverse sum.
|
||||
/// sum = TL_type + seqNum + dwCount; result = 0xFF - sum (byte wrap).
|
||||
/// Verified: TL=02 seq=01 dw=02 → sum=05 → invSum=FA ✓
|
||||
/// </summary>
|
||||
public static byte HeaderInverseSum(byte tlType, byte seqNum, byte dwCount)
|
||||
=> unchecked((byte)(0xFF - (tlType + seqNum + dwCount)));
|
||||
|
||||
/// <summary>
|
||||
/// Verifies an inbound packet's DWord checksum.
|
||||
/// The last 4 bytes of <paramref name="payload"/> are the checksum;
|
||||
/// the preceding bytes are the data.
|
||||
/// </summary>
|
||||
public static bool VerifyChecksumDW(ReadOnlySpan<byte> payload)
|
||||
{
|
||||
if (payload.Length < 8 || payload.Length % 4 != 0)
|
||||
return false;
|
||||
int dataLen = payload.Length - 4;
|
||||
var data = payload.Slice(0, dataLen);
|
||||
var expected = payload.Slice(dataLen, 4);
|
||||
uint computed = GenChecksumDW(data);
|
||||
|
||||
return expected[0] == (byte)(computed)
|
||||
&& expected[1] == (byte)(computed >> 8)
|
||||
&& expected[2] == (byte)(computed >> 16)
|
||||
&& expected[3] == (byte)(computed >> 24);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
namespace TuneBoss.Core.Protocol;
|
||||
|
||||
/// <summary>
|
||||
/// TuneBoss hardware command bytes.
|
||||
/// </summary>
|
||||
public static class Commands
|
||||
{
|
||||
// ── Data Link layer ─────────────────────────────────────────────────────
|
||||
public const byte DL_ACK = 0x11;
|
||||
public const byte DL_NAK_HDR = 0x12;
|
||||
public const byte DL_NAK_DATA = 0x13;
|
||||
public const byte DL_NAK_OVF = 0x14; // Rx buffer overflow — use smaller packet
|
||||
public const byte DL_NAK_TIMEOUT = 0x15;
|
||||
|
||||
// ── Transport layer ──────────────────────────────────────────────────────
|
||||
public const byte TL_POSTED = 0x01; // Requires ACK from device
|
||||
public const byte TL_NONPOSTED = 0x02; // No ACK; device returns a data packet
|
||||
public const byte TL_NP_RETURN = 0x03; // Return packet for TL_NONPOSTED
|
||||
public const byte TL_STREAMING = 0x04; // Streaming; no ACK/NAK required
|
||||
|
||||
public const byte DL_PING_NOREPLY = 0x21; // Host connectivity test; device ignores
|
||||
|
||||
// ── App commands — Non-Posted ────────────────────────────────────────────
|
||||
public const byte APP_UNLOCK = 0x30; // Password + current date at byte 4
|
||||
public const byte APP_LOCK = 0x31;
|
||||
public const byte APP_MEMRD_SEQ = 0x32; // Legacy: 8-bit len @ b1, 16-bit addr @ b2-3
|
||||
public const byte APP_UNLOCK2 = 0x33; // Basic ECU unlock (GEN3)
|
||||
public const byte APP_MEMWR_SEQ = 0x34; // Legacy: 8-bit len @ b1, 16-bit addr @ b2-3
|
||||
public const byte APP_FIRSTUSE = 0x35;
|
||||
public const byte APP_FLASH_WR = 0x36;
|
||||
public const byte APP_READ_INFO = 0x37; // Read ECU info / keepalive
|
||||
public const byte APP_CHANGE_PWD = 0x38;
|
||||
public const byte APP_IMMOBILIZER = 0x3A;
|
||||
public const byte APP_READ_DEBUG = 0x3D;
|
||||
public const byte APP_UPGRADE_MOD = 0x3E;
|
||||
|
||||
public const byte APP_MEM_INFO = 0x40; // Reserved / ignore for now
|
||||
|
||||
// ── App commands — Table read ────────────────────────────────────────────
|
||||
public const byte APP_MEMRD_2D = 0x41; // 2D tables (tuner)
|
||||
public const byte APP_MEMRD_SUBT = 0x42; // Subtables
|
||||
public const byte APP_MEMRD_1D = 0x43; // 1D tables
|
||||
public const byte APP_MEMRD_MISC = 0x44; // Misc values + device info
|
||||
public const byte APP_MEMRD_2D_USER = 0x45; // 2D user tables (GEN3 basic ECU)
|
||||
|
||||
// ── App commands — Table write ───────────────────────────────────────────
|
||||
public const byte APP_MEMWR_2D = 0x49;
|
||||
public const byte APP_MEMWR_SUBT = 0x4A;
|
||||
public const byte APP_MEMWR_1D = 0x4B;
|
||||
public const byte APP_MEMWR_MISC = 0x4C;
|
||||
public const byte APP_MEMWR_2D_USER = 0x4D; // GEN3 basic ECU
|
||||
|
||||
// ── App response codes ───────────────────────────────────────────────────
|
||||
public const byte APP_CMD_SUCCESS = 0x51;
|
||||
public const byte APP_CMD_FAIL = 0x52;
|
||||
public const byte APP_CMD_INV = 0x53;
|
||||
public const byte APP_MEMADDR_INV = 0x54; // Invalid read/write address
|
||||
public const byte APP_MEMLEN_OVF = 0x55; // Length too large for Tx/Rx buffer
|
||||
public const byte APP_MEMADDR_LOCK = 0x56; // Address locked (basic ECU)
|
||||
public const byte APP_TUNER_LOCK = 0x57; // Command locked by tuner
|
||||
|
||||
// ── App commands — Diagnostics streaming ────────────────────────────────
|
||||
public const byte APP_MONITORING = 0x70; // Streaming diagnostics frame
|
||||
public const byte APP_MON_START = 0x71;
|
||||
public const byte APP_MON_STOP = 0x72;
|
||||
|
||||
// ── App commands — Tuner lock domain ────────────────────────────────────
|
||||
public const byte APP_UNLOCK_TUNER = 0x60; // Same usage model as APP_UNLOCK
|
||||
public const byte APP_NEW_PWD_TUNER = 0x61; // Change tuner password (null×16 = disable)
|
||||
public const byte APP_RST_PWD_TUNER = 0x62; // Reset tuner password (0x55×16 = disable + reset tables)
|
||||
public const byte APP_ENCRYPT_READ = 0x63;
|
||||
public const byte APP_ENCRYPT_WRITE = 0x64;
|
||||
public const byte APP_RESET_SETTINGS = 0x65;
|
||||
|
||||
// ── App commands — Special ───────────────────────────────────────────────
|
||||
public const byte APP_ERASE_ALL = 0xF0;
|
||||
public const byte APP_LOCKED = 0xFF;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
namespace TuneBoss.Core.Protocol;
|
||||
|
||||
/// <summary>
|
||||
/// Hardware/firmware generation, discriminated by App_Info_Version byte.
|
||||
/// </summary>
|
||||
public enum GenerationType
|
||||
{
|
||||
Gen1 = 245, // App_Info_Version 0xF5 — legacy, APP_MEMRD_SEQ for all table ops
|
||||
Gen2 = 1, // Dedicated read commands per table type; APP_UNLOCK
|
||||
Gen3 = 2, // Same as Gen2 but 2D_USER uses APP_MEMRD_2D_USER; APP_UNLOCK2
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Per-generation command bytes and misc memory addresses resolved after
|
||||
/// reading App_Info_Version from the device.
|
||||
/// </summary>
|
||||
public sealed class GenerationConfig
|
||||
{
|
||||
// ── Table read commands ──────────────────────────────────────────────────
|
||||
public byte ReadCmd1D { get; init; }
|
||||
public byte ReadCmd2D { get; init; }
|
||||
public byte ReadCmd2DUser{ get; init; }
|
||||
public byte ReadCmdSubT { get; init; }
|
||||
public byte ReadCmdMisc { get; init; }
|
||||
|
||||
// ── Table write commands ─────────────────────────────────────────────────
|
||||
public byte WriteCmd1D { get; init; }
|
||||
public byte WriteCmd2D { get; init; }
|
||||
public byte WriteCmd2DUser{ get; init; }
|
||||
public byte WriteCmdSubT { get; init; }
|
||||
public byte WriteCmdMisc { get; init; }
|
||||
|
||||
// ── Unlock command ───────────────────────────────────────────────────────
|
||||
public byte UnlockCmd { get; init; }
|
||||
|
||||
// ── Misc memory addresses ────────────────────────────────────────────────
|
||||
public ushort RpmLimitAddr { get; init; }
|
||||
public ushort ShiftRpmLimitAddr { get; init; }
|
||||
public ushort MusicModeStartAddr { get; init; }
|
||||
public ushort ExtraPaddingAddr1 { get; init; }
|
||||
public ushort ExtraPaddingAddr2 { get; init; }
|
||||
public ushort ExtraPaddingAddr3 { get; init; }
|
||||
public ushort ExtraPaddingAddr4 { get; init; }
|
||||
public ushort ExtraPaddingAddr5 { get; init; }
|
||||
public ushort ExtraPaddingAddr6 { get; init; }
|
||||
|
||||
// ── Factory ─────────────────────────────────────────────────────────────
|
||||
public static GenerationConfig For(GenerationType gen) => gen switch
|
||||
{
|
||||
GenerationType.Gen1 => new GenerationConfig
|
||||
{
|
||||
ReadCmd1D = Commands.APP_MEMRD_SEQ,
|
||||
ReadCmd2D = Commands.APP_MEMRD_SEQ,
|
||||
ReadCmd2DUser = Commands.APP_MEMRD_SEQ,
|
||||
ReadCmdSubT = Commands.APP_MEMRD_SEQ,
|
||||
ReadCmdMisc = Commands.APP_MEMRD_SEQ,
|
||||
WriteCmd1D = Commands.APP_MEMWR_SEQ,
|
||||
WriteCmd2D = Commands.APP_MEMWR_SEQ,
|
||||
WriteCmd2DUser = Commands.APP_MEMWR_SEQ,
|
||||
WriteCmdSubT = Commands.APP_MEMWR_SEQ,
|
||||
WriteCmdMisc = Commands.APP_MEMWR_SEQ,
|
||||
UnlockCmd = Commands.APP_UNLOCK,
|
||||
RpmLimitAddr = 0x0840,
|
||||
ShiftRpmLimitAddr = 0x08A0,
|
||||
MusicModeStartAddr = 0x090E,
|
||||
ExtraPaddingAddr1 = 0x08BC,
|
||||
ExtraPaddingAddr2 = 0x08C8,
|
||||
ExtraPaddingAddr3 = 0x08D4,
|
||||
ExtraPaddingAddr4 = 0x08E0,
|
||||
ExtraPaddingAddr5 = 0x08FC,
|
||||
ExtraPaddingAddr6 = 0x0918,
|
||||
},
|
||||
|
||||
GenerationType.Gen2 => new GenerationConfig
|
||||
{
|
||||
ReadCmd1D = Commands.APP_MEMRD_1D,
|
||||
ReadCmd2D = Commands.APP_MEMRD_2D,
|
||||
ReadCmd2DUser = Commands.APP_MEMRD_2D,
|
||||
ReadCmdSubT = Commands.APP_MEMRD_SUBT,
|
||||
ReadCmdMisc = Commands.APP_MEMRD_MISC,
|
||||
WriteCmd1D = Commands.APP_MEMWR_1D,
|
||||
WriteCmd2D = Commands.APP_MEMWR_2D,
|
||||
WriteCmd2DUser = Commands.APP_MEMWR_2D,
|
||||
WriteCmdSubT = Commands.APP_MEMWR_SUBT,
|
||||
WriteCmdMisc = Commands.APP_MEMWR_MISC,
|
||||
UnlockCmd = Commands.APP_UNLOCK,
|
||||
RpmLimitAddr = 0x000C,
|
||||
ShiftRpmLimitAddr = 0x006C,
|
||||
MusicModeStartAddr = 0x00DA,
|
||||
ExtraPaddingAddr1 = 0x0088,
|
||||
ExtraPaddingAddr2 = 0x0094,
|
||||
ExtraPaddingAddr3 = 0x00A0,
|
||||
ExtraPaddingAddr4 = 0x00AC,
|
||||
ExtraPaddingAddr5 = 0x00C8,
|
||||
ExtraPaddingAddr6 = 0x00E4,
|
||||
},
|
||||
|
||||
GenerationType.Gen3 => new GenerationConfig
|
||||
{
|
||||
ReadCmd1D = Commands.APP_MEMRD_1D,
|
||||
ReadCmd2D = Commands.APP_MEMRD_2D,
|
||||
ReadCmd2DUser = Commands.APP_MEMRD_2D_USER, // ← key difference from Gen2
|
||||
ReadCmdSubT = Commands.APP_MEMRD_SUBT,
|
||||
ReadCmdMisc = Commands.APP_MEMRD_MISC,
|
||||
WriteCmd1D = Commands.APP_MEMWR_1D,
|
||||
WriteCmd2D = Commands.APP_MEMWR_2D,
|
||||
WriteCmd2DUser = Commands.APP_MEMWR_2D_USER, // ← key difference from Gen2
|
||||
WriteCmdSubT = Commands.APP_MEMWR_SUBT,
|
||||
WriteCmdMisc = Commands.APP_MEMWR_MISC,
|
||||
UnlockCmd = Commands.APP_UNLOCK2, // ← different unlock
|
||||
RpmLimitAddr = 0x000C,
|
||||
ShiftRpmLimitAddr = 0x006C,
|
||||
MusicModeStartAddr = 0x00DA,
|
||||
ExtraPaddingAddr1 = 0x0088,
|
||||
ExtraPaddingAddr2 = 0x0094,
|
||||
ExtraPaddingAddr3 = 0x00A0,
|
||||
ExtraPaddingAddr4 = 0x00AC,
|
||||
ExtraPaddingAddr5 = 0x00C8,
|
||||
ExtraPaddingAddr6 = 0x00E4,
|
||||
},
|
||||
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(gen), gen, "Unknown generation")
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Resolves generation from the App_Info_Version byte on the wire.
|
||||
/// </summary>
|
||||
public static GenerationType ResolveGeneration(byte appInfoVersion) => appInfoVersion switch
|
||||
{
|
||||
245 => GenerationType.Gen1,
|
||||
1 => GenerationType.Gen2,
|
||||
2 => GenerationType.Gen3,
|
||||
_ => throw new InvalidOperationException($"Unknown App_Info_Version: {appInfoVersion}")
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
namespace TuneBoss.Core.Protocol;
|
||||
|
||||
/// <summary>
|
||||
/// Builds and parses TuneBoss BLE packets over Nordic UART Service (NUS).
|
||||
///
|
||||
/// Outbound frame layout (verified against debug log 17-Mar-2026):
|
||||
/// [0..3] FF 00 FF 00 Preamble
|
||||
/// [4] TL_type Transport layer type (TL_POSTED / TL_NONPOSTED / TL_STREAMING)
|
||||
/// [5] SeqNum Sequence number (0 for streaming)
|
||||
/// [6] DwCount Payload size in DWords (4-byte units)
|
||||
/// [7] InvSum 0xFF - (TL_type + SeqNum + DwCount)
|
||||
/// [8..] Data Command payload (DwCount × 4 bytes)
|
||||
/// [last4] DataChecksum ~sum of data DWords, little-endian uint32
|
||||
///
|
||||
/// Total frame size = 8 (header) + DwCount×4 (data) + 4 (checksum)
|
||||
/// </summary>
|
||||
public static class PacketBuilder
|
||||
{
|
||||
private static readonly byte[] Preamble = { 0xFF, 0x00, 0xFF, 0x00 };
|
||||
|
||||
// ── Outbound ─────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Builds a complete outbound packet.
|
||||
/// </summary>
|
||||
/// <param name="tlType">Transport layer type (TL_NONPOSTED, TL_STREAMING etc.)</param>
|
||||
/// <param name="seqNum">Sequence number. Use 0 for streaming commands.</param>
|
||||
/// <param name="data">Command payload. Will be zero-padded to DWord boundary.</param>
|
||||
public static byte[] Build(byte tlType, byte seqNum, ReadOnlySpan<byte> data)
|
||||
{
|
||||
// Pad data to DWord boundary
|
||||
int paddedLen = (data.Length + 3) & ~3;
|
||||
byte[] paddedData = new byte[paddedLen];
|
||||
data.CopyTo(paddedData);
|
||||
|
||||
byte dwCount = (byte)(paddedLen / 4);
|
||||
byte invSum = ChecksumHelper.HeaderInverseSum(tlType, seqNum, dwCount);
|
||||
|
||||
// Total: 4 preamble + 4 header + paddedData + 4 checksum
|
||||
byte[] frame = new byte[8 + paddedLen + 4];
|
||||
|
||||
// Preamble
|
||||
frame[0] = 0xFF; frame[1] = 0x00; frame[2] = 0xFF; frame[3] = 0x00;
|
||||
|
||||
// Header
|
||||
frame[4] = tlType;
|
||||
frame[5] = seqNum;
|
||||
frame[6] = dwCount;
|
||||
frame[7] = invSum;
|
||||
|
||||
// Data
|
||||
paddedData.CopyTo(frame, 8);
|
||||
|
||||
// Checksum
|
||||
ChecksumHelper.WriteChecksumDW(paddedData, frame.AsSpan(8 + paddedLen));
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convenience: builds a TL_NONPOSTED packet with a single command byte
|
||||
/// and optional parameters, auto-padded.
|
||||
/// </summary>
|
||||
public static byte[] BuildNonPosted(byte seqNum, byte command, ReadOnlySpan<byte> parameters = default)
|
||||
{
|
||||
byte[] payload = new byte[1 + parameters.Length];
|
||||
payload[0] = command;
|
||||
parameters.CopyTo(payload.AsSpan(1));
|
||||
return Build(Commands.TL_NONPOSTED, seqNum, payload);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convenience: builds a TL_STREAMING packet (always seq=0).
|
||||
/// </summary>
|
||||
public static byte[] BuildStreaming(byte command)
|
||||
{
|
||||
return Build(Commands.TL_STREAMING, seqNum: 0, data: new[] { command });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds an APP_MON_START (0x71) streaming packet.
|
||||
/// </summary>
|
||||
public static byte[] BuildMonStart() => BuildStreaming(Commands.APP_MON_START);
|
||||
|
||||
/// <summary>
|
||||
/// Builds an APP_MON_STOP (0x72) streaming packet.
|
||||
/// </summary>
|
||||
public static byte[] BuildMonStop() => BuildStreaming(Commands.APP_MON_STOP);
|
||||
|
||||
/// <summary>
|
||||
/// Builds an APP_READ_INFO (0x37) request.
|
||||
/// Data = [0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] — 2 DWords.
|
||||
/// Verified: log line 5–7.
|
||||
/// </summary>
|
||||
public static byte[] BuildReadInfo(byte seqNum)
|
||||
=> BuildNonPosted(seqNum, Commands.APP_READ_INFO, new byte[7]);
|
||||
|
||||
// ── Inbound ──────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Result of parsing an inbound packet.
|
||||
/// </summary>
|
||||
public sealed class InboundPacket
|
||||
{
|
||||
public byte TlType { get; init; }
|
||||
public byte SeqNum { get; init; }
|
||||
public byte DwCount { get; init; }
|
||||
public byte ResponseCode { get; init; } // First byte of payload (e.g. 0x51 = success)
|
||||
public byte OriginalCmd { get; init; } // Second byte of payload (echoed command)
|
||||
public byte[] Payload { get; init; } = Array.Empty<byte>(); // Full payload excl. checksum
|
||||
public bool ChecksumValid { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses a raw inbound frame received over BLE.
|
||||
/// Returns null if the preamble is missing or the frame is too short.
|
||||
/// </summary>
|
||||
public static InboundPacket? Parse(ReadOnlySpan<byte> frame)
|
||||
{
|
||||
// Minimum: 4 preamble + 4 header + 4 data + 4 checksum = 16 bytes
|
||||
if (frame.Length < 16) return null;
|
||||
|
||||
// Validate preamble
|
||||
if (frame[0] != 0xFF || frame[1] != 0x00 || frame[2] != 0xFF || frame[3] != 0x00)
|
||||
return null;
|
||||
|
||||
byte tlType = frame[4];
|
||||
byte seqNum = frame[5];
|
||||
byte dwCount = frame[6];
|
||||
// frame[7] = invSum (not validated here; add if needed)
|
||||
|
||||
int payloadLen = dwCount * 4;
|
||||
int expectedLen = 8 + payloadLen + 4;
|
||||
if (frame.Length < expectedLen) return null;
|
||||
|
||||
var payloadWithChecksum = frame.Slice(8, payloadLen + 4);
|
||||
var payload = frame.Slice(8, payloadLen).ToArray();
|
||||
|
||||
bool csValid = ChecksumHelper.VerifyChecksumDW(payloadWithChecksum);
|
||||
|
||||
return new InboundPacket
|
||||
{
|
||||
TlType = tlType,
|
||||
SeqNum = seqNum,
|
||||
DwCount = dwCount,
|
||||
ResponseCode = payload.Length > 0 ? payload[0] : (byte)0,
|
||||
OriginalCmd = payload.Length > 1 ? payload[1] : (byte)0,
|
||||
Payload = payload,
|
||||
ChecksumValid = csValid,
|
||||
};
|
||||
}
|
||||
|
||||
// ── Diagnostics helpers ──────────────────────────────────────────────────
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if a raw frame is a diagnostics streaming packet (0x70).
|
||||
/// Fast check without full parse — used in the hot receive path.
|
||||
/// </summary>
|
||||
public static bool IsDiagnosticsFrame(ReadOnlySpan<byte> frame)
|
||||
=> frame.Length >= 9
|
||||
&& frame[4] == Commands.TL_STREAMING
|
||||
&& frame[8] == Commands.APP_MONITORING;
|
||||
}
|
||||
Reference in New Issue
Block a user