rust_ocpp/v2_0_1/messages/
heartbeat.rs

1//! HeartBeat
2
3use chrono::DateTime;
4use chrono::Utc;
5
6use crate::v2_0_1::helpers::datetime_rfc3339;
7
8/// HeartbeatRequest, sent by the Charging Station to the CSMS. No fields are defined.
9#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
10#[serde(rename_all = "camelCase")]
11pub struct HeartbeatRequest {
12    // No fields are defined
13}
14
15/// HeartbeatResponse, sent by the CSMS to the Charging Station in response to a HeartbeatRequest.
16#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Default)]
17#[serde(rename_all = "camelCase")]
18pub struct HeartbeatResponse {
19    /// Contains the current time of the CSMS.
20    #[serde(with = "datetime_rfc3339 ")]
21    pub current_time: DateTime<Utc>,
22}