// { from: OCPP20ConnectorStatusEnumType.Faulted, to: OCPP20ConnectorStatusEnumType.Faulted }
])
+ static readonly FIRMWARE_INSTALL_DELAY_MS = 5000
+ static readonly FIRMWARE_STATUS_DELAY_MS = 2000
+ static readonly FIRMWARE_VERIFY_DELAY_MS = 500
+
/**
* Default timeout in milliseconds for async OCPP 2.0 handler operations
* (e.g., certificate file I/O). Prevents handlers from hanging indefinitely.
*/
static readonly HANDLER_TIMEOUT_MS = 30_000
+ static readonly LOG_UPLOAD_STEP_DELAY_MS = 1000
+
+ static readonly RESET_DELAY_MS = 1000
+ static readonly RESET_IDLE_MONITOR_INTERVAL_MS = 5000
+
/**
* Set of MessageTriggerEnumType values that the charging station supports
* in the TriggerMessage handler. Used for validation and capability reporting.
`${chargingStation.logPrefix()} ${moduleName}.scheduleEvseReset: EVSE ${evseId.toString()} reset completed`
)
}
- }, 1000)
+ }, OCPP20Constants.RESET_DELAY_MS)
})
}
} else {
clearInterval(monitorInterval)
}
- }, 5000)
+ }, OCPP20Constants.RESET_IDLE_MONITOR_INTERVAL_MS)
}
/**
)
})
}
- }, 5000)
+ }, OCPP20Constants.RESET_IDLE_MONITOR_INTERVAL_MS)
}
private selectAvailableEvse (chargingStation: ChargingStation): number | undefined {
requestId
)
- await sleep(2000)
+ await sleep(OCPP20Constants.FIRMWARE_STATUS_DELAY_MS)
if (checkAborted()) return
// H9: If firmware location is empty or malformed, send DownloadFailed and stop
)
if (signature != null) {
- await sleep(500)
+ await sleep(OCPP20Constants.FIRMWARE_VERIFY_DELAY_MS)
if (checkAborted()) return
await this.sendFirmwareStatusNotification(
chargingStation,
logger.debug(
`${chargingStation.logPrefix()} ${moduleName}.simulateFirmwareUpdateLifecycle: Waiting for active transactions to end before installing (L01.FR.06)`
)
- await sleep(5000)
+ await sleep(OCPP20Constants.FIRMWARE_INSTALL_DELAY_MS)
}
if (checkAborted()) return
requestId
)
- await sleep(1000)
+ await sleep(OCPP20Constants.RESET_DELAY_MS)
if (checkAborted()) return
await this.sendFirmwareStatusNotification(
chargingStation,
requestId
)
- await sleep(1000)
+ await sleep(OCPP20Constants.LOG_UPLOAD_STEP_DELAY_MS)
await this.sendLogStatusNotification(
chargingStation,
UploadLogStatusEnumType.Uploaded,
import { isNotEmptyString, logger, sleep } from '../../../../utils/index.js'
import { AuthenticationMethod, AuthorizationStatus, IdentifierType } from '../types/AuthTypes.js'
+const CERTIFICATE_VERIFY_DELAY_MS = 100
+
/**
* Certificate-based authentication strategy for OCPP 2.0+
*
config: AuthConfiguration
): Promise<boolean> {
// Simulate validation delay
- await sleep(100)
+ await sleep(CERTIFICATE_VERIFY_DELAY_MS)
// In a real implementation, this would:
// 1. Load trusted CA certificates from configuration