From 02cde3b711fb54b1a72d9828680eea54024d4ea0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 3 Sep 2022 18:09:41 +0200 Subject: [PATCH] README.md: update to reflect response payload format change on listChargingStations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- README.md | 12 +++++------- .../ocpp/OCPPRequestService.ts | 5 ----- src/types/AutomaticTransactionGenerator.ts | 8 ++++---- .../components/charging-stations/CSTable.vue | 2 +- src/ui/web/src/types/ChargingStationType.ts | 18 ++++++++++++++++++ 5 files changed, 28 insertions(+), 17 deletions(-) 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 @@