X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=README.md;h=0611fd3b183db229dcbb54951d14ef1f35a0bd2d;hb=5dea4c94d00775ef2ad383c4045a2181a5deb709;hp=3c4a77a7eb28c4831a0848953d267c6535e018b9;hpb=d3140adc8c6ad502eb9566aabfc1af8f66d0ef24;p=e-mobility-charging-stations-simulator.git diff --git a/README.md b/README.md index 3c4a77a7..0611fd3b 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ But the modifications to test have to be done to the files in the build target d | logFile | | combined.log | string | log file relative path | | logErrorFile | | error.log | string | error log file relative path | | worker | | {
"processType": "workerSet",
"startDelay": 500,
"elementStartDelay": 0,
"elementsPerWorker": 1,
"poolMinSize": 4,
"poolMaxSize": 16,
"poolStrategy": "ROUND_ROBBIN"
} | {
processType: WorkerProcessType;
startDelay: number;
elementStartDelay: number;
elementsPerWorker: number;
poolMinSize: number;
poolMaxSize: number;
poolStrategy: WorkerChoiceStrategy;
} | Worker configuration section:
- processType: worker threads process type (workerSet/staticPool/dynamicPool)
- startDelay: milliseconds to wait at worker threads startup (only for workerSet threads process type)
- elementStartDelay: milliseconds to wait at charging station startup
- elementsPerWorker: number of charging stations per worker threads for the `workerSet` process type
- poolMinSize: worker threads pool minimum number of threads
- poolMaxSize: worker threads pool maximum number of threads
- poolStrategy: worker threads pool [poolifier](https://github.com/poolifier/poolifier) worker choice strategy | -| uiServer | | {
"enabled": true,
"type": "ws",
"options": {
"host: "localhost",
"port": 8080
}
} | {
enabled: boolean;
type: ApplicationProtocol;
options: ServerOptions;
} | UI server configuration section | +| uiServer | | {
"enabled": true,
"type": "ws",
"options": {
"host: "localhost",
"port": 8080
}
} | {
enabled: boolean;
type: ApplicationProtocol;
options: ServerOptions;
authentication: {
enabled: boolean;
type: AuthenticationType;
username: string;
password: string;
}
} | UI server configuration section | | performanceStorage | | {
"enabled": false,
"type": "jsonfile",
"file:///performanceRecords.json"
} | {
enabled: boolean;
type: string;
URI: string;
}
where type can be 'jsonfile' or 'mongodb' | performance storage configuration section | | stationTemplateUrls | | {}[] | {
file: string;
numberOfStations: number;
}[] | array of charging station configuration templates URIs configuration section (charging station configuration template file name and number of stations) | @@ -388,11 +388,11 @@ Protocol to control the simulator via a Websocket or HTTP server. ### HTTP Protocol -A Postman or [Insomnia](https://insomnia.rest/) collection, to learn how to use the HTTP protocol to pilot the simulator, is available in [src/assets](./src/assets/) directory. +To learn how to use the HTTP protocol to pilot the simulator, an [Insomnia](https://insomnia.rest/) requests collection 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 @@ -419,7 +419,7 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status` + `status`: 'success' | 'failure' } ###### Stop Simulator @@ -430,7 +430,7 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status` + `status`: 'success' | 'failure' } ###### List Charging Stations @@ -441,10 +441,8 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Response: `PDU`: { - `status`, - `index`: ChargingStationData, - ... - `index`: ChargingStationData + `status`: 'success' | 'failure', + `chargingStations`: ChargingStationData[] } ###### Start Transaction @@ -452,14 +450,17 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'startTransaction' `PDU`: { - `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array, + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), `connectorId`: connector id integer, `idTag`: RFID tag string } - Response: `PDU`: { - `status` + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Stop Transaction @@ -467,13 +468,16 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'stopTransaction' `PDU`: { - `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array, + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), `transactionId`: transaction id integer } - Response: `PDU`: { - `status` + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Start Charging Station @@ -481,12 +485,15 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'startChargingStation' `PDU`: { - `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `responsesFailed`: failed responses payload array (optional) } - Response: `PDU`: { - `status` + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional) } ###### Stop Charging Station @@ -494,12 +501,15 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'stopChargingStation' `PDU`: { - `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status` + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Open Connection @@ -507,12 +517,15 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'openConnection' `PDU`: { - `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status` + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ###### Close Connection @@ -520,12 +533,84 @@ Set the WebSocket header _Sec-Websocket-Protocol_ to `ui0.0.1`. - Request: `ProcedureName`: 'closeConnection' `PDU`: { - `hashId`: charging station unique identifier string (deprecated) | `hashIds`: charging station unique identifier strings array + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations) } - Response: `PDU`: { - `status` + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) + } + +###### Start Automatic Transaction Generator + +- Request: + `ProcedureName`: 'startAutomaticTransactionGenerator' + `PDU`: { + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorIds`: connector id integer array (optional, default: all connectors) + } + +- Response: + `PDU`: { + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) + } + +###### Stop Automatic Transaction Generator + +- Request: + `ProcedureName`: 'stopAutomaticTransactionGenerator' + `PDU`: { + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorIds`: connector id integer array (optional, default: all connectors) + } + +- Response: + `PDU`: { + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) + } + +###### Status Notification + +- Request: + `ProcedureName`: 'StatusNotification' + `PDU`: { + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + `connectorId`: connector id integer, + `errorCode`: connector error code, + `status`: connector status + } + +- Response: + `PDU`: { + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) + } + +###### Heartbeat + +- Request: + `ProcedureName`: 'Heartbeat' + `PDU`: { + `hashIds`: charging station unique identifier strings array (optional, default: all charging stations), + } + +- Response: + `PDU`: { + `status`: 'success' | 'failure', + `hashIdsSucceeded`: charging station unique identifier strings array, + `hashIdsFailed`: charging station unique identifier strings array (optional), + `responsesFailed`: failed responses payload array (optional) } ## Support, Feedback, Contributing