OCPPVersion,
} from '../../../../src/types/index.js'
import { standardCleanup, withMockTimers } from '../../../helpers/TestLifecycleHelpers.js'
+import { TEST_PUBLIC_KEY_HEX } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
import { createMeterValuesTemplate, upsertConfigurationKey } from './OCPP16TestUtils.js'
OCPP16VendorParametersKey.SampledDataSignStartedReadings,
'true'
)
+ upsertConfigurationKey(
+ station,
+ `${OCPP16VendorParametersKey.MeterPublicKey}1`,
+ TEST_PUBLIC_KEY_HEX
+ )
upsertConfigurationKey(
station,
OCPP16VendorParametersKey.PublicKeyWithSignedMeterValue,
OCPP16VendorParametersKey.PublicKeyWithSignedMeterValue,
'OncePerTransaction'
)
- upsertConfigurationKey(station, `${OCPP16VendorParametersKey.MeterPublicKey}1`, 'abcd1234')
+ upsertConfigurationKey(
+ station,
+ `${OCPP16VendorParametersKey.MeterPublicKey}1`,
+ TEST_PUBLIC_KEY_HEX
+ )
OCPP16ServiceUtils.buildTransactionBeginMeterValue(station, 1, 0)
}
upsertConfigurationKey(station, OCPP16VendorParametersKey.SampledDataSignReadings, 'true')
+ upsertConfigurationKey(
+ station,
+ `${OCPP16VendorParametersKey.MeterPublicKey}1`,
+ TEST_PUBLIC_KEY_HEX
+ )
const meterValue = OCPP16ServiceUtils.buildTransactionEndMeterValue(station, 1, 50000)
}
upsertConfigurationKey(station, OCPP16VendorParametersKey.SampledDataSignReadings, 'true')
+ upsertConfigurationKey(
+ station,
+ `${OCPP16VendorParametersKey.MeterPublicKey}1`,
+ TEST_PUBLIC_KEY_HEX
+ )
const meterValue = OCPP16ServiceUtils.buildTransactionEndMeterValue(station, 1, 25000)
const signedSamples = meterValue.sampledValue.filter(
}
upsertConfigurationKey(station, OCPP16VendorParametersKey.SampledDataSignReadings, 'true')
+ upsertConfigurationKey(
+ station,
+ `${OCPP16VendorParametersKey.MeterPublicKey}1`,
+ TEST_PUBLIC_KEY_HEX
+ )
})
await it('should not sign non-energy measurands even when signing is enabled', () => {
}
upsertConfigurationKey(station, OCPP16VendorParametersKey.SampledDataSignReadings, 'true')
+ upsertConfigurationKey(
+ station,
+ `${OCPP16VendorParametersKey.MeterPublicKey}1`,
+ TEST_PUBLIC_KEY_HEX
+ )
})
await it('should include signed SampledValue in periodic meter values when SampledDataSignUpdatedReadings=true', async t => {
import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import {
TEST_CHARGING_STATION_BASE_NAME,
+ TEST_PUBLIC_KEY_HEX,
TEST_TRANSACTION_ID_STRING,
} from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
buildConfigKey(OCPP20ComponentName.OCPPCommCtrlr, 'PublicKeyWithSignedMeterValue'),
PublicKeyWithSignedMeterValueEnumType.Never
)
+ addConfigurationKey(
+ station,
+ buildConfigKey(OCPP20ComponentName.FiscalMetering, 'PublicKey'),
+ TEST_PUBLIC_KEY_HEX
+ )
const meterValue = buildMeterValue(station, TEST_TRANSACTION_ID_STRING, 0)
addConfigurationKey(
station,
buildConfigKey(OCPP20ComponentName.FiscalMetering, 'PublicKey'),
- 'abcdef1234567890'
+ TEST_PUBLIC_KEY_HEX
)
const connectorStatus = station.getConnectorStatus(1)
addConfigurationKey(
station,
buildConfigKey(OCPP20ComponentName.FiscalMetering, 'PublicKey'),
- 'abcdef1234567890'
+ TEST_PUBLIC_KEY_HEX
)
const meterValue = buildMeterValue(
addConfigurationKey(
station,
buildConfigKey(OCPP20ComponentName.FiscalMetering, 'PublicKey'),
- 'abcdef1234567890'
+ TEST_PUBLIC_KEY_HEX
)
const meterValue = buildMeterValue(
addConfigurationKey(
station,
buildConfigKey(OCPP20ComponentName.FiscalMetering, 'PublicKey'),
- 'abcdef1234567890'
+ TEST_PUBLIC_KEY_HEX
)
const meterValue = buildMeterValue(