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`]
- 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
- Response:
`PDU`: {
`status`: 'success' | 'failure',
- `index`: ChargingStationData,
- ...
- `index`: ChargingStationData
+ `chargingStations`: ChargingStationData[]
}
###### Start Transaction
-import { parentPort } from 'worker_threads';
-
import type { JSONSchemaType } from 'ajv';
import Ajv from 'ajv-draft-04';
import ajvFormats from 'ajv-formats';
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';
reject(error);
} finally {
chargingStation.requests.delete(messageId);
- // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation));
}
}
error
);
chargingStation.requests.delete(messageId);
- // parentPort.postMessage(MessageChannelUtils.buildUpdatedMessage(chargingStation));
reject(error);
}
}),
-export interface AutomaticTransactionGeneratorConfiguration {
+export type AutomaticTransactionGeneratorConfiguration = {
enable: boolean;
minDuration: number;
maxDuration: number;
stopAfterHours: number;
stopOnConnectionFailure: boolean;
requireAuthorize?: boolean;
-}
+};
-export interface Status {
+export type Status = {
start?: boolean;
startDate?: Date;
lastRunDate?: Date;
stopTransactionRequests?: number;
skippedConsecutiveTransactions?: number;
skippedTransactions?: number;
-}
+};
</thead>
<tbody id="cs-table__body">
<CSData
- v-for="chargingStation in chargingStations"
+ v-for="chargingStation in props.chargingStations"
:key="chargingStation.stationInfo?.hashId"
:charging-station="chargingStation"
:idTag="props.idTag"
wsState?: number;
bootNotificationResponse: BootNotificationResponse;
connectors: ConnectorStatus[];
+ automaticTransactionGeneratorStatuses?: Status[];
};
export type ChargingStationInfo = {
UNAVAILABLE = 'Unavailable',
FAULTED = 'Faulted',
}
+
+export type Status = {
+ start?: boolean;
+ startDate?: Date;
+ lastRunDate?: Date;
+ stopDate?: Date;
+ stoppedDate?: Date;
+ authorizeRequests?: number;
+ acceptedAuthorizeRequests?: number;
+ rejectedAuthorizeRequests?: number;
+ startTransactionRequests?: number;
+ acceptedStartTransactionRequests?: number;
+ rejectedStartTransactionRequests?: number;
+ stopTransactionRequests?: number;
+ skippedConsecutiveTransactions?: number;
+ skippedTransactions?: number;
+};