rust_ocpp/v1_6/messages/
unlock_connector.rs

1//! # From OCPP Specification
2//! Central System can request a Charge Point to unlock a connector. To do so, the Central System
3//! SHALL send an UnlockConnector.req PDU.
4//!
5//! The purpose of this message: Help EV drivers that have problems unplugging their cable from the
6//! Charge Point in case of malfunction of the Connector cable retention. When a EV driver calls
7//! the CPO help-desk, an operator could manually trigger the sending of an UnlockConnector.req to
8//! the Charge Point, forcing a new attempt to unlock the connector. Hopefully this time the
9//! connector unlocks and the EV driver can unplug the cable and drive away.
10//!  
11//! The UnlockConnector.req SHOULD NOT be used to remotely stop a running transaction, use the
12//! Remote Stop Transaction instead.
13//!
14//! Upon receipt of an UnlockConnector.req PDU, the Charge Point SHALL respond with a
15//! UnlockConnector.conf PDU. The response PDU SHALL indicate whether the Charge Point was able to
16//! unlock its connector.
17//! If there was a transaction in progress on the specific connector, then Charge Point SHALL
18//! finish the transaction first as described in Stop Transaction.
19//!
20//! UnlockConnector.req is intented only for unlocking the cable retention lock on the Connector,
21//! not for unlocking a connector access door.
22
23use crate::v1_6::types::UnlockStatus;
24use validator::Validate;
25
26#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
27#[serde(rename_all = "camelCase")]
28pub struct UnlockConnectorRequest {
29    /// # From OCPP Specification
30    /// Required. This contains the identifier of the connector to be unlocked.
31    #[validate(range(min = 0, max = 20))]
32    pub connector_id: u32,
33}
34
35#[derive(serde::Serialize, serde::Deserialize, Validate, Debug, Clone, PartialEq, Default)]
36#[serde(rename_all = "camelCase")]
37pub struct UnlockConnectorResponse {
38    /// # From OCPP Specification
39    /// Required. This indicates whether the Charge Point has unlocked the connector.
40    pub status: UnlockStatus,
41}