rust_ocpp/v1_6/messages/
update_firmware.rs

1use chrono::{DateTime, Utc};
2use validator::Validate;
3
4/// This contains the field definition of the UpdateFirmware.req PDU sent by the Central System to the Charge Point. See also Update Firmware
5#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
6#[serde(rename_all = "camelCase")]
7pub struct UpdateFirmwareRequest {
8    /// Required. This contains a string containing a URI pointing to a location from which to retrieve the firmware.
9    pub location: String,
10    /// Optional. This specifies how many times Charge Point must try to download the firmware before giving up. If this field is not present, it is left to Charge Point to decide how many times it wants to retry.
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub retries: Option<i32>,
13    /// Required. This contains the date and time after which the Charge Point is allowed to retrieve the (new) firmware.
14    pub retrieve_date: DateTime<Utc>,
15    /// Optional. The interval in seconds after which a retry may be attempted. If this field is not present, it is left to Charge Point to decide how long to wait between attempts.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub retry_interval: Option<i32>,
18}
19
20/// This contains the field definition of the UpdateFirmware.conf PDU sent by the Charge Point to the Central System in response to a UpdateFirmware.req PDU. See also Update Firmware
21#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
22#[serde(rename_all = "camelCase")]
23pub struct UpdateFirmwareResponse {
24    // No fields are defined.
25}