6.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:03:06.051623+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | d690cf8a777399d3 |
Communication
Purpose
This module defines core interfaces for representing communication state and device metadata within the DTS (Data Acquisition System) framework. Specifically, it standardizes how communication results, data payloads, and device information (including device topology, identity, and capabilities) are exposed across the system—particularly for auto-discovery and status monitoring of DAS-connected hardware (e.g., S6 devices on an S6DB). These interfaces serve as contracts for implementations handling device communication, status reporting, and metadata management.
Public Interface
ICommunicationReport
Represents the outcome and associated data of a communication operation.
object UserState { get; set; }
Arbitrary user-defined state object, typically used to correlate asynchronous operations or pass context through callbacks.CommunicationConstantsAndEnums.CommunicationResult Result { get; set; }
The result status of the communication operation (e.g., success, timeout, error). Note:CommunicationResultis defined in an external enum namespace.byte[] Data { get; set; }
Raw byte payload returned or sent during the communication. May benullif no data is applicable (e.g., for command-only operations or failures).
IDASConnectedDevice
Describes a single device physically connected to a DAS (e.g., S6 on S6DB), including its location, identity, and network properties.
HardwareTypes DeviceType { get; }
The enumerated type of the device (e.g.,S6,S6DB). Defined inDTS.Common.Enums.Hardware.int Port { get; }
Zero-based port index on the DAS to which the device is connected.int SpotOnPort { get; }
Zero-based position of the device along the chain or daisy chain on the given port.PhysicalAddress PhysicalAddress { get; }
MAC address of the device (fromSystem.Net.NetworkInformation).string IPAddress { get; }
IPv4/IPv6 address string assigned to the device.string SerialNumber { get; }
Unique hardware serial number.string Location { get; }
Human-readable location identifier (e.g., "Lab A, Rack 2").string Version { get; }
Firmware or software version string.
ICommunication_DASInfo
Encapsulates metadata about a DAS unit and its connected devices.
IDASConnectedDevice[] ConnectedDevices { get; }
Immutable array of devices currently connected to this DAS. Currently only populated for SLICE6DB.void SetConnectedDevices(IDASConnectedDevice[] devices)
Mutator to populateConnectedDevices. Intended for internal use during device enumeration/discovery.string[] SerialNumbers { get; set; }
Parallel array of serial numbers for connected devices (index-aligned withConnectedDevices).string[] FirmwareVersions { get; set; }
Parallel array of firmware versions for connected devices (index-aligned withConnectedDevices).string StackSerialNumber(int devid)
Returns the serial number of the device at the specifieddevidindex (0-based). Assumesdevidis valid for the currentConnectedDevicesarray.DateTime? FirstUseDate { get; set; }
Date of first operational use.nullindicates the device has not been used since last calibration (or calibration is unsupported). Valid only whenIsFirstUseDateSupportedistrue.bool IsFirstUseDateSupported { get; set; }
Indicates whether the hardware supports tracking first-use date (requires firmware/user-attribute storage and calibration support per issue #15524).bool IsStreamingSupported { get; set; }
Indicates whether the hardware supports streaming data (e.g., via system attributeDISABLE_STREAMING_FEATUREper issue #30429).
Invariants
ConnectedDevicesalignment:SerialNumbers[i]andFirmwareVersions[i]must correspond toConnectedDevices[i]for all valid indicesi.StackSerialNumbercontract: Must return the serial number at indexdevidinConnectedDevices; behavior is undefined ifdevidis out of bounds.FirstUseDatevalidity:FirstUseDate.HasValueis only meaningful whenIsFirstUseDateSupported == true; otherwise, it should be ignored.Resultsemantics: TheResultfield inICommunicationReportmust accurately reflect the outcome of the operation;Datamay be non-null only for successful or partial-success results (implementation-dependent).
Dependencies
- Depends on:
DTS.Common.Enums.Communication.CommunicationResult(external enum)DTS.Common.Enums.Hardware.HardwareTypes(external enum)System.Net.NetworkInformation.PhysicalAddress(BCL type)
- Depended on by:
- Components implementing auto-discovery and device monitoring (e.g., DAS status monitors, network scanners).
- Code handling device metadata aggregation (e.g., configuration managers, diagnostic tools).
- Likely consumed by higher-level communication layers (e.g.,
ICommunicationService,DASController).
Gotchas
ConnectedDevicesis currently only populated for SLICE6DB: Other DAS types may return an empty or uninitialized array. Do not assume it is universally populated.SetConnectedDevicesis a setter, not an adder: It replaces the entire array; incremental updates require manual reconstruction.StackSerialNumberusesdevidas an array index: No bounds checking is specified; callers must ensure0 ≤ devid < ConnectedDevices.Length.FirstUseDatesemantics are conditional: Anullvalue does not necessarily mean "never used"—it may also indicate lack of hardware support.IsStreamingSupportedis hardware- and firmware-dependent: Support may be toggled via system attributes (e.g.,DISABLE_STREAMING_FEATURE), so runtime checks may be necessary beyond this flag.- No validation rules specified: Interfaces do not enforce non-null constraints (e.g.,
IPAddressorSerialNumbercould benullor empty strings). Consumers must handle missing data defensively. - No thread-safety guarantees: Interfaces are passive data contracts; thread-safety must be handled by implementations.
None of the interfaces define event handlers, async methods, or lifecycle management—these are handled elsewhere.