ocpp/v2_0_1/datatype/event_data
OCPP 2.0.1 EventData data type (schema EventDataType).
to_json/decoder map to/from its OCPP-J JSON object; new (when
present) builds a value from the required fields only.
Types
Class to report an event notification for a component-variable.
| Field | Type | Req | Description |
|---|---|---|---|
actual_value | String | ✓ | Actual value (attributeType Actual) of the variable. The Configuration Variable ReportingValueSize can be used to limit GetVariableResult.attributeValue, VariableAttribute.value and EventData.actualValue. The max size of these values will always remain equal. (max 2500 chars) |
cause | Int | — | Refers to the Id of an event that is considered to be the cause for this event. |
cleared | Bool | — | Cleared is set to true to report the clearing of a monitored situation, i.e. a ‘return to normal’. |
component | Component | ✓ | |
custom_data | CustomData | — | |
event_id | Int | ✓ | Identifies the event. This field can be referred to as a cause by other events. |
event_notification_type | EventNotification | ✓ | |
tech_code | String | — | Technical (error) code as reported by component. (max 50 chars) |
tech_info | String | — | Technical detail information as reported by component. (max 500 chars) |
timestamp | DateTime | ✓ | Timestamp of the moment the report was generated. |
transaction_id | String | — | If an event notification is linked to a specific transaction, this field can be used to specify its transactionId. (max 36 chars) |
trigger | EventTrigger | ✓ | |
variable | Variable | ✓ | |
variable_monitoring_id | Int | — | Identifies the VariableMonitoring which triggered the event. |
Schema: EventDataType
pub type EventData {
EventData(
actual_value: String,
cause: option.Option(Int),
cleared: option.Option(Bool),
component: component.Component,
custom_data: option.Option(custom_data.CustomData),
event_id: Int,
event_notification_type: event_notification.EventNotification,
tech_code: option.Option(String),
tech_info: option.Option(String),
timestamp: timestamp.Timestamp,
transaction_id: option.Option(String),
trigger: event_trigger.EventTrigger,
variable: variable.Variable,
variable_monitoring_id: option.Option(Int),
)
}
Constructors
-
EventData( actual_value: String, cause: option.Option(Int), cleared: option.Option(Bool), component: component.Component, custom_data: option.Option(custom_data.CustomData), event_id: Int, event_notification_type: event_notification.EventNotification, tech_code: option.Option(String), tech_info: option.Option(String), timestamp: timestamp.Timestamp, transaction_id: option.Option(String), trigger: event_trigger.EventTrigger, variable: variable.Variable, variable_monitoring_id: option.Option(Int), )
Values
pub fn decoder() -> decode.Decoder(EventData)
Decode a EventData from its OCPP-J JSON object, enforcing schema constraints.
pub fn new(
actual_value actual_value: String,
component component: component.Component,
event_id event_id: Int,
event_notification_type event_notification_type: event_notification.EventNotification,
timestamp timestamp: timestamp.Timestamp,
trigger trigger: event_trigger.EventTrigger,
variable variable: variable.Variable,
) -> EventData
Construct a EventData from its required fields, with every optional field set to None.