public async sendAuthorize(connectorId: number, idTag?: string): Promise<OCPP16AuthorizeResponse> {
const payload: AuthorizeRequest = {
- ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_IDTAG },
+ ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.DEFAULT_IDTAG },
};
this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag = idTag;
return await this.sendMessage(Utils.generateUUID(), payload, OCPP16RequestCommand.AUTHORIZE) as OCPP16AuthorizeResponse;
public async sendStartTransaction(connectorId: number, idTag?: string): Promise<OCPP16StartTransactionResponse> {
const payload: StartTransactionRequest = {
connectorId,
- ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_IDTAG },
+ ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.DEFAULT_IDTAG },
meterStart: this.chargingStation.getEnergyActiveImportRegisterByConnectorId(connectorId),
timestamp: new Date().toISOString(),
};
static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms
static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS = 0.25; // Hours
- static readonly TRANSACTION_DEFAULT_IDTAG = '00000000';
+ static readonly DEFAULT_IDTAG = '00000000';
static readonly ELEMENT_START_DELAY = 0;
static readonly WORKER_START_DELAY = 500;