7.5 KiB
7.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T02:23:54.710439+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | c40d100ec97fea56 |
Communication
Purpose
This module defines core interfaces for representing communication results, connected devices in a DAS (Data Acquisition System) network, and DAS-specific metadata. It serves as the foundational abstraction layer for device discovery, status monitoring, and communication state reporting—specifically supporting the auto-discovery and monitoring of DAS-connected hardware (e.g., SLICE6 devices connected to an SLICE6DB base station). These interfaces decouple communication logic from implementation details, enabling consistent handling of device properties, communication outcomes, and DAS-level state across the system.
Public Interface
ICommunicationReport
object UserState { get; set; }
A user-defined object for associating custom state with a communication operation (e.g., tracking request context or correlation ID).CommunicationConstantsAndEnums.CommunicationResult Result { get; set; }
The outcome of a communication operation (e.g., success, timeout, error). Note:CommunicationResultis defined in an external enum namespace (DTS.Common.Enums.Communication), not included here.byte[] Data { get; set; }
Raw payload data received or transmitted during the communication. May benullor empty depending on the operation type and result.
IDASConnectedDevice
HardwareTypes DeviceType { get; }
The hardware type of the connected device (e.g., sensor, actuator), per theHardwareTypesenum (defined externally inDTS.Common.Enums.Hardware).int Port { get; }
Zero-based port index on the DAS to which the device is physically connected.int SpotOnPort { get; }
Zero-based position of the device on its port’s daisy chain (e.g.,0= first device on the port).PhysicalAddress PhysicalAddress { get; }
The device’s MAC address (fromSystem.Net.NetworkInformation).string IPAddress { get; }
The IPv4/IPv6 address assigned to the device (as a string).string SerialNumber { get; }
Unique hardware serial number of the device.string Location { get; }
Human-readable location descriptor (e.g., "Lab A, Rack 2").string Version { get; }
Firmware version string of the device.
ICommunication_DASInfo
IDASConnectedDevice[] ConnectedDevices { get; }
Immutable array of devices currently connected to this DAS (read-only). Currently only populated for SLICE6DB.void SetConnectedDevices(IDASConnectedDevice[] devices)
Updates theConnectedDevicesarray. Intended for internal use by DAS implementations during discovery.string[] SerialNumbers { get; set; }
Parallel array of serial numbers for connected devices (order matchesConnectedDevices).string[] FirmwareVersions { get; set; }
Parallel array of firmware versions for connected devices (order matchesConnectedDevices).string StackSerialNumber(int devid)
Returns the serial number of the device at indexdevidin theConnectedDevicesarray. Behavior for invaliddevidis unspecified.DateTime? FirstUseDate { get; set; }
Date of the device’s first operational use.nullindicates the hardware has never been used since calibration. Only valid whenIsFirstUseDateSupportedistrue.bool IsFirstUseDateSupported { get; set; }
Indicates whether the DAS hardware supports tracking first-use date (requires firmware/user-attribute storage and calibration support per ticket 15524).bool IsStreamingSupported { get; set; }
Indicates whether the DAS supports streaming data (e.g., via ticket 30429, controllable via theDISABLE_STREAMING_FEATUREsystem attribute).
Invariants
ICommunicationReport:Datamay benullor non-empty only ifResultindicates success or partial success (implementation-dependent).UserStateis not interpreted by the interface; its lifecycle is managed by the caller.
IDASConnectedDevice:PortandSpotOnPortare zero-based indices.PhysicalAddressis guaranteed non-null (asPhysicalAddressis a struct in .NET, but the interface implies it is initialized).SerialNumber,Location, andVersionare non-null strings (no explicit nullability annotation, but context implies required fields).
ICommunication_DASInfo:ConnectedDevices,SerialNumbers, andFirmwareVersionsmust have identical lengths when populated.FirstUseDateis only meaningful whenIsFirstUseDateSupportedistrue; otherwise, it should be ignored.StackSerialNumber(devid)assumesdevidis a valid index intoConnectedDevices; out-of-bounds behavior is undefined.
Dependencies
- External Dependencies:
DTS.Common.Enums.Communication.CommunicationResult(forICommunicationReport.Result)DTS.Common.Enums.Hardware.HardwareTypes(forIDASConnectedDevice.DeviceType)System.Net.NetworkInformation.PhysicalAddress(forIDASConnectedDevice.PhysicalAddress)
- Internal Dependencies:
ICommunication_DASInfois used by DAS implementations (e.g., SLICE6DB) to expose device metadata.IDASConnectedDeviceis consumed by higher-level discovery/monitoring logic (e.g., auto-discovery services).
- Consumers:
- Likely used by DAS-specific communication layers (e.g.,
DASCommunicationManager) and device monitoring services. ICommunicationReportis probably returned by asynchronous communication operations (e.g.,SendAsync,ReceiveAsync).
- Likely used by DAS-specific communication layers (e.g.,
Gotchas
StackSerialNumber(int devid): No validation or exception behavior is specified for invaliddevid(e.g., negative or ≥ConnectedDevices.Length). Implementations may throwArgumentOutOfRangeExceptionor returnnull—behavior is implementation-defined.ConnectedDevicesmutability: WhileConnectedDevicesis read-only (getonly),SetConnectedDevices()allows external mutation. Callers must ensure thread-safety if used concurrently.FirstUseDatesemantics: Anullvalue does not imply "never calibrated"—it means "never used since calibration." A calibrated but unused device may still haveFirstUseDate == null.IsStreamingSupported: Support is hardware/firmware-dependent and may be toggled via system attributes (e.g.,DISABLE_STREAMING_FEATURE). The interface does not enforce consistency with actual runtime streaming capability.- No error details:
ICommunicationReportlacks error codes, messages, or stack traces—only a high-levelResultenum. Debugging requires correlating with logs orUserState. - Missing nullability annotations: Properties like
Data,SerialNumber, andIPAddresslack?for nullability despite potentialnullvalues in practice. This may cause confusion in nullable-enabled contexts. - No versioning guarantees: Arrays (
SerialNumbers,FirmwareVersions) are parallel toConnectedDevicesbut have no explicit synchronization mechanism—out-of-sync arrays could occur ifSetConnectedDevicesis called without updating these arrays.