SignedUpdateFirmwareRequest.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using EVCB_OCPP.Packet.Features;
  2. using EVCB_OCPP.Packet.Messages.SubTypes;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel.DataAnnotations;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace EVCB_OCPP.Packet.Messages.Security
  11. {
  12. public class SignedUpdateFirmwareRequest : IRequest
  13. {
  14. public SignedUpdateFirmwareRequest()
  15. {
  16. Action = Actions.SignedUpdateFirmware.ToString();
  17. }
  18. /// <summary>
  19. /// This specifies how many times Charge Point must try to download the
  20. ///firmware before giving up.If this field is not present, it is left to Charge Point to
  21. ///decide how many times it wants to retry.
  22. /// </summary>
  23. public int retries { set; get; }
  24. /// <summary>
  25. /// The interval in seconds after which a retry may be attempted. If this
  26. /// field is not present, it is left to Charge Point to decide how long to wait between
  27. ///attempts.
  28. /// </summary>
  29. public int retryInterval { set; get; }
  30. /// <summary>
  31. /// The Id of this request
  32. /// </summary>
  33. [Required]
  34. public int requestId { set; get; }
  35. /// <summary>
  36. /// Specifies the firmware to be updated on the Charge Point.
  37. /// </summary>
  38. [Required]
  39. public FirmwareType firmware { set; get; }
  40. [JsonIgnore]
  41. public string Action { set; get; }
  42. public bool TransactionRelated()
  43. {
  44. return false;
  45. }
  46. public bool Validate()
  47. {
  48. return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
  49. }
  50. }
  51. }