import { type DeviceIdentificationResult } from './device-identifier.js'; import { type GeneratorOptions, type ParameterCombination } from './parameter-generator.js'; /** * Discovered device with full configuration */ export interface DiscoveredDevice extends ParameterCombination { /** Device identification result */ identification: DeviceIdentificationResult; } /** * Scanner options */ export interface ScanOptions { /** Serial port path (e.g., /dev/ttyUSB0) */ port: string; /** Response timeout in milliseconds */ timeout: number; /** Delay between attempts in milliseconds */ delayMs: number; /** Maximum number of devices to find (0 for unlimited, default: 1) */ maxDevices?: number; /** Verbose progress - show current parameters being tested */ verbose?: boolean; /** Progress callback (current index, total combinations, devices found) */ onProgress?: (current: number, total: number, devicesFound: number) => void; /** Device found callback */ onDeviceFound?: (device: DiscoveredDevice) => void; /** Verbose progress callback - called for each test attempt */ onTestAttempt?: (params: ParameterCombination, result: 'testing' | 'found' | 'not-found') => void; } /** * Scan for Modbus devices using given parameter combinations * * **Performance Optimization**: Uses grouped generator to avoid materializing * all combinations. Groups by serial parameters to reuse connections, * reducing overhead from ~600ms to ~100ms per test. * * **Memory Efficiency**: Only materializes one group (~247 combinations) at a time * instead of all ~1500+ combinations. * * @param generatorOptions - Options for parameter combination generation * @param scanOptions - Scanning options * @returns Array of discovered devices */ export declare function scanForDevices(generatorOptions: GeneratorOptions, scanOptions: ScanOptions): Promise; //# sourceMappingURL=scanner.d.ts.map