if (getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut) != null) {
return convertToInt(
getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut)?.value ??
- Constants.DEFAULT_CONNECTION_TIMEOUT
+ Constants.DEFAULT_EV_CONNECTION_TIMEOUT
)
}
- return Constants.DEFAULT_CONNECTION_TIMEOUT
+ return Constants.DEFAULT_EV_CONNECTION_TIMEOUT
}
/**
params?: { closeOpened?: boolean; terminateOpened?: boolean }
): void {
options = {
- handshakeTimeout: secondsToMilliseconds(this.getConnectionTimeout()),
+ handshakeTimeout: secondsToMilliseconds(Constants.DEFAULT_WS_HANDSHAKE_TIMEOUT),
...this.stationInfo?.wsOptions,
...options,
}
addConfigurationKey(
this,
StandardParametersKey.ConnectionTimeOut,
- Constants.DEFAULT_CONNECTION_TIMEOUT.toString()
+ Constants.DEFAULT_EV_CONNECTION_TIMEOUT.toString()
)
}
this.saveOcppConfiguration()
const reconnectDelay =
this.stationInfo?.reconnectExponentialDelay === true
? exponentialDelay(this.wsConnectionRetryCount)
- : secondsToMilliseconds(this.getConnectionTimeout())
+ : secondsToMilliseconds(Constants.DEFAULT_WS_RECONNECT_DELAY)
const reconnectDelayWithdraw = 1000
const reconnectTimeout =
reconnectDelay - reconnectDelayWithdraw > 0 ? reconnectDelay - reconnectDelayWithdraw : 0
)]: {
component: OCPP20ComponentName.OCPPCommCtrlr,
dataType: DataEnumType.integer,
- defaultValue: Constants.DEFAULT_CONNECTION_TIMEOUT.toString(),
+ defaultValue: Constants.DEFAULT_MESSAGE_TIMEOUT.toString(),
description: 'Timeout (in seconds) waiting for responses to general OCPP messages.',
instance: 'Default',
max: 3600,
static readonly DEFAULT_BOOT_NOTIFICATION_INTERVAL = 60000 // Ms
static readonly DEFAULT_CIRCULAR_BUFFER_CAPACITY = 386
- static readonly DEFAULT_CONNECTION_TIMEOUT = 30 // Seconds
static readonly DEFAULT_EV_CONNECTION_TIMEOUT = 180 // Seconds
-
static readonly DEFAULT_FLUCTUATION_PERCENT = 5
static readonly DEFAULT_HASH_ALGORITHM = 'sha384'
static readonly DEFAULT_HEARTBEAT_INTERVAL = 60000 // Ms
-
static readonly DEFAULT_IDTAG = '00000000'
static readonly DEFAULT_LOG_STATISTICS_INTERVAL = 60 // Seconds
static readonly DEFAULT_MESSAGE_BUFFER_FLUSH_INTERVAL = 60000 // Ms
+ static readonly DEFAULT_MESSAGE_TIMEOUT = 30 // Seconds
+
static readonly DEFAULT_METER_VALUES_INTERVAL = 60000 // Ms
static readonly DEFAULT_PERFORMANCE_DIRECTORY = 'performance'
+
static readonly DEFAULT_PERFORMANCE_RECORDS_DB_NAME = 'e-mobility-charging-stations-simulator'
static readonly DEFAULT_PERFORMANCE_RECORDS_FILENAME = 'performanceRecords.json'
-
static readonly DEFAULT_STATION_INFO: Readonly<Partial<ChargingStationInfo>> = Object.freeze({
automaticTransactionGeneratorPersistentConfiguration: true,
autoReconnectMaxRetries: -1,
static readonly DEFAULT_TX_UPDATED_INTERVAL = 30 // Seconds
static readonly DEFAULT_UI_SERVER_HOST = 'localhost'
- static readonly DEFAULT_UI_SERVER_PORT = 8080
+ static readonly DEFAULT_UI_SERVER_PORT = 8080
static readonly DEFAULT_WEBSOCKET_PING_INTERVAL = 30 // Seconds
+ static readonly DEFAULT_WS_HANDSHAKE_TIMEOUT = 30 // Seconds
+ static readonly DEFAULT_WS_RECONNECT_DELAY = 30 // Seconds
+
static readonly EMPTY_FROZEN_OBJECT = Object.freeze({})
static readonly EMPTY_FUNCTION: () => void = Object.freeze(() => {
// Third variable: MessageTimeout
assert.strictEqual(result[2].attributeStatus, GetVariableStatusEnumType.Accepted)
assert.strictEqual(result[2].attributeType, AttributeEnumType.Actual)
- assert.strictEqual(result[2].attributeValue, Constants.DEFAULT_CONNECTION_TIMEOUT.toString())
+ assert.strictEqual(result[2].attributeValue, Constants.DEFAULT_MESSAGE_TIMEOUT.toString())
assert.strictEqual(result[2].component.name, OCPP20ComponentName.OCPPCommCtrlr)
assert.strictEqual(result[2].component.instance, 'Default')
assert.strictEqual(result[2].variable.name, OCPP20RequiredVariableName.MessageTimeout)
await it('should validate MessageTimeout positive integer >0 and reject invalid', () => {
const okRes = manager.setVariables(station, [
{
- attributeValue: (Constants.DEFAULT_CONNECTION_TIMEOUT + 5).toString(),
+ attributeValue: (Constants.DEFAULT_MESSAGE_TIMEOUT + 5).toString(),
component: { instance: 'Default', name: OCPP20ComponentName.OCPPCommCtrlr },
variable: { name: OCPP20RequiredVariableName.MessageTimeout },
},