import type { ChargingStation } from '../../src/charging-station/ChargingStation.js'
-import { OCPP16RequestCommand, RegistrationStatusEnumType } from '../../src/types/index.js'
+import { RegistrationStatusEnumType, RequestCommand } from '../../src/types/index.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
import { TEST_HEARTBEAT_INTERVAL_MS } from './ChargingStationTestConstants.js'
import { cleanupChargingStation, createMockChargingStation } from './ChargingStationTestUtils.js'
station.requests.set(messageId, [
responseCallback,
errorCallback,
- OCPP16RequestCommand.HEARTBEAT,
+ RequestCommand.HEARTBEAT,
{},
])
station.requests.set('req-1', [
callback1,
errorCallback1,
- OCPP16RequestCommand.BOOT_NOTIFICATION,
+ RequestCommand.BOOT_NOTIFICATION,
{},
])
- station.requests.set('req-2', [callback2, errorCallback2, OCPP16RequestCommand.HEARTBEAT, {}])
+ station.requests.set('req-2', [callback2, errorCallback2, RequestCommand.HEARTBEAT, {}])
// Act - Cleanup station
cleanupChargingStation(station)
GetCertificateStatusEnumType,
Iso15118EVCertificateStatusEnumType,
OCPP20AuthorizationStatusEnumType,
- OCPP20RequestCommand,
OCPPVersion,
ProcedureName,
RequestCommand,
const payload = testableRequestService.buildRequestPayload(
station,
- OCPP20RequestCommand.GET_15118_EV_CERTIFICATE,
+ RequestCommand.GET_15118_EV_CERTIFICATE,
commandParams
)
const payload = testableRequestService.buildRequestPayload(
station,
- OCPP20RequestCommand.GET_CERTIFICATE_STATUS,
+ RequestCommand.GET_CERTIFICATE_STATUS,
commandParams
)
const payload = testableRequestService.buildRequestPayload(
station,
- OCPP20RequestCommand.SIGN_CERTIFICATE,
+ RequestCommand.SIGN_CERTIFICATE,
commandParams
)
import { OCPPServiceUtils } from '../../../src/charging-station/ocpp/OCPPServiceUtils.js'
import {
- type IncomingRequestCommand,
+ IncomingRequestCommand,
type MessageTrigger,
- OCPP16IncomingRequestCommand,
OCPP16MessageTrigger,
- OCPP16RequestCommand,
- type RequestCommand,
+ RequestCommand,
} from '../../../src/types/index.js'
import { standardCleanup } from '../../helpers/TestLifecycleHelpers.js'
const station = makeStationMock({
commandsSupport: {
incomingCommands: {
- [OCPP16IncomingRequestCommand.RESET]: true,
+ [IncomingRequestCommand.RESET]: true,
},
},
})
const result = OCPPServiceUtils.isIncomingRequestCommandSupported(
station,
- OCPP16IncomingRequestCommand.RESET as IncomingRequestCommand
+ IncomingRequestCommand.RESET
)
assert.strictEqual(result, true)
const station = makeStationMock({
commandsSupport: {
incomingCommands: {
- [OCPP16IncomingRequestCommand.RESET]: false,
+ [IncomingRequestCommand.RESET]: false,
},
},
})
const result = OCPPServiceUtils.isIncomingRequestCommandSupported(
station,
- OCPP16IncomingRequestCommand.RESET as IncomingRequestCommand
+ IncomingRequestCommand.RESET
)
assert.strictEqual(result, false)
const result = OCPPServiceUtils.isIncomingRequestCommandSupported(
station,
- OCPP16IncomingRequestCommand.RESET as IncomingRequestCommand
+ IncomingRequestCommand.RESET
)
assert.strictEqual(result, true)
const result = OCPPServiceUtils.isIncomingRequestCommandSupported(
station,
- OCPP16IncomingRequestCommand.RESET as IncomingRequestCommand
+ IncomingRequestCommand.RESET
)
assert.strictEqual(result, true)
const station = makeStationMock({
commandsSupport: {
outgoingCommands: {
- [OCPP16RequestCommand.HEARTBEAT]: true,
+ [RequestCommand.HEARTBEAT]: true,
},
},
})
- const result = OCPPServiceUtils.isRequestCommandSupported(
- station,
- OCPP16RequestCommand.HEARTBEAT as RequestCommand
- )
+ const result = OCPPServiceUtils.isRequestCommandSupported(station, RequestCommand.HEARTBEAT)
assert.strictEqual(result, true)
})
const station = makeStationMock({
commandsSupport: {
outgoingCommands: {
- [OCPP16RequestCommand.HEARTBEAT]: false,
+ [RequestCommand.HEARTBEAT]: false,
},
},
})
- const result = OCPPServiceUtils.isRequestCommandSupported(
- station,
- OCPP16RequestCommand.HEARTBEAT as RequestCommand
- )
+ const result = OCPPServiceUtils.isRequestCommandSupported(station, RequestCommand.HEARTBEAT)
assert.strictEqual(result, false)
})
await it('should return true when commandsSupport is undefined', () => {
const station = makeStationMock({})
- const result = OCPPServiceUtils.isRequestCommandSupported(
- station,
- OCPP16RequestCommand.HEARTBEAT as RequestCommand
- )
+ const result = OCPPServiceUtils.isRequestCommandSupported(station, RequestCommand.HEARTBEAT)
assert.strictEqual(result, true)
})
commandsSupport: {},
})
- const result = OCPPServiceUtils.isRequestCommandSupported(
- station,
- OCPP16RequestCommand.HEARTBEAT as RequestCommand
- )
+ const result = OCPPServiceUtils.isRequestCommandSupported(station, RequestCommand.HEARTBEAT)
assert.strictEqual(result, true)
})