FirmwareManagementProfile.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using EVCB_OCPP.Packet.Features.FirmwareManagement;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace EVCB_OCPP.Packet.Features
  8. {
  9. public class FirmwareManagementProfile : Profile
  10. {
  11. public FirmwareManagementProfile()
  12. {
  13. Name = "FirmwareManagement";
  14. //加入支援的Features
  15. features.Add(new GetDiagnosticsFeature());
  16. features.Add(new DiagnosticsStatusNotificationFeature());
  17. features.Add(new FirmwareStatusNotificationFeature());
  18. features.Add(new UpdateFirmwareFeature());
  19. actions.Add(Actions.GetDiagnostics.ToString());
  20. actions.Add(Actions.DiagnosticsStatusNotification.ToString());
  21. actions.Add(Actions.FirmwareStatusNotification.ToString());
  22. actions.Add(Actions.UpdateFirmware.ToString());
  23. }
  24. public string GetActionFromConfirmation(Type seekType)
  25. {
  26. return features.Where(x => x.GetConfirmationType() == seekType).FirstOrDefault().GetAction();
  27. }
  28. public string GetActionFromRequest(Type seekType)
  29. {
  30. return GetFeaturebyType(seekType).GetAction();
  31. }
  32. }
  33. }