!OCPP20ServiceUtils.readVariableAsBoolean(
chargingStation,
OCPP20ComponentName.EVSE,
- 'AllowReset',
+ OCPP20OptionalVariableName.AllowReset,
true
)
) {
const masterPassGroupId = OCPP20ServiceUtils.readVariableValue(
chargingStation,
OCPP20ComponentName.AuthCtrlr,
- 'MasterPassGroupId'
+ OCPP20OptionalVariableName.MasterPassGroupId
)
if (
masterPassGroupId != null &&
variable: 'DisableRemoteAuthorization',
},
- [buildRegistryKey(OCPP20ComponentName.AuthCtrlr, 'MasterPassGroupId')]: {
- component: OCPP20ComponentName.AuthCtrlr,
- dataType: DataEnumType.string,
- description:
- 'IdTokens that have this id as groupId belong to the Master Pass Group. They can stop any ongoing transaction but cannot start transactions.',
- maxLength: 36,
- mutability: MutabilityEnumType.ReadWrite,
- persistence: PersistenceEnumType.Persistent,
- supportedAttributes: [AttributeEnumType.Actual],
- variable: 'MasterPassGroupId',
- },
[buildRegistryKey(OCPP20ComponentName.AuthCtrlr, 'OfflineTxForUnknownIdEnabled')]: {
component: OCPP20ComponentName.AuthCtrlr,
dataType: DataEnumType.boolean,
supportedAttributes: [AttributeEnumType.Actual],
variable: 'OfflineTxForUnknownIdEnabled',
},
+ [buildRegistryKey(OCPP20ComponentName.AuthCtrlr, OCPP20OptionalVariableName.MasterPassGroupId)]: {
+ component: OCPP20ComponentName.AuthCtrlr,
+ dataType: DataEnumType.string,
+ description:
+ 'IdTokens that have this id as groupId belong to the Master Pass Group. They can stop any ongoing transaction but cannot start transactions.',
+ maxLength: 36,
+ mutability: MutabilityEnumType.ReadWrite,
+ persistence: PersistenceEnumType.Persistent,
+ supportedAttributes: [AttributeEnumType.Actual],
+ variable: OCPP20OptionalVariableName.MasterPassGroupId,
+ },
[buildRegistryKey(
OCPP20ComponentName.AuthCtrlr,
OCPP20RequiredVariableName.AuthorizeRemoteStart
},
// EVSE Component
- [buildRegistryKey(OCPP20ComponentName.EVSE, 'AllowReset')]: {
- component: OCPP20ComponentName.EVSE,
- dataType: DataEnumType.boolean,
- defaultValue: 'true',
- description: 'Can be used to announce that an EVSE can be reset individually',
- mutability: MutabilityEnumType.ReadOnly,
- persistence: PersistenceEnumType.Persistent,
- supportedAttributes: [AttributeEnumType.Actual],
- variable: 'AllowReset',
- },
[buildRegistryKey(OCPP20ComponentName.EVSE, 'Available')]: {
component: OCPP20ComponentName.EVSE,
dataType: DataEnumType.boolean,
supportedAttributes: [AttributeEnumType.Actual],
variable: OCPP20DeviceInfoVariableName.AvailabilityState,
},
+ [buildRegistryKey(OCPP20ComponentName.EVSE, OCPP20OptionalVariableName.AllowReset)]: {
+ component: OCPP20ComponentName.EVSE,
+ dataType: DataEnumType.boolean,
+ defaultValue: 'true',
+ description: 'Can be used to announce that an EVSE can be reset individually',
+ mutability: MutabilityEnumType.ReadOnly,
+ persistence: PersistenceEnumType.Persistent,
+ supportedAttributes: [AttributeEnumType.Actual],
+ variable: OCPP20OptionalVariableName.AllowReset,
+ },
// FirmwareCtrlr Component
[buildRegistryKey(
}
export enum OCPP20OptionalVariableName {
+ AllowReset = 'AllowReset',
CertSigningRepeatTimes = 'CertSigningRepeatTimes',
CertSigningWaitMinimum = 'CertSigningWaitMinimum',
ConfigurationValueSize = 'ConfigurationValueSize',
HeartbeatInterval = 'HeartbeatInterval',
+ MasterPassGroupId = 'MasterPassGroupId',
MaxCertificateChainSize = 'MaxCertificateChainSize',
MaxEnergyOnInvalidId = 'MaxEnergyOnInvalidId',
NonEvseSpecific = 'NonEvseSpecific',
import { Bootstrap } from '../../src/charging-station/Bootstrap.js'
import { SharedLRUCache } from '../../src/charging-station/SharedLRUCache.js'
+import { OCPP16StandardParametersKey } from '../../src/types/index.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
interface BootstrapStatic {
return {
automaticTransactionGenerator: { enable: false, maxDuration: 120, minDuration: 60 },
configurationHash: hash,
- configurationKey: [{ key: 'HeartbeatInterval', readonly: false, value: '60' }],
+ configurationKey: [
+ { key: OCPP16StandardParametersKey.HeartbeatInterval, readonly: false, value: '60' },
+ ],
stationInfo: { chargingStationId: 'test-station' },
} as unknown as ChargingStationConfiguration
}
import {
GetVariableStatusEnumType,
OCPP20IdTokenEnumType,
+ OCPP20OptionalVariableName,
OCPPVersion,
RequestStartStopStatusEnumType,
} from '../../../../src/types/index.js'
const results = originalGetVariables(station, requests)
for (let i = 0; i < (requests as { variable?: { name?: string } }[]).length; i++) {
const req = (requests as { variable?: { name?: string } }[])[i]
- if (req.variable?.name === 'MasterPassGroupId') {
+ if (req.variable?.name === OCPP20OptionalVariableName.MasterPassGroupId) {
results[i] = {
...results[i],
attributeStatus: GetVariableStatusEnumType.Accepted,
const results = originalGetVariables(station, requests)
for (let i = 0; i < (requests as { variable?: { name?: string } }[]).length; i++) {
const req = (requests as { variable?: { name?: string } }[])[i]
- if (req.variable?.name === 'MasterPassGroupId') {
+ if (req.variable?.name === OCPP20OptionalVariableName.MasterPassGroupId) {
results[i] = {
...results[i],
attributeStatus: GetVariableStatusEnumType.Accepted,
const results = originalGetVariables(station, requests)
for (let i = 0; i < (requests as { variable?: { name?: string } }[]).length; i++) {
const req = (requests as { variable?: { name?: string } }[])[i]
- if (req.variable?.name === 'MasterPassGroupId') {
+ if (req.variable?.name === OCPP20OptionalVariableName.MasterPassGroupId) {
results[i] = {
...results[i],
attributeStatus: GetVariableStatusEnumType.Accepted,
AttributeEnumType,
GetVariableStatusEnumType,
OCPP20ComponentName,
+ OCPP20OptionalVariableName,
OCPPVersion,
SetVariableStatusEnumType,
} from '../../../../src/types/index.js'
{
attributeValue: '60',
component: { name: OCPP20ComponentName.OCPPCommCtrlr },
- variable: { name: 'HeartbeatInterval' },
+ variable: { name: OCPP20OptionalVariableName.HeartbeatInterval },
},
],
}
{
attributeType: AttributeEnumType.Actual,
component: { name: OCPP20ComponentName.OCPPCommCtrlr },
- variable: { name: 'HeartbeatInterval' },
+ variable: { name: OCPP20OptionalVariableName.HeartbeatInterval },
},
],
}
{
attributeValue: '30',
component: { name: OCPP20ComponentName.OCPPCommCtrlr },
- variable: { name: 'HeartbeatInterval' },
+ variable: { name: OCPP20OptionalVariableName.HeartbeatInterval },
},
{
attributeValue: '20',
component: { name: OCPP20ComponentName.OCPPCommCtrlr },
- variable: { name: 'WebSocketPingInterval' },
+ variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
],
}
getVariableData: [
{
component: { name: OCPP20ComponentName.OCPPCommCtrlr },
- variable: { name: 'HeartbeatInterval' },
+ variable: { name: OCPP20OptionalVariableName.HeartbeatInterval },
},
{
component: { name: OCPP20ComponentName.OCPPCommCtrlr },
- variable: { name: 'WebSocketPingInterval' },
+ variable: { name: OCPP20OptionalVariableName.WebSocketPingInterval },
},
],
}
OCPP20ServiceUtils,
type RejectionReason,
} from '../../../../src/charging-station/ocpp/2.0/OCPP20ServiceUtils.js'
-import { ReasonCodeEnumType } from '../../../../src/types/index.js'
+import { OCPP20OptionalVariableName, ReasonCodeEnumType } from '../../../../src/types/index.js'
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
interface MockLogger {
await it('should return rejected:false and empty results when both limits are 0', () => {
const station = makeMockStation()
const logger = makeMockLogger()
- const items = [makeItem('HeartbeatInterval', '30')]
+ const items = [makeItem(OCPP20OptionalVariableName.HeartbeatInterval, '30')]
const result = OCPP20ServiceUtils.enforceMessageLimits(
station,
await it('should return rejected:false when data size is under the bytes limit', () => {
const station = makeMockStation()
const logger = makeMockLogger()
- const items = [makeItem('HeartbeatInterval', '30')]
+ const items = [makeItem(OCPP20OptionalVariableName.HeartbeatInterval, '30')]
const result = OCPP20ServiceUtils.enforceMessageLimits(
station,
await it('should pass original item to buildRejected callback', () => {
const station = makeMockStation()
const logger = makeMockLogger()
- const item = makeItem('HeartbeatInterval', 'abc')
+ const item = makeItem(OCPP20OptionalVariableName.HeartbeatInterval, 'abc')
const capturedItems: TestItem[] = []
OCPP20ServiceUtils.enforceMessageLimits(
await it('should pass reason with info and reasonCode to buildRejected callback', () => {
const station = makeMockStation()
const logger = makeMockLogger()
- const item = makeItem('WebSocketPingInterval', 'xyz')
+ const item = makeItem(OCPP20OptionalVariableName.WebSocketPingInterval, 'xyz')
const capturedReasons: RejectionReason[] = []
OCPP20ServiceUtils.enforceMessageLimits(