import { Logger } from 'pino'; import { IScanOptions, IScanController, IScanReport } from '../types/public.js'; import { TrafficSniffer } from '../transport/trackers/traffic-sniffer.js'; /** * Controller class to manage the execution state of a scanning process. * Provides methods to pause, resume, or stop active scans. */ export declare class ScanController implements IScanController { private _isPaused; private _isStopped; /** Pauses the current scan. Probes will wait until resume is called. */ pause(): void; /** Resumes a previously paused scan. */ resume(): void; /** Stops the scan immediately. */ stop(): void; /** Resets the controller state to initial (not paused, not stopped). */ reset(): void; /** Gets whether the scan is currently paused. */ get isPaused(): boolean; /** Gets whether the scan has been stopped. */ get isStopped(): boolean; } /** * Core utility class for discovering Modbus devices on Serial (RTU) and TCP networks. * It performs brute-force probing based on defined profiles. */ export declare class ModbusScanner { private logger; private _sniffer?; /** * @param {Logger} logger - Pino logger for scan activity. * @param {TrafficSniffer} [_sniffer] - Optional traffic sniffer for debugging. */ constructor(logger: Logger, _sniffer?: TrafficSniffer | undefined); /** * Scans a physical Serial port or WebSerial port for Modbus RTU devices. * Iterates through combinations of Baud Rate, Parity, Stop Bits, and Slave IDs. * * @param {IScanOptions} options - Scanning parameters and callbacks. * @param {'node-rtu' | 'web-rtu'} transportType - Environment-specific transport type. * @param {IScanController} ctrl - Controller to manage scan state. * @returns {Promise} Final report containing found devices and performance stats. */ scanRtu(options: IScanOptions, transportType: 'node-rtu' | 'web-rtu', ctrl: IScanController): Promise; /** * Scans Modbus TCP unit IDs over a network connection. * Uses concurrency to probe multiple Unit IDs simultaneously. * * @param {IScanOptions} options - Scanning parameters and callbacks. * @param {IScanController} ctrl - Controller to manage scan state. * @returns {Promise} Final report of found TCP devices. */ scanTcp(options: IScanOptions, ctrl: IScanController): Promise; /** * Internal helper to add an identified RTU device to results. * @private */ private _addRtu; /** * Internal helper to add an identified TCP device to results. * @private */ private _addTcp; }