Skip to main content

ocpp_client/ocpp_2_0_1/
actions.rs

1use crate::action::Action;
2use crate::error::ClientError;
3use crate::ocpp_2_0_1::OCPP2_0_1Client;
4use crate::ocpp_2_0_1::error::OCPP2_0_1Error;
5use core::future::Future;
6use core::marker::PhantomData;
7use ocpp_types::v201::common::CustomData;
8use ocpp_types::v201::{
9    AuthorizeRequest, AuthorizeResponse, BootNotificationRequest, BootNotificationResponse,
10    CancelReservationRequest, CancelReservationResponse, CertificateSignedRequest,
11    CertificateSignedResponse, ChangeAvailabilityRequest, ChangeAvailabilityResponse,
12    ClearCacheRequest, ClearCacheResponse, ClearChargingProfileRequest,
13    ClearChargingProfileResponse, ClearDisplayMessageRequest, ClearDisplayMessageResponse,
14    ClearVariableMonitoringRequest, ClearVariableMonitoringResponse, ClearedChargingLimitRequest,
15    ClearedChargingLimitResponse, CostUpdatedRequest, CostUpdatedResponse,
16    CustomerInformationRequest, CustomerInformationResponse, DataTransferRequest,
17    DataTransferResponse, DeleteCertificateRequest, DeleteCertificateResponse,
18    FirmwareStatusNotificationRequest, FirmwareStatusNotificationResponse,
19    Get15118EVCertificateRequest, Get15118EVCertificateResponse, GetBaseReportRequest,
20    GetBaseReportResponse, GetCertificateStatusRequest, GetCertificateStatusResponse,
21    GetChargingProfilesRequest, GetChargingProfilesResponse, GetCompositeScheduleRequest,
22    GetCompositeScheduleResponse, GetDisplayMessagesRequest, GetDisplayMessagesResponse,
23    GetInstalledCertificateIdsRequest, GetInstalledCertificateIdsResponse,
24    GetLocalListVersionRequest, GetLocalListVersionResponse, GetLogRequest, GetLogResponse,
25    GetMonitoringReportRequest, GetMonitoringReportResponse, GetReportRequest, GetReportResponse,
26    GetTransactionStatusRequest, GetTransactionStatusResponse, GetVariablesRequest,
27    GetVariablesResponse, HeartbeatRequest, HeartbeatResponse, InstallCertificateRequest,
28    InstallCertificateResponse, LogStatusNotificationRequest, LogStatusNotificationResponse,
29    MeterValuesRequest, MeterValuesResponse, NotifyChargingLimitRequest,
30    NotifyChargingLimitResponse, NotifyCustomerInformationRequest,
31    NotifyCustomerInformationResponse, NotifyDisplayMessagesRequest, NotifyDisplayMessagesResponse,
32    NotifyEVChargingNeedsRequest, NotifyEVChargingNeedsResponse, NotifyEVChargingScheduleRequest,
33    NotifyEVChargingScheduleResponse, NotifyEventRequest, NotifyEventResponse,
34    NotifyMonitoringReportRequest, NotifyMonitoringReportResponse, NotifyReportRequest,
35    NotifyReportResponse, PublishFirmwareRequest, PublishFirmwareResponse,
36    PublishFirmwareStatusNotificationRequest, PublishFirmwareStatusNotificationResponse,
37    ReportChargingProfilesRequest, ReportChargingProfilesResponse, RequestStartTransactionRequest,
38    RequestStartTransactionResponse, RequestStopTransactionRequest, RequestStopTransactionResponse,
39    ReservationStatusUpdateRequest, ReservationStatusUpdateResponse, ReserveNowRequest,
40    ReserveNowResponse, ResetRequest, ResetResponse, SecurityEventNotificationRequest,
41    SecurityEventNotificationResponse, SendLocalListRequest, SendLocalListResponse,
42    SetChargingProfileRequest, SetChargingProfileResponse, SetDisplayMessageRequest,
43    SetDisplayMessageResponse, SetMonitoringBaseRequest, SetMonitoringBaseResponse,
44    SetMonitoringLevelRequest, SetMonitoringLevelResponse, SetNetworkProfileRequest,
45    SetNetworkProfileResponse, SetVariableMonitoringRequest, SetVariableMonitoringResponse,
46    SetVariablesRequest, SetVariablesResponse, SignCertificateRequest, SignCertificateResponse,
47    StatusNotificationRequest, StatusNotificationResponse, TransactionEventRequest,
48    TransactionEventResponse, TriggerMessageRequest, TriggerMessageResponse,
49    UnlockConnectorRequest, UnlockConnectorResponse, UnpublishFirmwareRequest,
50    UnpublishFirmwareResponse, UpdateFirmwareRequest, UpdateFirmwareResponse,
51};
52use serde::Serialize;
53use serde::de::DeserializeOwned;
54
55/// Same pattern as `ocpp_1_6_action!` (see `src/ocpp_1_6/actions.rs`): one marker type
56/// implementing [`Action`] plus `send_x`/`on_x`/`wait_for_x` convenience methods on
57/// [`OCPP2_0_1Client`], generated from one macro line per action.
58///
59/// The one thing 2.x adds is the `customData` extension point. Since `ocpp-types` 0.2.0 every
60/// 2.0.1 message type carries the type of that field as a parameter, so the marker carries it
61/// too and a consumer picks their own shape with `client.call::<Reset<AcmeExtension>>(..)`. The
62/// methods stay concrete at [`CustomData`], the specification's own shape: making them generic
63/// as well would break inference at the call site every time a request is built inline with
64/// `custom_data: None`, since a defaulted type parameter does not participate in inference.
65///
66/// `$req`/`$res` are `ident`s rather than `ty`s because a `ty` fragment cannot be followed by
67/// generic arguments.
68macro_rules! ocpp_2_0_1_action {
69    ($name:ident, $req:ident, $res:ident, $action:literal, $send:ident, $on:ident, $wait_for:ident) => {
70        #[doc = concat!("Marker type for the `", $action, "` action.")]
71        ///
72        /// `C` is the type of the message's `customData` field, defaulting to the
73        /// specification's [`CustomData`]. Name another to read or write a vendor extension
74        /// through [`Client::call`](crate::Client::call)/[`Client::on`](crate::Client::on), or
75        /// [`NoCustomData`](ocpp_types::NoCustomData) to discard it and pay one byte instead of
76        /// the field's full width at every node of the message.
77        pub struct $name<C = CustomData>(PhantomData<fn() -> C>);
78
79        // `fn() -> C` rather than a bare `C`: the marker is a type-level tag that is never
80        // instantiated, and this keeps it `Send + Sync` (which `Action` requires of the marker
81        // itself) no matter what `C` is.
82        impl<C> Action for $name<C>
83        where
84            C: Serialize + DeserializeOwned + Send + Sync + 'static,
85        {
86            const NAME: &'static str = $action;
87            type Request = $req<C>;
88            type Response = $res<C>;
89        }
90
91        impl OCPP2_0_1Client {
92            // `$req<CustomData>` spelled out, not bare `$req`: `ocpp-types`' own default for the
93            // parameter is `NoCustomData`, which would silently discard vendor extensions. The
94            // marker's default is this crate's choice and matches.
95            pub async fn $send(
96                &self,
97                request: $req<CustomData>,
98            ) -> Result<$res<CustomData>, ClientError<OCPP2_0_1Error>> {
99                self.call::<$name>(request).await
100            }
101
102            pub async fn $on<F, FF>(&self, callback: F)
103            where
104                F: FnMut($req<CustomData>, Self) -> FF + Send + Sync + 'static,
105                FF: Future<Output = Result<$res<CustomData>, OCPP2_0_1Error>> + Send,
106            {
107                self.on::<$name, F, FF>(callback).await
108            }
109
110            #[cfg(feature = "test")]
111            pub async fn $wait_for<F, FF>(
112                &self,
113                callback: F,
114            ) -> Result<$req<CustomData>, ClientError<OCPP2_0_1Error>>
115            where
116                F: FnMut($req<CustomData>, Self) -> FF + Send + Sync + 'static,
117                FF: Future<Output = Result<$res<CustomData>, OCPP2_0_1Error>> + Send,
118            {
119                self.wait_for::<$name, F, FF>(callback).await
120            }
121        }
122    };
123}
124
125ocpp_2_0_1_action!(
126    Authorize,
127    AuthorizeRequest,
128    AuthorizeResponse,
129    "Authorize",
130    send_authorize,
131    on_authorize,
132    wait_for_authorize
133);
134ocpp_2_0_1_action!(
135    BootNotification,
136    BootNotificationRequest,
137    BootNotificationResponse,
138    "BootNotification",
139    send_boot_notification,
140    on_boot_notification,
141    wait_for_boot_notification
142);
143ocpp_2_0_1_action!(
144    CancelReservation,
145    CancelReservationRequest,
146    CancelReservationResponse,
147    "CancelReservation",
148    send_cancel_reservation,
149    on_cancel_reservation,
150    wait_for_cancel_reservation
151);
152ocpp_2_0_1_action!(
153    CertificateSigned,
154    CertificateSignedRequest,
155    CertificateSignedResponse,
156    "CertificateSigned",
157    send_certificate_signed,
158    on_certificate_signed,
159    wait_for_certificate_signed
160);
161ocpp_2_0_1_action!(
162    ChangeAvailability,
163    ChangeAvailabilityRequest,
164    ChangeAvailabilityResponse,
165    "ChangeAvailability",
166    send_change_availability,
167    on_change_availability,
168    wait_for_change_availability
169);
170ocpp_2_0_1_action!(
171    ClearCache,
172    ClearCacheRequest,
173    ClearCacheResponse,
174    "ClearCache",
175    send_clear_cache,
176    on_clear_cache,
177    wait_for_clear_cache
178);
179ocpp_2_0_1_action!(
180    ClearChargingProfile,
181    ClearChargingProfileRequest,
182    ClearChargingProfileResponse,
183    "ClearChargingProfile",
184    send_clear_charging_profile,
185    on_clear_charging_profile,
186    wait_for_clear_charging_profile
187);
188ocpp_2_0_1_action!(
189    ClearDisplayMessage,
190    ClearDisplayMessageRequest,
191    ClearDisplayMessageResponse,
192    "ClearDisplayMessage",
193    send_clear_display_message,
194    on_clear_display_message,
195    wait_for_clear_display_message
196);
197ocpp_2_0_1_action!(
198    ClearVariableMonitoring,
199    ClearVariableMonitoringRequest,
200    ClearVariableMonitoringResponse,
201    "ClearVariableMonitoring",
202    send_clear_variable_monitoring,
203    on_clear_variable_monitoring,
204    wait_for_clear_variable_monitoring
205);
206ocpp_2_0_1_action!(
207    ClearedChargingLimit,
208    ClearedChargingLimitRequest,
209    ClearedChargingLimitResponse,
210    "ClearedChargingLimit",
211    send_cleared_charging_limit,
212    on_cleared_charging_limit,
213    wait_for_cleared_charging_limit
214);
215ocpp_2_0_1_action!(
216    CostUpdated,
217    CostUpdatedRequest,
218    CostUpdatedResponse,
219    "CostUpdated",
220    send_cost_updated,
221    on_cost_updated,
222    wait_for_cost_updated
223);
224ocpp_2_0_1_action!(
225    CustomerInformation,
226    CustomerInformationRequest,
227    CustomerInformationResponse,
228    "CustomerInformation",
229    send_customer_information,
230    on_customer_information,
231    wait_for_customer_information
232);
233ocpp_2_0_1_action!(
234    DataTransfer,
235    DataTransferRequest,
236    DataTransferResponse,
237    "DataTransfer",
238    send_data_transfer,
239    on_data_transfer,
240    wait_for_data_transfer
241);
242ocpp_2_0_1_action!(
243    DeleteCertificate,
244    DeleteCertificateRequest,
245    DeleteCertificateResponse,
246    "DeleteCertificate",
247    send_delete_certificate,
248    on_delete_certificate,
249    wait_for_delete_certificate
250);
251ocpp_2_0_1_action!(
252    FirmwareStatusNotification,
253    FirmwareStatusNotificationRequest,
254    FirmwareStatusNotificationResponse,
255    "FirmwareStatusNotification",
256    send_firmware_status_notification,
257    on_firmware_status_notification,
258    wait_for_firmware_status_notification
259);
260ocpp_2_0_1_action!(
261    Get15118EVCertificate,
262    Get15118EVCertificateRequest,
263    Get15118EVCertificateResponse,
264    "Get15118EVCertificate",
265    send_get_15118_ev_certificate,
266    on_get_15118_ev_certificate,
267    wait_for_get_15118_ev_certificate
268);
269ocpp_2_0_1_action!(
270    GetBaseReport,
271    GetBaseReportRequest,
272    GetBaseReportResponse,
273    "GetBaseReport",
274    send_get_base_report,
275    on_get_base_report,
276    wait_for_get_base_report
277);
278ocpp_2_0_1_action!(
279    GetCertificateStatus,
280    GetCertificateStatusRequest,
281    GetCertificateStatusResponse,
282    "GetCertificateStatus",
283    send_get_certificate_status,
284    on_get_certificate_status,
285    wait_for_get_certificate_status
286);
287ocpp_2_0_1_action!(
288    GetChargingProfiles,
289    GetChargingProfilesRequest,
290    GetChargingProfilesResponse,
291    "GetChargingProfiles",
292    send_get_charging_profiles,
293    on_get_charging_profiles,
294    wait_for_get_charging_profiles
295);
296ocpp_2_0_1_action!(
297    GetCompositeSchedule,
298    GetCompositeScheduleRequest,
299    GetCompositeScheduleResponse,
300    "GetCompositeSchedule",
301    send_get_composite_schedule,
302    on_get_composite_schedule,
303    wait_for_get_composite_schedule
304);
305ocpp_2_0_1_action!(
306    GetDisplayMessages,
307    GetDisplayMessagesRequest,
308    GetDisplayMessagesResponse,
309    "GetDisplayMessages",
310    send_get_display_messages,
311    on_get_display_messages,
312    wait_for_get_display_messages
313);
314ocpp_2_0_1_action!(
315    GetInstalledCertificateIds,
316    GetInstalledCertificateIdsRequest,
317    GetInstalledCertificateIdsResponse,
318    "GetInstalledCertificateIds",
319    send_get_installed_certificate_ids,
320    on_get_installed_certificate_ids,
321    wait_for_get_installed_certificate_ids
322);
323ocpp_2_0_1_action!(
324    GetLocalListVersion,
325    GetLocalListVersionRequest,
326    GetLocalListVersionResponse,
327    "GetLocalListVersion",
328    send_get_local_list_version,
329    on_get_local_list_version,
330    wait_for_get_local_list_version
331);
332ocpp_2_0_1_action!(
333    GetLog,
334    GetLogRequest,
335    GetLogResponse,
336    "GetLog",
337    send_get_log,
338    on_get_log,
339    wait_for_get_log
340);
341ocpp_2_0_1_action!(
342    GetMonitoringReport,
343    GetMonitoringReportRequest,
344    GetMonitoringReportResponse,
345    "GetMonitoringReport",
346    send_get_monitoring_report,
347    on_get_monitoring_report,
348    wait_for_get_monitoring_report
349);
350ocpp_2_0_1_action!(
351    GetReport,
352    GetReportRequest,
353    GetReportResponse,
354    "GetReport",
355    send_get_report,
356    on_get_report,
357    wait_for_get_report
358);
359ocpp_2_0_1_action!(
360    GetTransactionStatus,
361    GetTransactionStatusRequest,
362    GetTransactionStatusResponse,
363    "GetTransactionStatus",
364    send_get_transaction_status,
365    on_get_transaction_status,
366    wait_for_get_transaction_status
367);
368ocpp_2_0_1_action!(
369    GetVariables,
370    GetVariablesRequest,
371    GetVariablesResponse,
372    "GetVariables",
373    send_get_variables,
374    on_get_variables,
375    wait_for_get_variables
376);
377ocpp_2_0_1_action!(
378    Heartbeat,
379    HeartbeatRequest,
380    HeartbeatResponse,
381    "Heartbeat",
382    send_heartbeat,
383    on_heartbeat,
384    wait_for_heartbeat
385);
386ocpp_2_0_1_action!(
387    InstallCertificate,
388    InstallCertificateRequest,
389    InstallCertificateResponse,
390    "InstallCertificate",
391    send_install_certificate,
392    on_install_certificate,
393    wait_for_install_certificate
394);
395ocpp_2_0_1_action!(
396    LogStatusNotification,
397    LogStatusNotificationRequest,
398    LogStatusNotificationResponse,
399    "LogStatusNotification",
400    send_log_status_notification,
401    on_log_status_notification,
402    wait_for_log_status_notification
403);
404ocpp_2_0_1_action!(
405    MeterValues,
406    MeterValuesRequest,
407    MeterValuesResponse,
408    "MeterValues",
409    send_meter_values,
410    on_meter_values,
411    wait_for_meter_values
412);
413ocpp_2_0_1_action!(
414    NotifyChargingLimit,
415    NotifyChargingLimitRequest,
416    NotifyChargingLimitResponse,
417    "NotifyChargingLimit",
418    send_notify_charging_limit,
419    on_notify_charging_limit,
420    wait_for_notify_charging_limit
421);
422ocpp_2_0_1_action!(
423    NotifyCustomerInformation,
424    NotifyCustomerInformationRequest,
425    NotifyCustomerInformationResponse,
426    "NotifyCustomerInformation",
427    send_notify_customer_information,
428    on_notify_customer_information,
429    wait_for_notify_customer_information
430);
431ocpp_2_0_1_action!(
432    NotifyDisplayMessages,
433    NotifyDisplayMessagesRequest,
434    NotifyDisplayMessagesResponse,
435    "NotifyDisplayMessages",
436    send_notify_display_messages,
437    on_notify_display_messages,
438    wait_for_notify_display_messages
439);
440ocpp_2_0_1_action!(
441    NotifyEVChargingNeeds,
442    NotifyEVChargingNeedsRequest,
443    NotifyEVChargingNeedsResponse,
444    "NotifyEVChargingNeeds",
445    send_notify_ev_charging_needs,
446    on_notify_ev_charging_needs,
447    wait_for_notify_ev_charging_needs
448);
449ocpp_2_0_1_action!(
450    NotifyEVChargingSchedule,
451    NotifyEVChargingScheduleRequest,
452    NotifyEVChargingScheduleResponse,
453    "NotifyEVChargingSchedule",
454    send_notify_ev_charging_schedule,
455    on_notify_ev_charging_schedule,
456    wait_for_notify_ev_charging_schedule
457);
458ocpp_2_0_1_action!(
459    NotifyEvent,
460    NotifyEventRequest,
461    NotifyEventResponse,
462    "NotifyEvent",
463    send_notify_event,
464    on_notify_event,
465    wait_for_notify_event
466);
467ocpp_2_0_1_action!(
468    NotifyMonitoringReport,
469    NotifyMonitoringReportRequest,
470    NotifyMonitoringReportResponse,
471    "NotifyMonitoringReport",
472    send_notify_monitoring_report,
473    on_notify_monitoring_report,
474    wait_for_notify_monitoring_report
475);
476ocpp_2_0_1_action!(
477    NotifyReport,
478    NotifyReportRequest,
479    NotifyReportResponse,
480    "NotifyReport",
481    send_notify_report,
482    on_notify_report,
483    wait_for_notify_report
484);
485ocpp_2_0_1_action!(
486    PublishFirmware,
487    PublishFirmwareRequest,
488    PublishFirmwareResponse,
489    "PublishFirmware",
490    send_publish_firmware,
491    on_publish_firmware,
492    wait_for_publish_firmware
493);
494ocpp_2_0_1_action!(
495    PublishFirmwareStatusNotification,
496    PublishFirmwareStatusNotificationRequest,
497    PublishFirmwareStatusNotificationResponse,
498    "PublishFirmwareStatusNotification",
499    send_publish_firmware_status_notification,
500    on_publish_firmware_status_notification,
501    wait_for_publish_firmware_status_notification
502);
503ocpp_2_0_1_action!(
504    ReportChargingProfiles,
505    ReportChargingProfilesRequest,
506    ReportChargingProfilesResponse,
507    "ReportChargingProfiles",
508    send_report_charging_profiles,
509    on_report_charging_profiles,
510    wait_for_report_charging_profiles
511);
512ocpp_2_0_1_action!(
513    RequestStartTransaction,
514    RequestStartTransactionRequest,
515    RequestStartTransactionResponse,
516    "RequestStartTransaction",
517    send_request_start_transaction,
518    on_request_start_transaction,
519    wait_for_request_start_transaction
520);
521ocpp_2_0_1_action!(
522    RequestStopTransaction,
523    RequestStopTransactionRequest,
524    RequestStopTransactionResponse,
525    "RequestStopTransaction",
526    send_request_stop_transaction,
527    on_request_stop_transaction,
528    wait_for_request_stop_transaction
529);
530ocpp_2_0_1_action!(
531    ReservationStatusUpdate,
532    ReservationStatusUpdateRequest,
533    ReservationStatusUpdateResponse,
534    "ReservationStatusUpdate",
535    send_reservation_status_update,
536    on_reservation_status_update,
537    wait_for_reservation_status_update
538);
539ocpp_2_0_1_action!(
540    ReserveNow,
541    ReserveNowRequest,
542    ReserveNowResponse,
543    "ReserveNow",
544    send_reserve_now,
545    on_reserve_now,
546    wait_for_reserve_now
547);
548ocpp_2_0_1_action!(
549    Reset,
550    ResetRequest,
551    ResetResponse,
552    "Reset",
553    send_reset,
554    on_reset,
555    wait_for_reset
556);
557ocpp_2_0_1_action!(
558    SecurityEventNotification,
559    SecurityEventNotificationRequest,
560    SecurityEventNotificationResponse,
561    "SecurityEventNotification",
562    send_security_event_notification,
563    on_security_event_notification,
564    wait_for_security_event_notification
565);
566ocpp_2_0_1_action!(
567    SendLocalList,
568    SendLocalListRequest,
569    SendLocalListResponse,
570    "SendLocalList",
571    send_send_local_list,
572    on_send_local_list,
573    wait_for_send_local_list
574);
575ocpp_2_0_1_action!(
576    SetChargingProfile,
577    SetChargingProfileRequest,
578    SetChargingProfileResponse,
579    "SetChargingProfile",
580    send_set_charging_profile,
581    on_set_charging_profile,
582    wait_for_set_charging_profile
583);
584ocpp_2_0_1_action!(
585    SetDisplayMessage,
586    SetDisplayMessageRequest,
587    SetDisplayMessageResponse,
588    "SetDisplayMessage",
589    send_set_display_message,
590    on_set_display_message,
591    wait_for_set_display_message
592);
593ocpp_2_0_1_action!(
594    SetMonitoringBase,
595    SetMonitoringBaseRequest,
596    SetMonitoringBaseResponse,
597    "SetMonitoringBase",
598    send_set_monitoring_base,
599    on_set_monitoring_base,
600    wait_for_set_monitoring_base
601);
602ocpp_2_0_1_action!(
603    SetMonitoringLevel,
604    SetMonitoringLevelRequest,
605    SetMonitoringLevelResponse,
606    "SetMonitoringLevel",
607    send_set_monitoring_level,
608    on_set_monitoring_level,
609    wait_for_set_monitoring_level
610);
611ocpp_2_0_1_action!(
612    SetNetworkProfile,
613    SetNetworkProfileRequest,
614    SetNetworkProfileResponse,
615    "SetNetworkProfile",
616    send_set_network_profile,
617    on_set_network_profile,
618    wait_for_set_network_profile
619);
620ocpp_2_0_1_action!(
621    SetVariableMonitoring,
622    SetVariableMonitoringRequest,
623    SetVariableMonitoringResponse,
624    "SetVariableMonitoring",
625    send_set_variable_monitoring,
626    on_set_variable_monitoring,
627    wait_for_set_variable_monitoring
628);
629ocpp_2_0_1_action!(
630    SetVariables,
631    SetVariablesRequest,
632    SetVariablesResponse,
633    "SetVariables",
634    send_set_variables,
635    on_set_variables,
636    wait_for_set_variables
637);
638ocpp_2_0_1_action!(
639    SignCertificate,
640    SignCertificateRequest,
641    SignCertificateResponse,
642    "SignCertificate",
643    send_sign_certificate,
644    on_sign_certificate,
645    wait_for_sign_certificate
646);
647ocpp_2_0_1_action!(
648    StatusNotification,
649    StatusNotificationRequest,
650    StatusNotificationResponse,
651    "StatusNotification",
652    send_status_notification,
653    on_status_notification,
654    wait_for_status_notification
655);
656ocpp_2_0_1_action!(
657    TransactionEvent,
658    TransactionEventRequest,
659    TransactionEventResponse,
660    "TransactionEvent",
661    send_transaction_event,
662    on_transaction_event,
663    wait_for_transaction_event
664);
665ocpp_2_0_1_action!(
666    TriggerMessage,
667    TriggerMessageRequest,
668    TriggerMessageResponse,
669    "TriggerMessage",
670    send_trigger_message,
671    on_trigger_message,
672    wait_for_trigger_message
673);
674ocpp_2_0_1_action!(
675    UnlockConnector,
676    UnlockConnectorRequest,
677    UnlockConnectorResponse,
678    "UnlockConnector",
679    send_unlock_connector,
680    on_unlock_connector,
681    wait_for_unlock_connector
682);
683ocpp_2_0_1_action!(
684    UnpublishFirmware,
685    UnpublishFirmwareRequest,
686    UnpublishFirmwareResponse,
687    "UnpublishFirmware",
688    send_unpublish_firmware,
689    on_unpublish_firmware,
690    wait_for_unpublish_firmware
691);
692ocpp_2_0_1_action!(
693    UpdateFirmware,
694    UpdateFirmwareRequest,
695    UpdateFirmwareResponse,
696    "UpdateFirmware",
697    send_update_firmware,
698    on_update_firmware,
699    wait_for_update_firmware
700);