|
@@ -1013,18 +1013,14 @@ namespace EVCB_OCPP.WSServer
|
|
|
}
|
|
|
string requestId = string.Empty;
|
|
|
MessageResult response = null;
|
|
|
+ Func<Task<string>> sendTask = null;
|
|
|
|
|
|
var displayPriceText = await webDbService.SetDefaultFee(session);
|
|
|
UpdateClientDisplayPrice(session.ChargeBoxId, displayPriceText);
|
|
|
|
|
|
- do
|
|
|
- {
|
|
|
- requestId = await messageService.SendChangeConfigurationRequest(
|
|
|
- session.ChargeBoxId, key: "DefaultPrice", value: displayPriceText);
|
|
|
- response = await confirmWaitingMessageSerevice.WaitResultAsync(requestId);
|
|
|
- }
|
|
|
- while (response == null);
|
|
|
- //await SetDefaultFee(session);
|
|
|
+ sendTask = async () => await messageService.SendChangeConfigurationRequest(
|
|
|
+ session.ChargeBoxId, key: "DefaultPrice", value: displayPriceText);
|
|
|
+ await confirmWaitingMessageSerevice.SendAndWaitUntilResultAsync(sendTask);
|
|
|
|
|
|
if (session.CustomerId == new Guid("298918C0-6BB5-421A-88CC-4922F918E85E") || session.CustomerId == new Guid("9E6BFDCC-09FB-4DAB-A428-43FE507600A3"))
|
|
|
{
|
|
@@ -1038,23 +1034,19 @@ namespace EVCB_OCPP.WSServer
|
|
|
session.ChargeBoxId, key: "StopTransactionOnInvalidId", value: "True");
|
|
|
}
|
|
|
|
|
|
- do
|
|
|
- {
|
|
|
- requestId = await messageService.SendGetEVSEConfigureRequest(session.ChargeBoxId);
|
|
|
- response = await confirmWaitingMessageSerevice.WaitResultAsync(requestId);
|
|
|
- }
|
|
|
- while (response == null);
|
|
|
- //GetConfigurationConfirmation
|
|
|
+ sendTask = async () => await messageService.SendGetEVSEConfigureRequest(session.ChargeBoxId);
|
|
|
+ response = await confirmWaitingMessageSerevice.SendAndWaitUntilResultAsync(sendTask);
|
|
|
if (response.Success && response.Message is GetConfigurationConfirmation confirmation)
|
|
|
{
|
|
|
await CheckandUpdateConfig(session.ChargeBoxId, confirmation.configurationKey.ToDictionary(x => x.key, x => x.value));
|
|
|
}
|
|
|
|
|
|
- await messageService.SendDataTransferRequest(
|
|
|
+ sendTask = async () => await messageService.SendDataTransferRequest(
|
|
|
session.ChargeBoxId,
|
|
|
messageId: "ID_FirmwareVersion",
|
|
|
vendorId: "Phihong Technology",
|
|
|
data: string.Empty);
|
|
|
+ await confirmWaitingMessageSerevice.SendAndWaitUntilResultAsync(sendTask);
|
|
|
|
|
|
if (session.BootStatus == BootStatus.Initializing)
|
|
|
{
|
|
@@ -1080,12 +1072,8 @@ namespace EVCB_OCPP.WSServer
|
|
|
}
|
|
|
|
|
|
MessageResult response = null;
|
|
|
- do
|
|
|
- {
|
|
|
- var requestId = await messageService.SendChangeConfigurationRequest(chargeBoxId, config.Key, config.Value);
|
|
|
- response = await confirmWaitingMessageSerevice.WaitResultAsync(requestId);
|
|
|
- }
|
|
|
- while (response == null);
|
|
|
+ var sendTask = async () => await messageService.SendChangeConfigurationRequest(chargeBoxId, config.Key, config.Value);
|
|
|
+ response = await confirmWaitingMessageSerevice.SendAndWaitUntilResultAsync(sendTask);
|
|
|
}
|
|
|
}
|
|
|
|