Files
2026-04-17 14:55:32 -04:00

4.5 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.Common/Classes/Sensors/StreamOut/UDPStreamProfilePacket.cs
2026-04-16T03:18:20.383714+00:00 Qwen/Qwen3-Coder-Next-FP8 1 d7985184134cc083

StreamOut

1. Purpose

The UDPStreamProfilePacket class defines the structural metadata for a UDP-based stream profile packet used in sensor data transmission. It encapsulates fixed-size header and payload configuration parameters—such as header lengths, channel-specific data identifiers, timing information, and payload scaling—required to correctly serialize/deserialize or interpret raw UDP packets conforming to a proprietary sensor streaming protocol. This class serves as a data contract for constructing or parsing stream profile packets in the DTS sensor infrastructure.

2. Public Interface

All members are public properties with int type and default values initialized inline.

  • TransHeader (int, default 4)
    Represents the size (in bytes) of the transport header. Default value is 4.

  • TimeHeader (int, default 24)
    Represents the size (in bytes) of the primary timestamp header. Default value is 24.

  • SecondTimeHeader (int, default 0)
    Represents the size (in bytes) of a secondary timestamp header, if present. Default is 0, indicating absence.

  • ChannelSpecificDataWord (int, default 0)
    Identifier or size (in bytes) for channel-specific data word; semantics unclear from source. Default is 0.

  • PCMChannelSpecificDataWord (int, default 0)
    Identifier or size (in bytes) for PCM (Pulse Code Modulation) channel-specific data word; semantics unclear from source. Default is 0.

  • Id (int, default 0)
    Packet or stream identifier. Default is 0.

  • SampleTime (int, default 0)
    Timestamp or sample time value (units unclear—likely milliseconds or microseconds). Default is 0.

  • PayloadFactor (int, default 2)
    Multiplicative factor applied to derive payload size or configure payload layout. Default is 2.

  • Trailer (int, default 0)
    Size (in bytes) of the packet trailer (e.g., checksum, padding, or footer). Default is 0.

3. Invariants

  • All properties are nullable-free value types (int) and always hold a non-null integer value.
  • No explicit validation is enforced on property values (e.g., negative sizes or zero PayloadFactor are allowed unless constrained elsewhere).
  • No ordering guarantees are implied (e.g., TransHeader + TimeHeader + SecondTimeHeader + ... is not validated against total packet size).
  • Default values are statically assigned and immutable unless explicitly modified by consumer code.

4. Dependencies

  • Imports:
    • System, System.Collections.Generic, System.Linq, System.Runtime.Remoting.Channels, System.Text, System.Threading.Tasks
    • System.Runtime.Remoting.Channels is imported but unused (no remoting types referenced in the class).
  • Namespace usage:
    • Nested under DTS.Common.Classes.Sensors.StreamOut, implying integration with other sensor/streaming components (e.g., UDPStreamProfile, SensorStreamManager).
  • Depended upon:
    • Inferred to be used by serialization/deserialization logic for UDP sensor streams (e.g., packet builders, parsers, or configuration modules), though no direct references are visible in this file.

5. Gotchas

  • Ambiguous semantics: Units and exact meaning of fields (e.g., PayloadFactor, ChannelSpecificDataWord, SampleTime) are not documented in this class. Their interpretation depends on external protocol specs or companion code.
  • Unused import: System.Runtime.Remoting.Channels is imported but unused—likely legacy or accidental.
  • No immutability or validation: Properties are mutable and lack validation; consumers must ensure consistency (e.g., non-negative header/trailer sizes).
  • No constructor or factory pattern: Relies on default initialization; no compile-time guarantee of valid combinations (e.g., SecondTimeHeader > 0 may require TimeHeader > 0, but no enforcement exists).
  • Hardcoded defaults: Default values (TransHeader=4, TimeHeader=24, PayloadFactor=2) may reflect legacy protocol versions; changing them without coordinated updates could break interoperability.
  • No documentation: XML comments or inline explanations are absent, increasing reliance on external documentation or reverse engineering.

None identified beyond the above.