/** * Fault Code Parser * * Parses and validates fault codes from shadow state. */ import type { FaultInfo, RobotErrorData, SystemStateData } from './types.js'; /** * Get fault description from code * * @param code - Fault code * @returns Human-readable fault description */ export declare function getFaultDescription(code: number): string; /** * Check if an error code represents an actual error * * @param errorCode - Error code to check * @returns true if it's a real error (not 0, 255, or 65535) */ export declare function isRealErrorCode(errorCode: number | undefined): boolean; /** * Check if an error is from the current session * * Compares the error's turnOnCount with the current session's turnOnCount. * If the error's count is less than current, it's from a previous session. * * @param errorTurnOnCount - Turn on count from the error data * @param currentTurnOnCount - Current session's turn on count * @returns true if the error is from the current session */ export declare function isCurrentSessionError(errorTurnOnCount: number | undefined, currentTurnOnCount: number | undefined): boolean; /** * Parse robot error from shadow data * * @param robotError - Robot error data from shadow * @param currentTurnOnCount - Current session's turn on count * @param isPwsError - Whether this is marked as PWS error state * @returns Fault info or undefined if no active error */ export declare function parseRobotError(robotError: RobotErrorData | undefined, currentTurnOnCount: number | undefined, isPwsError?: boolean): FaultInfo | undefined; /** * Parse PWS (power supply) error from shadow data * * @param pwsError - PWS error data from shadow * @param currentTurnOnCount - Current session's turn on count * @returns Fault info or undefined if no active error */ export declare function parsePwsError(pwsError: RobotErrorData | undefined, currentTurnOnCount: number | undefined): FaultInfo | undefined; /** * Parse legacy fault codes (faultCodes object format) * * @param faultCode - Fault code number * @param faultDescription - Optional fault description from shadow * @returns Fault info or undefined if no error */ export declare function parseLegacyFaultCodes(faultCode: number | undefined, faultDescription?: string): FaultInfo | undefined; /** * Parse fault from hex string (legacy BLE format) * * @param faults - Hex string containing fault data * @returns Fault info or undefined if no error */ export declare function parseFaultsHexString(faults: string | undefined): FaultInfo | undefined; /** * Parse all fault sources from shadow state * * Checks multiple fault sources in priority order: * 1. robotError (most specific) * 2. pwsError (power supply errors) * 3. faultCodes (legacy format) * * @param robotError - Robot error data * @param pwsError - PWS error data * @param faultCodes - Legacy fault codes * @param systemState - System state for turn on count * @returns Active fault info or undefined if no active error */ export declare function parseAllFaults(robotError: RobotErrorData | undefined, pwsError: RobotErrorData | undefined, faultCodes: { faultCode?: number; faultDescription?: string; } | undefined, systemState: SystemStateData | undefined): FaultInfo | undefined; //# sourceMappingURL=faultCodeParser.d.ts.map