Skip to main content

ocpp_types/v201/
heartbeat_response.rs

1// @generated by ocpp-codegen from schemas/. Do not edit by hand -- run
2// `scripts/generate.sh` to regenerate; manual changes will be overwritten.
3
4use super::common::*;
5#[cfg(feature = "alloc")]
6#[derive(Debug, Clone, PartialEq, Eq)]
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8pub struct HeartbeatResponse {
9    /// Contains the current time of the CSMS.
10    #[cfg_attr(feature = "serde", serde(rename = "currentTime"))]
11    pub current_time: alloc::string::String,
12    #[cfg_attr(feature = "serde", serde(rename = "customData"))]
13    #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
14    pub custom_data: Option<CustomData>,
15}
16#[cfg(feature = "alloc")]
17impl crate::Action for HeartbeatResponse {
18    const ACTION: &'static str = "Heartbeat";
19}
20#[cfg(not(feature = "alloc"))]
21#[derive(Debug, Clone, PartialEq, Eq)]
22#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
23pub struct HeartbeatResponse<
24    const HEARTBEAT_RESPONSE_CURRENT_TIME_CAP: usize = 1024usize,
25> {
26    /// Contains the current time of the CSMS.
27    #[cfg_attr(feature = "serde", serde(rename = "currentTime"))]
28    pub current_time: heapless::String<HEARTBEAT_RESPONSE_CURRENT_TIME_CAP>,
29    #[cfg_attr(feature = "serde", serde(rename = "customData"))]
30    #[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
31    pub custom_data: Option<CustomData>,
32}
33#[cfg(not(feature = "alloc"))]
34impl<const HEARTBEAT_RESPONSE_CURRENT_TIME_CAP: usize> crate::Action
35for HeartbeatResponse<HEARTBEAT_RESPONSE_CURRENT_TIME_CAP> {
36    const ACTION: &'static str = "Heartbeat";
37}