import type ModbusRTU from 'modbus-serial'; /** * Device identification result from discovery attempt * Provides comprehensive information about device presence and capabilities */ export interface DeviceIdentificationResult { /** Whether a Modbus device is present at this address/configuration */ present: boolean; /** Response time in milliseconds */ responseTimeMs: number; /** Vendor/manufacturer name (from FC43) */ vendorName?: string; /** Product code/identifier (from FC43) */ productCode?: string; /** Model name (from FC43) */ modelName?: string; /** Firmware/hardware revision (from FC43) */ revision?: string; /** Whether device supports FC43 (Read Device Identification) */ supportsFC43?: boolean; /** Device present but returned Modbus exception code */ exceptionCode?: number; /** Request timed out (no response) */ timeout?: boolean; /** CRC check failed (wrong serial parameters) */ crcError?: boolean; } /** * Attempt to identify a Modbus device at the current client configuration * * Uses FC43 (Read Device Identification) to probe for device presence. * Any Modbus response (including exceptions) indicates a device is present. * Only timeouts and CRC errors mean no device with these parameters. * * @param client - Configured ModbusRTU client (address, serial params, and timeout already set) * @returns Device identification result * * @example * ```typescript * const client = new ModbusRTU() * await client.connectRTUBuffered('/dev/ttyUSB0', { baudRate: 9600 }) * client.setID(1) * client.setTimeout(1000) * * const result = await identifyDevice(client) * if (result.present) { * console.log(`Found device: ${result.vendorName ?? 'Unknown'}`) * } * ``` */ export declare function identifyDevice(client: ModbusRTU): Promise; //# sourceMappingURL=device-identifier.d.ts.map