From: Jérôme Benoit Date: Sat, 3 Sep 2022 16:09:41 +0000 (+0200) Subject: README.md: update to reflect response payload format change on X-Git-Tag: v1.1.70~16 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=02cde3b711fb54b1a72d9828680eea54024d4ea0;p=e-mobility-charging-stations-simulator.git README.md: update to reflect response payload format change on listChargingStations Signed-off-by: Jérôme Benoit --- diff --git a/README.md b/README.md index e0cbce54..d5a66a26 100644 --- a/README.md +++ b/README.md @@ -390,9 +390,9 @@ Protocol to control the simulator via a Websocket or HTTP server. A Postman and [Insomnia](https://insomnia.rest/) requests collection, to learn how to use the HTTP protocol to pilot the simulator, is available in [src/assets](./src/assets/) directory. -### WebSocket Protocol +### Websocket Protocol -PDU stands for Protocol Data Unit. +SRPC protocol over Websocket. PDU stands for 'Protocol Data Unit'. - Request: [`uuid`, `ProcedureName`, `PDU`] @@ -403,11 +403,11 @@ PDU stands for Protocol Data Unit. - Response: [`uuid`, `PDU`] `uuid`: String uniquely linking the response to the request - `PDU`: Response data to requested procedure + `PDU`: Response parameters to requested procedure #### Version 0.0.1 -Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. +Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. ##### Procedures @@ -442,9 +442,7 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { `status`: 'success' | 'failure', - `index`: ChargingStationData, - ... - `index`: ChargingStationData + `chargingStations`: ChargingStationData[] } ###### Start Transaction diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index e00e2b99..25c89435 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -1,5 +1,3 @@ -import { parentPort } from 'worker_threads'; - import type { JSONSchemaType } from 'ajv'; import Ajv from 'ajv-draft-04'; import ajvFormats from 'ajv-formats'; @@ -23,7 +21,6 @@ import Constants from '../../utils/Constants'; import logger from '../../utils/Logger'; import Utils from '../../utils/Utils'; import type ChargingStation from '../ChargingStation'; -import { MessageChannelUtils } from '../MessageChannelUtils'; import type OCPPResponseService from './OCPPResponseService'; import { OCPPServiceUtils } from './OCPPServiceUtils'; @@ -254,7 +251,6 @@ export default abstract class OCPPRequestService { reject(error); } finally { chargingStation.requests.delete(messageId); - // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation)); } } @@ -278,7 +274,6 @@ export default abstract class OCPPRequestService { error ); chargingStation.requests.delete(messageId); - // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation)); reject(error); } }), diff --git a/src/types/AutomaticTransactionGenerator.ts b/src/types/AutomaticTransactionGenerator.ts index 83e88c68..562996f0 100644 --- a/src/types/AutomaticTransactionGenerator.ts +++ b/src/types/AutomaticTransactionGenerator.ts @@ -1,4 +1,4 @@ -export interface AutomaticTransactionGeneratorConfiguration { +export type AutomaticTransactionGeneratorConfiguration = { enable: boolean; minDuration: number; maxDuration: number; @@ -8,9 +8,9 @@ export interface AutomaticTransactionGeneratorConfiguration { stopAfterHours: number; stopOnConnectionFailure: boolean; requireAuthorize?: boolean; -} +}; -export interface Status { +export type Status = { start?: boolean; startDate?: Date; lastRunDate?: Date; @@ -25,4 +25,4 @@ export interface Status { stopTransactionRequests?: number; skippedConsecutiveTransactions?: number; skippedTransactions?: number; -} +}; diff --git a/src/ui/web/src/components/charging-stations/CSTable.vue b/src/ui/web/src/components/charging-stations/CSTable.vue index 2c0bc1fa..53561516 100644 --- a/src/ui/web/src/components/charging-stations/CSTable.vue +++ b/src/ui/web/src/components/charging-stations/CSTable.vue @@ -17,7 +17,7 @@