|
@@ -13,7 +13,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
{
|
|
|
internal partial class ProfileHandler
|
|
|
{
|
|
|
- internal MessageResult ExecuteFirmwareManagementRequest(Actions action, ClientData session, IRequest request)
|
|
|
+ internal async MessageResult ExecuteFirmwareManagementRequest(Actions action, ClientData session, IRequest request)
|
|
|
{
|
|
|
MessageResult result = new MessageResult() { Success = false };
|
|
|
try
|
|
@@ -77,7 +77,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
|
|
|
db.SaveChanges();
|
|
|
|
|
|
- var clearMachine = db.Machine.Where(x => x.Id == machine.Id).FirstOrDefault();
|
|
|
+ var clearMachine = db.Machine.Where(x => x.Id == machine.Id).FirstOrDefault();
|
|
|
clearMachine.FW_AssignedVersion = null;
|
|
|
db.SaveChanges();
|
|
|
}
|
|
@@ -94,7 +94,7 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
{
|
|
|
item.EVSE_Status = (int)_request.status;
|
|
|
item.FinishedOn = DateTime.UtcNow;
|
|
|
-
|
|
|
+
|
|
|
//if (!string.IsNullOrEmpty(item.EVSE_Value) && _request.status == Packet.Messages.SubTypes.FirmwareStatus.Installed)
|
|
|
//{
|
|
|
// int version = 0;
|
|
@@ -118,6 +118,27 @@ namespace EVCB_OCPP.WSServer.Message
|
|
|
{
|
|
|
DiagnosticsStatusNotificationRequest _request = request as DiagnosticsStatusNotificationRequest;
|
|
|
|
|
|
+ using (var db = new MainDBContext())
|
|
|
+ {
|
|
|
+ db.MachineOperateRecord.Add(new MachineOperateRecord()
|
|
|
+ {
|
|
|
+ CreatedOn = DateTime.UtcNow,
|
|
|
+ ChargeBoxId = session.ChargeBoxId,
|
|
|
+ SerialNo = requestId,
|
|
|
+ RequestContent = JsonConvert.SerializeObject(_updateFWrequest, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, Formatting = Formatting.None }),
|
|
|
+ EVSE_Status = 0,
|
|
|
+ EVSE_Value = "Fw Version:" + machine.FW_AssignedVersion,
|
|
|
+ Status = 0,
|
|
|
+ RequestType = 0,
|
|
|
+ Action = _updateFWrequest.Action.ToString()
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ await db.SaveChangesAsync();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
var confirm = new DiagnosticsStatusNotificationConfirmation() { };
|
|
|
|
|
|
result.Message = confirm;
|