Reformatting applied by lint-staged hooks during previous commits.
No behavioral changes.
public getWebSocketPingInterval (): number {
return getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval) != null
? convertToInt(getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval)?.value)
- : Constants.DEFAULT_WEBSOCKET_PING_INTERVAL
+ : Constants.DEFAULT_WS_PING_INTERVAL
}
public hasConnector (connectorId: number): boolean {
allowZero: true,
component: OCPP20ComponentName.ChargingStation,
dataType: DataEnumType.integer,
- defaultValue: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL.toString(),
+ defaultValue: Constants.DEFAULT_WS_PING_INTERVAL.toString(),
description:
'Interval in seconds between WebSocket ping (keep-alive) frames. 0 disables pings.',
max: 3600,
allowZero: true,
component: OCPP20ComponentName.OCPPCommCtrlr,
dataType: DataEnumType.integer,
- defaultValue: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL.toString(),
+ defaultValue: Constants.DEFAULT_WS_PING_INTERVAL.toString(),
description:
'0 disables client side websocket Ping/Pong. Positive values are interpreted as number of seconds between pings. Negative values are not allowed.',
min: 0,
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_WEBSOCKET_PING_INTERVAL = 30 // Seconds
static readonly DEFAULT_WS_HANDSHAKE_TIMEOUT = 30 // Seconds
+ static readonly DEFAULT_WS_PING_INTERVAL = 30 // Seconds
static readonly DEFAULT_WS_RECONNECT_DELAY = 30 // Seconds
static readonly EMPTY_FROZEN_OBJECT = Object.freeze({})
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
instance = new ChargingStationWorkerBroadcastChannel(station)
stationInfo: {
ocppVersion: OCPPVersion.VERSION_16,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const request: OCPP16TriggerMessageRequest = {
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_16,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
// IncomingRequest service (handles RemoteStart/Stop from CSMS)
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_16,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
})
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_16,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return station as MockChargingStation
}
ocppVersion: OCPPVersion.VERSION_16,
...stationInfo,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return { incomingRequestService, station, testableService }
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_16,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return { requestHandlerMock, station }
}
ocppVersion: OCPPVersion.VERSION_16,
...stationInfo,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return { requestService, station, testableRequestService }
ocppVersion: OCPPVersion.VERSION_16,
...stationInfo,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return { responseService, station }
resetTime: 5000,
...stationInfo,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return station as MockChargingStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
stationWithCertManager = createStationWithCertificateManager(
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
// certificateManager is not set on this station (not present by default)
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
const incomingRequestService = new OCPP20IncomingRequestService()
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
incomingRequestService = new OCPP20IncomingRequestService()
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
testableService = createTestableIncomingRequestService(new OCPP20IncomingRequestService())
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
testableService = createTestableIncomingRequestService(new OCPP20IncomingRequestService())
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const stationNoCertManager =
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
// Explicitly set to null/undefined
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
testableService = createTestableIncomingRequestService(new OCPP20IncomingRequestService())
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
testableService = createTestableIncomingRequestService(new OCPP20IncomingRequestService())
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
incomingRequestService = new OCPP20IncomingRequestService()
const secondResult = response.getVariableResult[1]
assert.strictEqual(secondResult.attributeStatus, GetVariableStatusEnumType.Accepted)
assert.strictEqual(secondResult.attributeType, AttributeEnumType.Actual)
- assert.strictEqual(
- secondResult.attributeValue,
- Constants.DEFAULT_WEBSOCKET_PING_INTERVAL.toString()
- )
+ assert.strictEqual(secondResult.attributeValue, Constants.DEFAULT_WS_PING_INTERVAL.toString())
assert.strictEqual(secondResult.component.name, OCPP20ComponentName.ChargingStation)
assert.strictEqual(secondResult.variable.name, OCPP20OptionalVariableName.WebSocketPingInterval)
assert.strictEqual(secondResult.attributeStatusInfo, undefined)
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
mockStation = initialStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
mockStation = station
const incomingRequestService = new OCPP20IncomingRequestService()
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
mockStation = station
incomingRequestService = new OCPP20IncomingRequestService()
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const stationId = spyChargingStation.stationInfo?.chargingStationId ?? 'unknown'
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const failStationId = failStation.stationInfo?.chargingStationId ?? 'unknown'
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const failStationId = failStation.stationInfo?.chargingStationId ?? 'unknown'
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
testableService = createTestableIncomingRequestService(new OCPP20IncomingRequestService())
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
mockStation = station
incomingRequestService = new OCPP20IncomingRequestService()
setVariableData: [
{
attributeType: AttributeEnumType.Actual,
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 1).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 1).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
setVariableData: [
// Accepted
{
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 3).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 3).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
// Unsupported attribute type (WebSocketPingInterval)
{
attributeType: AttributeEnumType.Target,
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 10).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 10).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
setVariableData: [
{
attributeType: AttributeEnumType.Target,
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 6).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 6).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
// FR: B07.FR.10
await it('should persist HeartbeatInterval and WebSocketPingInterval after setting', () => {
const hbNew = (millisecondsToSeconds(Constants.DEFAULT_HEARTBEAT_INTERVAL) + 20).toString()
- const wsNew = (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 20).toString()
+ const wsNew = (Constants.DEFAULT_WS_PING_INTERVAL + 20).toString()
const setRequest: OCPP20SetVariablesRequest = {
setVariableData: [
{
const request: OCPP20SetVariablesRequest = {
setVariableData: [
{
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 2).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 2).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
stationInfo: {
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const mockStation = station as MockChargingStation
return { mockStation, requestHandlerMock }
stationInfo: {
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const request: OCPP20TriggerMessageRequest = {
stationInfo: {
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return { mockStation: station as MockChargingStation, requestHandlerMock }
}
stationInfo: {
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const multiConnectorStation = station as MockChargingStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
testableService = createTestableIncomingRequestService(new OCPP20IncomingRequestService())
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
createStationWithCertificateManager(stationWithCert, certManager)
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
createStationWithCertificateManager(stationWithCert, certManager)
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
// Set an active transaction on EVSE 1's connector
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const request: OCPP20UpdateFirmwareRequest = {
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return station
}
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return station
}
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
})
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
})
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = result.station
})
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = result.station
})
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = createdStation
})
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = createdStation
station.ocppConfiguration = {
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
stationWithoutCertManager.ocppConfiguration = {
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return station as MockChargingStation
}
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return station as MockChargingStation
}
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = mockStation
// Set connector transactionId to the UUID string used in request payloads
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
setupConnectorWithTransaction(multiStation, 1, { transactionId: 10 })
const connector1 = multiStation.getConnectorStatus(1)
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
mockStation = station
resetLimits(mockStation)
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const connectorId = 1
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const connectorId = 1
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
mockStation = station
resetLimits(mockStation)
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
errorStation.isWebSocketConnectionOpened = () => false
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
// Mock WebSocket as open
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = s
resetLimits(station)
ocppStrictCompliance: true,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station.isWebSocketConnectionOpened = () => isOnline
ocppVersion: OCPPVersion.VERSION_201,
...stationInfo,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return { requestService, station, testableRequestService }
ocppVersion: OCPPVersion.VERSION_201,
resetTime: 5000,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const mockStation = station as MockChargingStation
mockStation.getNumberOfRunningTransactions = () => runningTransactions
ocppStrictCompliance: false,
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
return { requestHandlerMock, station }
}
StandardParametersKey.WebSocketPingInterval
),
readonly: false,
- value: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL.toString(),
+ value: Constants.DEFAULT_WS_PING_INTERVAL.toString(),
},
],
},
stationInfo: {
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = newStation
})
// Second variable: WebSocketPingInterval
assert.strictEqual(result[1].attributeStatus, GetVariableStatusEnumType.Accepted)
assert.strictEqual(result[1].attributeType, AttributeEnumType.Actual)
- assert.strictEqual(
- result[1].attributeValue,
- Constants.DEFAULT_WEBSOCKET_PING_INTERVAL.toString()
- )
+ assert.strictEqual(result[1].attributeValue, Constants.DEFAULT_WS_PING_INTERVAL.toString())
assert.strictEqual(result[1].component.name, OCPP20ComponentName.ChargingStation)
assert.strictEqual(result[1].variable.name, OCPP20OptionalVariableName.WebSocketPingInterval)
assert.strictEqual(result[1].attributeStatusInfo, undefined)
await it('should accept setting writable variables (Actual default)', () => {
const request: OCPP20SetVariableDataType[] = [
{
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 1).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 1).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
await it('should handle multiple mixed SetVariables in one call', () => {
const request: OCPP20SetVariableDataType[] = [
{
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 2).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 2).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
const request: OCPP20SetVariableDataType[] = [
{
attributeType: AttributeEnumType.Target,
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 5).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 5).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
])[0]
const posRes = manager.setVariables(station, [
{
- attributeValue: (Constants.DEFAULT_WEBSOCKET_PING_INTERVAL + 10).toString(),
+ attributeValue: (Constants.DEFAULT_WS_PING_INTERVAL + 10).toString(),
component: { name: OCPP20ComponentName.ChargingStation },
variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
stationInfo: {
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
await it('should return NotSupportedAttributeType for MinSet HeartbeatInterval', () => {
hashId: 'station-a-hash',
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
const { station: stationB } = createMockChargingStation({
baseName: 'StationB',
hashId: 'station-b-hash',
ocppVersion: OCPPVersion.VERSION_201,
},
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
try {
connectorsCount: 1,
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_16 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = s
const connectorStatus = station.getConnectorStatus(1)
evseConfiguration: { evsesCount: 1 },
heartbeatInterval: Constants.DEFAULT_HEARTBEAT_INTERVAL,
stationInfo: { ocppVersion: OCPPVersion.VERSION_201 },
- websocketPingInterval: Constants.DEFAULT_WEBSOCKET_PING_INTERVAL,
+ websocketPingInterval: Constants.DEFAULT_WS_PING_INTERVAL,
})
station = s
const connectorStatus = station.getConnectorStatus(1)