8.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T04:01:01.723717+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | d09b358f05b11ecc |
HardwareDiscovery
Documentation: HardwareDiscoveryParameters
Purpose
The HardwareDiscoveryParameters class encapsulates configuration and control flags for the hardware discovery phase within the state machine of the DAS (Data Acquisition System) service. It defines how hardware devices (SLICE and TDAS units) are discovered—via explicit IPs, IP ranges, or multicast—and what actions should follow discovery (e.g., hardware validation, connection, firmware checks). It serves as the input contract for the discovery state, allowing callers to customize discovery behavior (e.g., skip connection, require specific devices, trigger post-discovery transitions) without modifying the discovery logic itself.
Public Interface
Properties
| Property | Type | Default | Description |
|---|---|---|---|
ReadIds |
bool |
false |
Whether to read device identifiers (e.g., serial, firmware) after connection. |
Addresses |
string[] |
new string[0] |
Explicit IP addresses to attempt connection to. If not in known lists, tried as both SLICE and TDAS. |
AddressRanges |
Tuple<string, string>[] |
new Tuple<string, string>[0] |
IP ranges to ping (inclusive on last octet). Format: ("aaa.bbb.ccc.ddd", "aaa.bbb.ccc.eee"). Responding IPs added to connection list. |
KnownTDASIPAddresses |
string[] |
new string[0] |
IPs confirmed to be TDAS units. Only tried as TDAS (not SLICE). |
KnownSLICEIPAddresses |
string[] |
new string[0] |
IPs confirmed to be SLICE units. Only tried as SLICE (not TDAS). |
ProceedWhenDone |
bool |
false |
If false, remain in discovery state after completion (e.g., for inspection). If true, proceed to next state. |
RequireAllDASFound |
bool |
false |
If true, discovery fails if any device in Addresses, AddressRanges, or RequiredSerials is not found. |
GoToDownload |
bool |
false |
If true, transition to Download state after successful discovery (implies ProceedWhenDone = true). |
Connect |
bool |
false |
If false, only perform ICMP ping (no socket connection). If true, attempt full connection. |
UseMulticastDiscover |
bool |
false |
Whether to use UDP/Multicast discovery protocol (e.g., SSDP-like). |
ConnectTimeoutMS |
int |
30000 |
Timeout (ms) for connection attempts. |
RunAutoSense |
bool |
true |
Whether to run auto-sense logic (e.g., fallback discovery). Note: Overridden if DisableAutoSense is set elsewhere (not in this class). |
RequeryDevice |
IDASCommunication |
null |
A specific device to re-query (e.g., after config change). If non-null, discovery targets only this device. |
RequiredSerials |
string[] |
new string[0] |
Serial numbers of devices required to be discovered. Used for validation (RequireAllDASFound may apply). |
DoHardwareChecks |
bool |
false |
Whether to perform hardware validation (voltage, memory, firmware) after connection. |
ExpectedHardware |
IDASHardware[] |
new IDASHardware[0] |
Hardware expected to be present post-discovery. Used in DoHardwareChecks. |
DoVoltageChecks |
bool |
true |
Whether to include input/battery voltage checks as part of DoHardwareChecks. |
UnitIsInDbQuery |
UnitIsInDbDelegate |
null |
Callback: bool UnitIsInDb(IDASCommunication das) — checks if device is registered in DB. |
UnitExpectedFirmwareQuery |
FirmwareExpectedVersionDelegate |
null |
Callback: string ExpectedFirmware(IDASCommunication das) — returns expected firmware version for device. |
CalDateExpiredQuery |
IsCalDateExpiredDelegate |
null |
Callback: bool IsCalExpired(IDASCommunication das) — checks if calibration date is expired. |
UnitExpectedMaxMemoryDelegate |
UnitExpectedMaxMemoryDelegate |
null |
Callback: long ExpectedMaxMemory(IDASCommunication das) — returns expected max memory for device. |
UpdateMaxMemoryAction |
UpdateMaxMemoryDelegate |
null |
Callback: void UpdateMaxMemory(IDASCommunication das) — updates max memory metadata (e.g., after reflash). |
Methods
| Method | Signature | Description |
|---|---|---|
Reset() |
public void Reset() |
Resets all properties to default values (e.g., empty arrays, false flags, null delegates). Does not reset ConnectTimeoutMS (remains 30000). |
ToString() |
public override string ToString() |
Returns a human-readable summary of all properties, including delegate presence ([null]/[defined]). |
Invariants
- IP Format:
Addresses,AddressRanges.Item1/Item2,KnownTDASIPAddresses, andKnownSLICEIPAddressesmust be valid IPv4 strings (aaa.bbb.ccc.ddd). Invalid formats may cause ping/connection failures but are not validated by this class. - Range Validity: For
AddressRanges,Item1andItem2must share the first three octets; otherwise, iteration logic may behave unexpectedly (no validation enforced). - Mutual Exclusivity:
RequeryDevice != nullimplies discovery is device-centric;Addresses,AddressRanges,Known*IPAddresses, andRequiredSerialsare likely ignored (behavior depends on consumer). - Delegate Consistency: If
DoHardwareChecks = true, at least one ofUnitIsInDbQuery,UnitExpectedFirmwareQuery,CalDateExpiredQuery,UnitExpectedMaxMemoryQuery, orUpdateMaxMemoryActionshould be non-null for meaningful checks—but this is not enforced. - Timeout:
ConnectTimeoutMSmust be ≥ 0. Negative values are not validated and may cause undefined behavior in connection logic.
Dependencies
Imports/References
DTS.Common.Interface.DASFactory→ ProvidesIDASCommunicationandIDASHardware.DTS.Common.Interface.DataRecorders→ Likely provides additional DAS-related interfaces (used viaIDASCommunication/IDASHardware).System→ Core types (Tuple,StringBuilder,Delegate).
Consumers (Inferred)
- State machine logic in
DTS.DASLib.Service.StateMachine(namespace implies usage). - Discovery-related state handlers (e.g.,
HardwareDiscoveryState) that consume this class to configure discovery behavior. - UI or service layer that populates this class before invoking discovery.
Dependencies on External Types
IDASCommunication: Interface for device communication (used in delegates andRequeryDevice).IDASHardware: Interface for hardware metadata (used inExpectedHardware).
Gotchas
RequeryDevicetakes precedence: IfRequeryDeviceis non-null, discovery may ignoreAddresses,AddressRanges,Known*IPAddresses, andRequiredSerials. This is implied by the summary but not enforced—consumers must handle this.GoToDownloadimpliesProceedWhenDone: While not enforced in this class,GoToDownload = truelogically requiresProceedWhenDone = true(to transition states). Consumers must ensure this.RunAutoSenseis not overridable here: The summary notesDisableAutoSenseoverrulesRunAutoSense, butDisableAutoSenseis not a property of this class. Likely set elsewhere (e.g., in discovery state logic).- No validation of IP ranges:
AddressRangesitems are used as-is. IfItem1>Item2in the last octet, iteration may produce no results or throw (source not shown). ToString()omitsConnectTimeoutMSandUseMulticastDiscover: These properties are not included in theToString()output despite being public—potential debugging pitfall.Reset()does not resetConnectTimeoutMS: Despite resetting other properties,ConnectTimeoutMSremains30000afterReset(). Intentional? Unclear from source.Known*IPAddressesare additive to discovery scope: IPs inKnownTDASIPAddresses/KnownSLICEIPAddressesare not exclusive—they are preferred paths, but discovery may still try other methods ifConnect = trueandAddresses/AddressRangesare also set.
Documentation generated from HardwareDiscoveryParameters.cs alone. Behavior of discovery logic (e.g., how AddressRanges are iterated, how RequeryDevice is handled) is inferred from comments and property names but not verifiable without consumer code.