diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ab1bc04a..d72c96472 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,10 +19,10 @@ option(OCPP_INSTALL "Install the library (shared data might be installed anyway) option(LIBOCPP_ENABLE_DEPRECATED_WEBSOCKETPP "Websocket++ has been removed from the project" OFF) option(LIBOCPP_ENABLE_V16 "Enable OCPP 1.6 in the ocpp library" ON) -option(LIBOCPP_ENABLE_V201 "Enable OCPP 2.0.1 in the ocpp library" ON) +option(LIBOCPP_ENABLE_V2 "Enable OCPP 2.0.1 and OCPP2.1 in the ocpp library" ON) -if((NOT LIBOCPP_ENABLE_V16) AND (NOT LIBOCPP_ENABLE_V201)) - message(FATAL_ERROR "At least one of LIBOCPP_ENABLE_V16 and LIBOCPP_ENABLE_V201 needs to be ON") +if((NOT LIBOCPP_ENABLE_V16) AND (NOT LIBOCPP_ENABLE_V2)) + message(FATAL_ERROR "At least one of LIBOCPP_ENABLE_V16 and LIBOCPP_ENABLE_V2 needs to be ON") endif() if(LIBOCPP_ENABLE_DEPRECATED_WEBSOCKETPP) @@ -59,7 +59,7 @@ endif() # config and auxillary files add_subdirectory(config/v16) -add_subdirectory(config/v201) +add_subdirectory(config/v2) # library code add_subdirectory(lib) diff --git a/README.md b/README.md index 74688b9ee..96ef38fc3 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ The following table shows the known CSMS with which this library was tested. | O. DisplayMessage | ✅ yes | | P. DataTransfer | ✅ yes | -The development of OCPP2.0.1 is in progress. Check the [detailed current implementation status.](doc/v201/ocpp_201_status.md). +The development of OCPP2.0.1 is in progress. Check the [detailed current implementation status.](doc/v2/ocpp_201_status.md). | Whitepapers & Application Notes | Supported | | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | diff --git a/config/v201/CMakeLists.txt b/config/v2/CMakeLists.txt similarity index 71% rename from config/v201/CMakeLists.txt rename to config/v2/CMakeLists.txt index 5c45ded90..4e32147d8 100644 --- a/config/v201/CMakeLists.txt +++ b/config/v2/CMakeLists.txt @@ -9,18 +9,18 @@ collect_migration_files( INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/everest/modules/OCPP201/core_migrations ) -set(MIGRATION_FILE_VERSION_V201 ${TARGET_MIGRATION_FILE_VERSION} PARENT_SCOPE) +set(MIGRATION_FILE_VERSION_V2 ${TARGET_MIGRATION_FILE_VERSION} PARENT_SCOPE) collect_migration_files( LOCATION ${MIGRATION_FILES_DEVICE_MODEL_LOCATION} INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/everest/modules/OCPP201/device_model_migrations ) -set(MIGRATION_DEVICE_MODEL_FILE_VERSION_V201 ${TARGET_MIGRATION_FILE_VERSION} PARENT_SCOPE) -set(MIGRATION_FILES_SOURCE_DIR_V201 ${MIGRATION_FILES_LOCATION} PARENT_SCOPE) -set(MIGRATION_FILES_DEVICE_MODEL_SOURCE_DIR_V201 ${MIGRATION_FILES_DEVICE_MODEL_LOCATION} PARENT_SCOPE) +set(MIGRATION_DEVICE_MODEL_FILE_VERSION_V2 ${TARGET_MIGRATION_FILE_VERSION} PARENT_SCOPE) +set(MIGRATION_FILES_SOURCE_DIR_V2 ${MIGRATION_FILES_LOCATION} PARENT_SCOPE) +set(MIGRATION_FILES_DEVICE_MODEL_SOURCE_DIR_V2 ${MIGRATION_FILES_DEVICE_MODEL_LOCATION} PARENT_SCOPE) -option(LIBOCPP_INSTALL_DEVICE_MODEL_DATABASE "Install device model database for OCPP201" ON) +option(LIBOCPP_INSTALL_DEVICE_MODEL_DATABASE "Install device model database for OCPP2.0.1 and OCPP2.1" ON) list(APPEND CONFIGS ../logging.ini @@ -38,7 +38,7 @@ if (LIBOCPP_INSTALL_DEVICE_MODEL_DATABASE) endif() - message(STATUS "Using ocpp v201 component config file path: ${LIBOCPP_COMPONENT_CONFIG_PATH}") + message(STATUS "Using ocpp v2 component config file path: ${LIBOCPP_COMPONENT_CONFIG_PATH}") install(DIRECTORY ${LIBOCPP_COMPONENT_CONFIG_PATH} DESTINATION ${CMAKE_INSTALL_DATADIR}/everest/modules/OCPP201) endif() diff --git a/config/v201/component_config/custom/Connector_1_1.json b/config/v2/component_config/custom/Connector_1_1.json similarity index 100% rename from config/v201/component_config/custom/Connector_1_1.json rename to config/v2/component_config/custom/Connector_1_1.json diff --git a/config/v201/component_config/custom/Connector_2_1.json b/config/v2/component_config/custom/Connector_2_1.json similarity index 100% rename from config/v201/component_config/custom/Connector_2_1.json rename to config/v2/component_config/custom/Connector_2_1.json diff --git a/config/v201/component_config/custom/EVSE_1.json b/config/v2/component_config/custom/EVSE_1.json similarity index 100% rename from config/v201/component_config/custom/EVSE_1.json rename to config/v2/component_config/custom/EVSE_1.json diff --git a/config/v201/component_config/custom/EVSE_2.json b/config/v2/component_config/custom/EVSE_2.json similarity index 100% rename from config/v201/component_config/custom/EVSE_2.json rename to config/v2/component_config/custom/EVSE_2.json diff --git a/config/v201/component_config/standardized/AlignedDataCtrlr.json b/config/v2/component_config/standardized/AlignedDataCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/AlignedDataCtrlr.json rename to config/v2/component_config/standardized/AlignedDataCtrlr.json diff --git a/config/v201/component_config/standardized/AuthCacheCtrlr.json b/config/v2/component_config/standardized/AuthCacheCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/AuthCacheCtrlr.json rename to config/v2/component_config/standardized/AuthCacheCtrlr.json diff --git a/config/v201/component_config/standardized/AuthCtrlr.json b/config/v2/component_config/standardized/AuthCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/AuthCtrlr.json rename to config/v2/component_config/standardized/AuthCtrlr.json diff --git a/config/v201/component_config/standardized/ChargingStation.json b/config/v2/component_config/standardized/ChargingStation.json similarity index 100% rename from config/v201/component_config/standardized/ChargingStation.json rename to config/v2/component_config/standardized/ChargingStation.json diff --git a/config/v201/component_config/standardized/ChargingStatusIndicator.json b/config/v2/component_config/standardized/ChargingStatusIndicator.json similarity index 100% rename from config/v201/component_config/standardized/ChargingStatusIndicator.json rename to config/v2/component_config/standardized/ChargingStatusIndicator.json diff --git a/config/v201/component_config/standardized/ClockCtrlr.json b/config/v2/component_config/standardized/ClockCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/ClockCtrlr.json rename to config/v2/component_config/standardized/ClockCtrlr.json diff --git a/config/v201/component_config/standardized/CustomizationCtrlr.json b/config/v2/component_config/standardized/CustomizationCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/CustomizationCtrlr.json rename to config/v2/component_config/standardized/CustomizationCtrlr.json diff --git a/config/v201/component_config/standardized/DeviceDataCtrlr.json b/config/v2/component_config/standardized/DeviceDataCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/DeviceDataCtrlr.json rename to config/v2/component_config/standardized/DeviceDataCtrlr.json diff --git a/config/v201/component_config/standardized/DisplayMessageCtrlr.json b/config/v2/component_config/standardized/DisplayMessageCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/DisplayMessageCtrlr.json rename to config/v2/component_config/standardized/DisplayMessageCtrlr.json diff --git a/config/v201/component_config/standardized/ISO15118Ctrlr.json b/config/v2/component_config/standardized/ISO15118Ctrlr.json similarity index 100% rename from config/v201/component_config/standardized/ISO15118Ctrlr.json rename to config/v2/component_config/standardized/ISO15118Ctrlr.json diff --git a/config/v201/component_config/standardized/InternalCtrlr.json b/config/v2/component_config/standardized/InternalCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/InternalCtrlr.json rename to config/v2/component_config/standardized/InternalCtrlr.json diff --git a/config/v201/component_config/standardized/LocalAuthListCtrlr.json b/config/v2/component_config/standardized/LocalAuthListCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/LocalAuthListCtrlr.json rename to config/v2/component_config/standardized/LocalAuthListCtrlr.json diff --git a/config/v201/component_config/standardized/MonitoringCtrlr.json b/config/v2/component_config/standardized/MonitoringCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/MonitoringCtrlr.json rename to config/v2/component_config/standardized/MonitoringCtrlr.json diff --git a/config/v201/component_config/standardized/OCPPCommCtrlr.json b/config/v2/component_config/standardized/OCPPCommCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/OCPPCommCtrlr.json rename to config/v2/component_config/standardized/OCPPCommCtrlr.json diff --git a/config/v201/component_config/standardized/ReservationCtrlr.json b/config/v2/component_config/standardized/ReservationCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/ReservationCtrlr.json rename to config/v2/component_config/standardized/ReservationCtrlr.json diff --git a/config/v201/component_config/standardized/SampledDataCtrlr.json b/config/v2/component_config/standardized/SampledDataCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/SampledDataCtrlr.json rename to config/v2/component_config/standardized/SampledDataCtrlr.json diff --git a/config/v201/component_config/standardized/SecurityCtrlr.json b/config/v2/component_config/standardized/SecurityCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/SecurityCtrlr.json rename to config/v2/component_config/standardized/SecurityCtrlr.json diff --git a/config/v201/component_config/standardized/SmartChargingCtrlr.json b/config/v2/component_config/standardized/SmartChargingCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/SmartChargingCtrlr.json rename to config/v2/component_config/standardized/SmartChargingCtrlr.json diff --git a/config/v201/component_config/standardized/TariffCostCtrlr.json b/config/v2/component_config/standardized/TariffCostCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/TariffCostCtrlr.json rename to config/v2/component_config/standardized/TariffCostCtrlr.json diff --git a/config/v201/component_config/standardized/TxCtrlr.json b/config/v2/component_config/standardized/TxCtrlr.json similarity index 100% rename from config/v201/component_config/standardized/TxCtrlr.json rename to config/v2/component_config/standardized/TxCtrlr.json diff --git a/config/v201/core_migrations/1_up-initial.sql b/config/v2/core_migrations/1_up-initial.sql similarity index 100% rename from config/v201/core_migrations/1_up-initial.sql rename to config/v2/core_migrations/1_up-initial.sql diff --git a/config/v201/core_migrations/2_down-auth_cache_management.sql b/config/v2/core_migrations/2_down-auth_cache_management.sql similarity index 100% rename from config/v201/core_migrations/2_down-auth_cache_management.sql rename to config/v2/core_migrations/2_down-auth_cache_management.sql diff --git a/config/v201/core_migrations/2_up-auth_cache_management.sql b/config/v2/core_migrations/2_up-auth_cache_management.sql similarity index 100% rename from config/v201/core_migrations/2_up-auth_cache_management.sql rename to config/v2/core_migrations/2_up-auth_cache_management.sql diff --git a/config/v201/core_migrations/3_down-persist-normal-messages.sql b/config/v2/core_migrations/3_down-persist-normal-messages.sql similarity index 100% rename from config/v201/core_migrations/3_down-persist-normal-messages.sql rename to config/v2/core_migrations/3_down-persist-normal-messages.sql diff --git a/config/v201/core_migrations/3_up-persist-normal-messages.sql b/config/v2/core_migrations/3_up-persist-normal-messages.sql similarity index 100% rename from config/v201/core_migrations/3_up-persist-normal-messages.sql rename to config/v2/core_migrations/3_up-persist-normal-messages.sql diff --git a/config/v201/core_migrations/4_down-transactions_db.sql b/config/v2/core_migrations/4_down-transactions_db.sql similarity index 100% rename from config/v201/core_migrations/4_down-transactions_db.sql rename to config/v2/core_migrations/4_down-transactions_db.sql diff --git a/config/v201/core_migrations/4_up-transactions_db.sql b/config/v2/core_migrations/4_up-transactions_db.sql similarity index 100% rename from config/v201/core_migrations/4_up-transactions_db.sql rename to config/v2/core_migrations/4_up-transactions_db.sql diff --git a/config/v201/core_migrations/5_down-charging_profiles_db.sql b/config/v2/core_migrations/5_down-charging_profiles_db.sql similarity index 100% rename from config/v201/core_migrations/5_down-charging_profiles_db.sql rename to config/v2/core_migrations/5_down-charging_profiles_db.sql diff --git a/config/v201/core_migrations/5_up-charging_profiles_db.sql b/config/v2/core_migrations/5_up-charging_profiles_db.sql similarity index 100% rename from config/v201/core_migrations/5_up-charging_profiles_db.sql rename to config/v2/core_migrations/5_up-charging_profiles_db.sql diff --git a/config/v201/core_migrations/6_down-charging_profiles_source_tx_id.sql b/config/v2/core_migrations/6_down-charging_profiles_source_tx_id.sql similarity index 100% rename from config/v201/core_migrations/6_down-charging_profiles_source_tx_id.sql rename to config/v2/core_migrations/6_down-charging_profiles_source_tx_id.sql diff --git a/config/v201/core_migrations/6_up-charging_profiles_source_tx_id.sql b/config/v2/core_migrations/6_up-charging_profiles_source_tx_id.sql similarity index 100% rename from config/v201/core_migrations/6_up-charging_profiles_source_tx_id.sql rename to config/v2/core_migrations/6_up-charging_profiles_source_tx_id.sql diff --git a/config/v201/device_model_migrations/1_up-initial.sql b/config/v2/device_model_migrations/1_up-initial.sql similarity index 100% rename from config/v201/device_model_migrations/1_up-initial.sql rename to config/v2/device_model_migrations/1_up-initial.sql diff --git a/config/v201/device_model_migrations/2_down-variable_source.sql b/config/v2/device_model_migrations/2_down-variable_source.sql similarity index 100% rename from config/v201/device_model_migrations/2_down-variable_source.sql rename to config/v2/device_model_migrations/2_down-variable_source.sql diff --git a/config/v201/device_model_migrations/2_up-variable_source.sql b/config/v2/device_model_migrations/2_up-variable_source.sql similarity index 100% rename from config/v201/device_model_migrations/2_up-variable_source.sql rename to config/v2/device_model_migrations/2_up-variable_source.sql diff --git a/doc/common/getting_started.md b/doc/common/getting_started.md index c14044127..7650e8f0a 100644 --- a/doc/common/getting_started.md +++ b/doc/common/getting_started.md @@ -42,13 +42,22 @@ make -j$(nproc) install Run any required tests from build/tests. +## Clarifications for directory structures, namespaces and OCPP versions + +This repository contains multiple subdirectories and namespaces named v16, v2 and v21. + +* The v16 directories contain files for configuring and implementing OCPP 1.6. +* The v2 directories include files for both OCPP2.0.1 and OCPP2.1, as OCPP 2.1 +is fully backward compatible with OCPP 2.0.1. +* The v21 directories include files only for OCPP2.1. + ## Get Started with OCPP1.6 Please see the [Getting Started documentation for OCPP1.6](../v16/getting_started.md). ## Get Started with OCPP2.0.1 -Please see the [Getting Started documentation for OCPP2.0.1](../v201/getting_started.md). +Please see the [Getting Started documentation for OCPP2.0.1](../v2/getting_started.md). ## Building the doxygen documentation @@ -60,4 +69,4 @@ Please see the [Getting Started documentation for OCPP2.0.1](../v201/getting_sta You will find the generated doxygen documentation at: `build/dist/docs/html/index.html` -The main reference for the integration of libocpp for OCPP1.6 is the ocpp::v16::ChargePoint class defined in `v16/charge_point.hpp` , for OCPP2.0.1 that is the ocpp::v201::ChargePoint class defined in `v201/charge_point.hpp` . +The main reference for the integration of libocpp for OCPP1.6 is the ocpp::v16::ChargePoint class defined in `v16/charge_point.hpp` , for OCPP2.0.1 and OCPP2.1 that is the ocpp::v2::ChargePoint class defined in `v2/charge_point.hpp` . diff --git a/doc/message_dispatching.md b/doc/message_dispatching.md index 478c2ea37..3012df977 100644 --- a/doc/message_dispatching.md +++ b/doc/message_dispatching.md @@ -15,34 +15,34 @@ class v16_MessageDispatcher { - RegistrationStatus& registration_status } -class v201_MessageDispatcher { +class v2_MessageDispatcher { - MessageQueue& message_queue - DeviceModel& device_model - ConnectivityManager& connectivity_manager - RegistrationStatusEnum& registration_status } -class v201_MessageHandlerInterface { - +handle_message(EnhancedMessage~v201_MessageType~ message) +class v2_MessageHandlerInterface { + +handle_message(EnhancedMessage~v2_MessageType~ message) } class v16_MessageHandlerInterface { +handle_message(EnhancedMessage~v16_MessageType~ message) } -class v201_DataTransferInterface { +class v2_DataTransferInterface { +data_transfer_req(request: DataTransferRequest): std::optional~DataTransferResponse~ +handle_data_transfer_req(call: Call~DataTransferRequest~) } -class v201_DataTransfer { +class v2_DataTransfer { -MessageDispatcherInterface &message_dispatcher -std::optional~function~ data_transfer_callback } -class v201_ChargePoint { +class v2_ChargePoint { std::unique_ptr~MessageDispatcherInterface~ message_dispatcher - std::unique_ptr~v201_DataTransferInterface~ data_transfer + std::unique_ptr~v2_DataTransferInterface~ data_transfer } class v16_ChargePoint { @@ -50,11 +50,11 @@ class v16_ChargePoint { } MessageDispatcherInterface <|-- v16_MessageDispatcher -MessageDispatcherInterface <|-- v201_MessageDispatcher -v201_DataTransferInterface <|-- v201_DataTransfer -v201_MessageHandlerInterface <|-- v201_DataTransferInterface -MessageDispatcherInterface *-- v201_DataTransfer -MessageDispatcherInterface *-- v201_ChargePoint -v201_DataTransferInterface *-- v201_ChargePoint +MessageDispatcherInterface <|-- v2_MessageDispatcher +v2_DataTransferInterface <|-- v2_DataTransfer +v2_MessageHandlerInterface <|-- v2_DataTransferInterface +MessageDispatcherInterface *-- v2_DataTransfer +MessageDispatcherInterface *-- v2_ChargePoint +v2_DataTransferInterface *-- v2_ChargePoint MessageDispatcherInterface *-- v16_ChargePoint ``` diff --git a/doc/networkconnectivity/README.md b/doc/networkconnectivity/README.md index 45e9fb5c1..14803a70b 100644 --- a/doc/networkconnectivity/README.md +++ b/doc/networkconnectivity/README.md @@ -14,8 +14,8 @@ be activated before it is possible to connect to this interface. To do this, you In the implementation of this callback, you have to create a promise and return the future to the promise: ```cpp -std::promise promise(); -std::future future = promise.get_future(); +std::promise promise(); +std::future future = promise.get_future(); return future; ``` diff --git a/doc/v201/getting_started.md b/doc/v2/getting_started.md similarity index 91% rename from doc/v201/getting_started.md rename to doc/v2/getting_started.md index cd9e65abc..29078ac3e 100644 --- a/doc/v201/getting_started.md +++ b/doc/v2/getting_started.md @@ -10,4 +10,4 @@ Libocpp needs registered **callbacks** in order to execute control commands defi The implementation must call **event handlers** of libocpp so that the library can track the state of the charging station and trigger OCPP messages accordingly (e.g. MeterValuesRequest , StatusNotificationRequest) -Your reference within libocpp to interact is a single instance to the class ocpp::v201::ChargePoint defined in `v201/charge_point.hpp` for OCPP 2.0.1. +Your reference within libocpp to interact is a single instance to the class ocpp::v2::ChargePoint defined in `v2/charge_point.hpp` for OCPP 2.0.1. diff --git a/doc/v201/ocpp_201_device_model_initialization.md b/doc/v2/ocpp_201_device_model_initialization.md similarity index 98% rename from doc/v201/ocpp_201_device_model_initialization.md rename to doc/v2/ocpp_201_device_model_initialization.md index b28c34b50..a9a5d5f44 100644 --- a/doc/v201/ocpp_201_device_model_initialization.md +++ b/doc/v2/ocpp_201_device_model_initialization.md @@ -9,7 +9,7 @@ to true. ## Database, component config and config file paths Along with the 'initialize_device_model' flag, a few paths must be given to the constructor: -- The path of the device model migration files (normally `resources/v201/device_model_migration_files`). +- The path of the device model migration files (normally `resources/v2/device_model_migration_files`). - The path of the device model database. - The path of the directory with the device model config. There should be two directories in it: 'standardized' and 'custom', both containing device model config. diff --git a/doc/v201/ocpp_201_monitors.md b/doc/v2/ocpp_201_monitors.md similarity index 100% rename from doc/v201/ocpp_201_monitors.md rename to doc/v2/ocpp_201_monitors.md diff --git a/doc/v201/ocpp_201_monitors_periodic_flowchart.puml b/doc/v2/ocpp_201_monitors_periodic_flowchart.puml similarity index 100% rename from doc/v201/ocpp_201_monitors_periodic_flowchart.puml rename to doc/v2/ocpp_201_monitors_periodic_flowchart.puml diff --git a/doc/v201/ocpp_201_monitors_trigger_flowchart.puml b/doc/v2/ocpp_201_monitors_trigger_flowchart.puml similarity index 100% rename from doc/v201/ocpp_201_monitors_trigger_flowchart.puml rename to doc/v2/ocpp_201_monitors_trigger_flowchart.puml diff --git a/doc/v201/ocpp_201_smart_charging_in_depth.md b/doc/v2/ocpp_201_smart_charging_in_depth.md similarity index 100% rename from doc/v201/ocpp_201_smart_charging_in_depth.md rename to doc/v2/ocpp_201_smart_charging_in_depth.md diff --git a/doc/v201/ocpp_201_status.md b/doc/v2/ocpp_201_status.md similarity index 100% rename from doc/v201/ocpp_201_status.md rename to doc/v2/ocpp_201_status.md diff --git a/doc/v201/resumeInterruptedTransactions/resumeInterruptedTransactions.png b/doc/v2/resumeInterruptedTransactions/resumeInterruptedTransactions.png similarity index 100% rename from doc/v201/resumeInterruptedTransactions/resumeInterruptedTransactions.png rename to doc/v2/resumeInterruptedTransactions/resumeInterruptedTransactions.png diff --git a/doc/v201/resumeInterruptedTransactions/resumeInterruptedTransactions.puml b/doc/v2/resumeInterruptedTransactions/resumeInterruptedTransactions.puml similarity index 100% rename from doc/v201/resumeInterruptedTransactions/resumeInterruptedTransactions.puml rename to doc/v2/resumeInterruptedTransactions/resumeInterruptedTransactions.puml diff --git a/include/ocpp/common/evse_security.hpp b/include/ocpp/common/evse_security.hpp index ef00d965b..950c87486 100644 --- a/include/ocpp/common/evse_security.hpp +++ b/include/ocpp/common/evse_security.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include namespace ocpp { @@ -125,29 +125,29 @@ namespace evse_security_conversions { /** Conversions for Plug&Charge Data Transfer **/ -ocpp::v201::GetCertificateIdUseEnum to_ocpp_v201(ocpp::CertificateType other); -ocpp::v201::InstallCertificateUseEnum to_ocpp_v201(ocpp::CaCertificateType other); -ocpp::v201::CertificateSigningUseEnum to_ocpp_v201(ocpp::CertificateSigningUseEnum other); -ocpp::v201::HashAlgorithmEnum to_ocpp_v201(ocpp::HashAlgorithmEnumType other); -ocpp::v201::InstallCertificateStatusEnum to_ocpp_v201(ocpp::InstallCertificateResult other); -ocpp::v201::DeleteCertificateStatusEnum to_ocpp_v201(ocpp::DeleteCertificateResult other); - -ocpp::v201::CertificateHashDataType to_ocpp_v201(ocpp::CertificateHashDataType other); -ocpp::v201::CertificateHashDataChain to_ocpp_v201(ocpp::CertificateHashDataChain other); -ocpp::v201::OCSPRequestData to_ocpp_v201(ocpp::OCSPRequestData other); -std::vector to_ocpp_v201(const std::vector& ocsp_request_data); - -ocpp::CertificateType from_ocpp_v201(ocpp::v201::GetCertificateIdUseEnum other); -std::vector from_ocpp_v201(const std::vector& other); -ocpp::CaCertificateType from_ocpp_v201(ocpp::v201::InstallCertificateUseEnum other); -ocpp::CertificateSigningUseEnum from_ocpp_v201(ocpp::v201::CertificateSigningUseEnum other); -ocpp::HashAlgorithmEnumType from_ocpp_v201(ocpp::v201::HashAlgorithmEnum other); -ocpp::InstallCertificateResult from_ocpp_v201(ocpp::v201::InstallCertificateStatusEnum other); -ocpp::DeleteCertificateResult from_ocpp_v201(ocpp::v201::DeleteCertificateStatusEnum other); - -ocpp::CertificateHashDataType from_ocpp_v201(ocpp::v201::CertificateHashDataType other); -ocpp::CertificateHashDataChain from_ocpp_v201(ocpp::v201::CertificateHashDataChain other); -ocpp::OCSPRequestData from_ocpp_v201(ocpp::v201::OCSPRequestData other); +ocpp::v2::GetCertificateIdUseEnum to_ocpp_v2(ocpp::CertificateType other); +ocpp::v2::InstallCertificateUseEnum to_ocpp_v2(ocpp::CaCertificateType other); +ocpp::v2::CertificateSigningUseEnum to_ocpp_v2(ocpp::CertificateSigningUseEnum other); +ocpp::v2::HashAlgorithmEnum to_ocpp_v2(ocpp::HashAlgorithmEnumType other); +ocpp::v2::InstallCertificateStatusEnum to_ocpp_v2(ocpp::InstallCertificateResult other); +ocpp::v2::DeleteCertificateStatusEnum to_ocpp_v2(ocpp::DeleteCertificateResult other); + +ocpp::v2::CertificateHashDataType to_ocpp_v2(ocpp::CertificateHashDataType other); +ocpp::v2::CertificateHashDataChain to_ocpp_v2(ocpp::CertificateHashDataChain other); +ocpp::v2::OCSPRequestData to_ocpp_v2(ocpp::OCSPRequestData other); +std::vector to_ocpp_v2(const std::vector& ocsp_request_data); + +ocpp::CertificateType from_ocpp_v2(ocpp::v2::GetCertificateIdUseEnum other); +std::vector from_ocpp_v2(const std::vector& other); +ocpp::CaCertificateType from_ocpp_v2(ocpp::v2::InstallCertificateUseEnum other); +ocpp::CertificateSigningUseEnum from_ocpp_v2(ocpp::v2::CertificateSigningUseEnum other); +ocpp::HashAlgorithmEnumType from_ocpp_v2(ocpp::v2::HashAlgorithmEnum other); +ocpp::InstallCertificateResult from_ocpp_v2(ocpp::v2::InstallCertificateStatusEnum other); +ocpp::DeleteCertificateResult from_ocpp_v2(ocpp::v2::DeleteCertificateStatusEnum other); + +ocpp::CertificateHashDataType from_ocpp_v2(ocpp::v2::CertificateHashDataType other); +ocpp::CertificateHashDataChain from_ocpp_v2(ocpp::v2::CertificateHashDataChain other); +ocpp::OCSPRequestData from_ocpp_v2(ocpp::v2::OCSPRequestData other); } // namespace evse_security_conversions diff --git a/include/ocpp/common/message_queue.hpp b/include/ocpp/common/message_queue.hpp index ee51baf41..deb82505e 100644 --- a/include/ocpp/common/message_queue.hpp +++ b/include/ocpp/common/message_queue.hpp @@ -19,8 +19,8 @@ #include #include #include -#include -#include +#include +#include namespace ocpp { @@ -116,7 +116,7 @@ bool is_transaction_message(const ocpp::v16::MessageType message_type); /// \brief Indicates if the given \p message_type is a transaction message type /// \param message_type /// \return true if MessageType is TransactionEvent or SecurityEventNotification -bool is_transaction_message(const ocpp::v201::MessageType message_type); +bool is_transaction_message(const ocpp::v2::MessageType message_type); /// \brief Indicates if the given \p message_type is a StartTransaction message /// \param message_type @@ -126,7 +126,7 @@ bool is_start_transaction_message(const ocpp::v16::MessageType message_type); /// \brief Indicates if the given \p message_type is a StartTransaction message. /// \param message_type /// \return Always return false -bool is_start_transaction_message(const ocpp::v201::MessageType message_type); +bool is_start_transaction_message(const ocpp::v2::MessageType message_type); /// \brief Indicates if the given \p control_message is a start transaction message template auto is_start_transaction_message(const ControlMessage& control_message) { @@ -145,7 +145,7 @@ bool is_boot_notification_message(const ocpp::v16::MessageType message_type); /// \brief Indicates if the given \p message_type is a BootNotification /// \param message_type /// \return true if MessageType is BootNotification -bool is_boot_notification_message(const ocpp::v201::MessageType message_type); +bool is_boot_notification_message(const ocpp::v2::MessageType message_type); template bool allowed_to_send_message(const ControlMessage& message, const DateTime& time, @@ -969,8 +969,8 @@ template class MessageQueue { bool contains_transaction_messages(const CiString<36> transaction_id) { std::lock_guard lk(this->message_mutex); for (const auto control_message : this->transaction_message_queue) { - if (control_message->messageType == v201::MessageType::TransactionEvent) { - v201::TransactionEventRequest req = control_message->message.at(CALL_PAYLOAD); + if (control_message->messageType == v2::MessageType::TransactionEvent) { + v2::TransactionEventRequest req = control_message->message.at(CALL_PAYLOAD); if (req.transactionInfo.transactionId == transaction_id) { return true; } diff --git a/include/ocpp/common/types.hpp b/include/ocpp/common/types.hpp index 77eb1d13c..98eb96ac0 100644 --- a/include/ocpp/common/types.hpp +++ b/include/ocpp/common/types.hpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include using json = nlohmann::json; @@ -356,7 +356,7 @@ struct Measurement { struct DisplayMessageContent { std::string message; std::optional language; - std::optional message_format; + std::optional message_format; friend void from_json(const json& j, DisplayMessageContent& m); friend void to_json(json& j, const DisplayMessageContent& m); @@ -373,8 +373,8 @@ enum class IdentifierType { struct DisplayMessage { std::optional id; - std::optional priority; - std::optional state; + std::optional priority; + std::optional state; std::optional timestamp_from; std::optional timestamp_to; std::optional identifier_id; diff --git a/include/ocpp/v16/charge_point.hpp b/include/ocpp/v16/charge_point.hpp index 7817159ac..4c5ed59fb 100644 --- a/include/ocpp/v16/charge_point.hpp +++ b/include/ocpp/v16/charge_point.hpp @@ -22,15 +22,15 @@ // for OCPP1.6 PnC #include "ocpp/v16/messages/ChangeAvailability.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace ocpp { namespace v16 { @@ -142,9 +142,9 @@ class ChargePoint { /// \param certificate contract certificate that the EVCC provides /// \param iso15118_certificate_hash_data /// \return - ocpp::v201::AuthorizeResponse data_transfer_pnc_authorize( + ocpp::v2::AuthorizeResponse data_transfer_pnc_authorize( const std::string& emaid, const std::optional& certificate, - const std::optional>& iso15118_certificate_hash_data); + const std::optional>& iso15118_certificate_hash_data); /// \brief Uses data transfer mechanism to get 15118 ev certificate from CSMS. This function can be called when the /// EVCC requests the update or installation of a contract certificate as part of the ISO15118 @@ -155,7 +155,7 @@ class ChargePoint { /// \param certificate_action Install or Update void data_transfer_pnc_get_15118_ev_certificate(const int32_t connector_id, const std::string& exi_request, const std::string& iso15118_schema_version, - const ocpp::v201::CertificateActionEnum& certificate_action); + const ocpp::v2::CertificateActionEnum& certificate_action); /// \brief Allows the exchange of arbitrary \p data identified by a \p vendorId and \p messageId with a central /// system \returns the DataTransferResponse @@ -514,8 +514,8 @@ class ChargePoint { /// \param callback void register_get_15118_ev_certificate_response_callback( const std::function& callback); + const ocpp::v2::Get15118EVCertificateResponse& certificate_response, + const ocpp::v2::CertificateActionEnum& certificate_action)>& callback); /// \brief registers a \p callback function that is called when a StartTransaction.req message is sent by the /// chargepoint diff --git a/include/ocpp/v16/charge_point_impl.hpp b/include/ocpp/v16/charge_point_impl.hpp index 000c246fe..8e395932c 100644 --- a/include/ocpp/v16/charge_point_impl.hpp +++ b/include/ocpp/v16/charge_point_impl.hpp @@ -70,15 +70,15 @@ #include // for OCPP1.6 PnC -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace ocpp { namespace v16 { @@ -191,8 +191,8 @@ class ChargePointImpl : ocpp::ChargingStationBase { is_token_reserved_for_connector_callback; // iso15118 callback - std::function + std::function get_15118_ev_certificate_response_callback; // tariff and cost callback @@ -304,7 +304,7 @@ class ChargePointImpl : ocpp::ChargingStationBase { // plug&charge for 1.6 whitepaper bool is_pnc_enabled(); void data_transfer_pnc_sign_certificate(); - void data_transfer_pnc_get_certificate_status(const ocpp::v201::OCSPRequestData& ocsp_request_data); + void data_transfer_pnc_get_certificate_status(const ocpp::v2::OCSPRequestData& ocsp_request_data); void handle_data_transfer_pnc_trigger_message(Call call); void handle_data_transfer_pnc_certificate_signed(Call call); @@ -467,9 +467,9 @@ class ChargePointImpl : ocpp::ChargingStationBase { /// \param certificate contract certificate that the EVCC provides /// \param iso15118_certificate_hash_data /// \return - ocpp::v201::AuthorizeResponse data_transfer_pnc_authorize( + ocpp::v2::AuthorizeResponse data_transfer_pnc_authorize( const std::string& emaid, const std::optional& certificate, - const std::optional>& iso15118_certificate_hash_data); + const std::optional>& iso15118_certificate_hash_data); /// \brief Uses data transfer mechanism to get 15118 ev certificate from CSMS. This function can be called when the /// EVCC requests the update or installation of a contract certificate as part of the ISO15118 @@ -480,7 +480,7 @@ class ChargePointImpl : ocpp::ChargingStationBase { /// \param certificate_action Install or Update void data_transfer_pnc_get_15118_ev_certificate(const int32_t connector_id, const std::string& exi_request, const std::string& iso15118_schema_version, - const ocpp::v201::CertificateActionEnum& certificate_action); + const ocpp::v2::CertificateActionEnum& certificate_action); /// \brief Allows the exchange of arbitrary \p data identified by a \p vendorId and \p messageId with a central /// system \returns the DataTransferResponse @@ -818,8 +818,8 @@ class ChargePointImpl : ocpp::ChargingStationBase { /// \param callback void register_get_15118_ev_certificate_response_callback( const std::function& callback); + const ocpp::v2::Get15118EVCertificateResponse& certificate_response, + const ocpp::v2::CertificateActionEnum& certificate_action)>& callback); /// \brief registers a \p callback function that is called when a StartTransaction.req message is sent by the /// chargepoint diff --git a/include/ocpp/v201/average_meter_values.hpp b/include/ocpp/v2/average_meter_values.hpp similarity index 90% rename from include/ocpp/v201/average_meter_values.hpp rename to include/ocpp/v2/average_meter_values.hpp index 49691d4a2..b69948420 100644 --- a/include/ocpp/v201/average_meter_values.hpp +++ b/include/ocpp/v2/average_meter_values.hpp @@ -6,13 +6,13 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include namespace ocpp { -namespace v201 { +namespace v2 { class AverageMeterValues { public: @@ -49,6 +49,6 @@ class AverageMeterValues { bool is_avg_meas(const SampledValue& sample); void average_meter_value(); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp \ No newline at end of file diff --git a/include/ocpp/v201/charge_point.hpp b/include/ocpp/v2/charge_point.hpp similarity index 97% rename from include/ocpp/v201/charge_point.hpp rename to include/ocpp/v2/charge_point.hpp index 64f88d48c..544c27bb8 100644 --- a/include/ocpp/v201/charge_point.hpp +++ b/include/ocpp/v2/charge_point.hpp @@ -11,23 +11,23 @@ #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include "component_state_manager.hpp" namespace ocpp { -namespace v201 { +namespace v2 { class AuthorizationInterface; class AvailabilityInterface; @@ -126,7 +126,7 @@ class ChargePointInterface { /// \param charging_state The new charging state virtual void on_transaction_started(const int32_t evse_id, const int32_t connector_id, const std::string& session_id, - const DateTime& timestamp, const ocpp::v201::TriggerReasonEnum trigger_reason, + const DateTime& timestamp, const TriggerReasonEnum trigger_reason, const MeterValue& meter_start, const std::optional& id_token, const std::optional& group_id_token, const std::optional& reservation_id, const std::optional& remote_start_id, const ChargingStateEnum charging_state) = 0; @@ -353,7 +353,7 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa std::unique_ptr remote_transaction_control; // utility - std::shared_ptr> message_queue; + std::shared_ptr> message_queue; std::shared_ptr database_handler; // states @@ -434,7 +434,7 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa } protected: - void handle_message(const EnhancedMessage& message); + void handle_message(const EnhancedMessage& message); void clear_invalid_charging_profiles(); public: @@ -456,7 +456,7 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa /// \param callbacks Callbacks that will be registered for ChargePoint ChargePoint(const std::map& evse_connector_structure, std::shared_ptr device_model, std::shared_ptr database_handler, - std::shared_ptr> message_queue, const std::string& message_log_path, + std::shared_ptr> message_queue, const std::string& message_log_path, const std::shared_ptr evse_security, const Callbacks& callbacks); /// \brief Construct a new ChargePoint object @@ -520,7 +520,7 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa on_get_15118_ev_certificate_request(const Get15118EVCertificateRequest& request) override; void on_transaction_started(const int32_t evse_id, const int32_t connector_id, const std::string& session_id, - const DateTime& timestamp, const ocpp::v201::TriggerReasonEnum trigger_reason, + const DateTime& timestamp, const TriggerReasonEnum trigger_reason, const MeterValue& meter_start, const std::optional& id_token, const std::optional& group_id_token, const std::optional& reservation_id, @@ -616,5 +616,5 @@ class ChargePoint : public ChargePointInterface, private ocpp::ChargingStationBa } }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/charge_point_callbacks.hpp b/include/ocpp/v2/charge_point_callbacks.hpp similarity index 92% rename from include/ocpp/v201/charge_point_callbacks.hpp rename to include/ocpp/v2/charge_point_callbacks.hpp index 0b49f276a..3f7ccda85 100644 --- a/include/ocpp/v201/charge_point_callbacks.hpp +++ b/include/ocpp/v2/charge_point_callbacks.hpp @@ -3,22 +3,22 @@ #include #include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ocpp::v201 { +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ocpp::v2 { struct Callbacks { /// @addtogroup ocpp201_callbacks OCPP 2.0.1 callbacks /// Callbacks will call be called when necessary and must be implemented by the calling class. @@ -112,7 +112,7 @@ struct Callbacks { std::function set_charging_profiles_callback; /// \brief Callback for when a bootnotification response is received - std::optional> + std::optional> boot_notification_callback; /// \brief Callback function that can be used to get (human readable) customer information based on the given @@ -170,4 +170,4 @@ struct Callbacks { /// @} // End group }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/comparators.hpp b/include/ocpp/v2/comparators.hpp similarity index 96% rename from include/ocpp/v201/comparators.hpp rename to include/ocpp/v2/comparators.hpp index 44c808ee1..17e613869 100644 --- a/include/ocpp/v201/comparators.hpp +++ b/include/ocpp/v2/comparators.hpp @@ -3,10 +3,10 @@ #pragma once -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { inline bool operator==(const EVSE& lhs, const EVSE& rhs) { return lhs.id == rhs.id and lhs.connectorId == rhs.connectorId; @@ -67,5 +67,5 @@ inline bool operator<(const SetVariableData& lhs, const SetVariableData& rhs) { return lhs.component < rhs.component; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/component_state_manager.hpp b/include/ocpp/v2/component_state_manager.hpp similarity index 99% rename from include/ocpp/v201/component_state_manager.hpp rename to include/ocpp/v2/component_state_manager.hpp index 32e7ba9a9..3b4c73c1c 100644 --- a/include/ocpp/v201/component_state_manager.hpp +++ b/include/ocpp/v2/component_state_manager.hpp @@ -4,9 +4,9 @@ #pragma once #include "database_handler.hpp" -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { /// \brief Exception used when an evse that does not exist is accessed. class EvseOutOfRangeException : public std::exception { @@ -330,4 +330,4 @@ class ComponentStateManager : public ComponentStateManagerInterface { void send_status_notification_single_connector(int32_t evse_id, int32_t connector_id); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/connectivity_manager.hpp b/include/ocpp/v2/connectivity_manager.hpp similarity index 98% rename from include/ocpp/v201/connectivity_manager.hpp rename to include/ocpp/v2/connectivity_manager.hpp index 6f1c28898..d059a41c3 100644 --- a/include/ocpp/v201/connectivity_manager.hpp +++ b/include/ocpp/v2/connectivity_manager.hpp @@ -4,14 +4,14 @@ #pragma once #include -#include -#include +#include +#include #include #include #include namespace ocpp { -namespace v201 { +namespace v2 { class DeviceModel; @@ -231,5 +231,5 @@ class ConnectivityManager : public ConnectivityManagerInterface { void remove_network_connection_profiles_below_actual_security_profile(); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/connector.hpp b/include/ocpp/v2/connector.hpp similarity index 97% rename from include/ocpp/v201/connector.hpp rename to include/ocpp/v2/connector.hpp index e270dc81c..26956d759 100644 --- a/include/ocpp/v201/connector.hpp +++ b/include/ocpp/v2/connector.hpp @@ -8,11 +8,11 @@ #include "component_state_manager.hpp" #include "database_handler.hpp" -#include +#include #include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Enum for ConnectorEvents enum class ConnectorEvent { @@ -74,5 +74,5 @@ class Connector { void restore_connector_operative_status(); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/constants.hpp b/include/ocpp/v2/constants.hpp similarity index 91% rename from include/ocpp/v201/constants.hpp rename to include/ocpp/v2/constants.hpp index 1746c0b93..1d3ca72d5 100644 --- a/include/ocpp/v201/constants.hpp +++ b/include/ocpp/v2/constants.hpp @@ -6,11 +6,11 @@ #include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief OCPP 2.0.1 defines this as 5600 but it can be set to a higher value, which we do here, if it's reported via /// the device model, which we do as well constexpr std::size_t ISO15118_GET_EV_CERTIFICATE_EXI_RESPONSE_SIZE = 7500; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/ctrlr_component_variables.hpp b/include/ocpp/v2/ctrlr_component_variables.hpp similarity index 98% rename from include/ocpp/v201/ctrlr_component_variables.hpp rename to include/ocpp/v2/ctrlr_component_variables.hpp index 64219fcc3..5ecd6661a 100644 --- a/include/ocpp/v201/ctrlr_component_variables.hpp +++ b/include/ocpp/v2/ctrlr_component_variables.hpp @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - Pionix GmbH and Contributors to EVerest -#ifndef OCPP_V201_CTRLR_COMPONENT_VARIABLES -#define OCPP_V201_CTRLR_COMPONENT_VARIABLES +#ifndef OCPP_V2_CTRLR_COMPONENT_VARIABLES +#define OCPP_V2_CTRLR_COMPONENT_VARIABLES -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { namespace ControllerComponents { extern const Component InternalCtrlr; @@ -256,7 +256,7 @@ extern const Variable SupplyPhases; ComponentVariable get_component_variable(const int32_t evse_id, const int32_t connector_id, const Variable& variable); } // namespace ConnectorComponentVariables -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CTRLR_COMPONENT_VARIABLES +#endif // OCPP_V2_CTRLR_COMPONENT_VARIABLES diff --git a/include/ocpp/v201/database_handler.hpp b/include/ocpp/v2/database_handler.hpp similarity index 91% rename from include/ocpp/v201/database_handler.hpp rename to include/ocpp/v2/database_handler.hpp index e5330cf7d..bcbe310f0 100644 --- a/include/ocpp/v201/database_handler.hpp +++ b/include/ocpp/v2/database_handler.hpp @@ -1,22 +1,22 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest -#ifndef OCPP_V201_DATABASE_HANDLER_HPP -#define OCPP_V201_DATABASE_HANDLER_HPP +#ifndef OCPP_V2_DATABASE_HANDLER_HPP +#define OCPP_V2_DATABASE_HANDLER_HPP -#include "ocpp/v201/types.hpp" +#include "ocpp/v2/types.hpp" #include "sqlite3.h" #include #include #include #include -#include -#include +#include +#include #include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Helper class for retrieving authorization cache entries from the database struct AuthorizationCacheEntry { @@ -104,13 +104,13 @@ class DatabaseHandlerInterface { /// \brief Inserts or updates a local authorization list entries \p local_authorization_list to the AUTH_LIST table. virtual void - insert_or_update_local_authorization_list(const std::vector& local_authorization_list) = 0; + insert_or_update_local_authorization_list(const std::vector& local_authorization_list) = 0; /// \brief Deletes the authorization list entry with the given \p id_tag virtual void delete_local_authorization_list_entry(const IdToken& id_token) = 0; /// \brief Returns the IdTagInfo of the given \p id_tag if it exists in the AUTH_LIST table, else std::nullopt. - virtual std::optional get_local_authorization_list_entry(const IdToken& id_token) = 0; + virtual std::optional get_local_authorization_list_entry(const IdToken& id_token) = 0; /// \brief Deletes all entries of the AUTH_LIST table. virtual void clear_local_authorization_list() = 0; @@ -166,7 +166,7 @@ class DatabaseHandlerInterface { /// \brief Inserts or updates the given \p profile to CHARGING_PROFILES table virtual void insert_or_update_charging_profile( - const int evse_id, const v201::ChargingProfile& profile, + const int evse_id, const v2::ChargingProfile& profile, const ChargingLimitSourceEnum charging_limit_source = ChargingLimitSourceEnum::CSO) = 0; /// \brief Deletes the profile with the given \p profile_id @@ -188,13 +188,13 @@ class DatabaseHandlerInterface { const ChargingProfileCriterion& criteria) = 0; /// \brief Retrieves the charging profiles stored on \p evse_id - virtual std::vector get_charging_profiles_for_evse(const int evse_id) = 0; + virtual std::vector get_charging_profiles_for_evse(const int evse_id) = 0; /// \brief Retrieves all ChargingProfiles - virtual std::vector get_all_charging_profiles() = 0; + virtual std::vector get_all_charging_profiles() = 0; /// \brief Retrieves all ChargingProfiles grouped by EVSE ID - virtual std::map> get_all_charging_profiles_group_by_evse() = 0; + virtual std::map> get_all_charging_profiles_group_by_evse() = 0; virtual ChargingLimitSourceEnum get_charging_limit_source_for_profile(const int profile_id) = 0; @@ -247,9 +247,9 @@ class DatabaseHandler : public DatabaseHandlerInterface, public common::Database void insert_or_update_local_authorization_list_entry(const IdToken& id_token, const IdTokenInfo& id_token_info) override; void insert_or_update_local_authorization_list( - const std::vector& local_authorization_list) override; + const std::vector& local_authorization_list) override; void delete_local_authorization_list_entry(const IdToken& id_token) override; - std::optional get_local_authorization_list_entry(const IdToken& id_token) override; + std::optional get_local_authorization_list_entry(const IdToken& id_token) override; void clear_local_authorization_list() override; int32_t get_local_authorization_list_number_of_entries() override; @@ -269,7 +269,7 @@ class DatabaseHandler : public DatabaseHandlerInterface, public common::Database /// charging profiles void insert_or_update_charging_profile( - const int evse_id, const v201::ChargingProfile& profile, + const int evse_id, const v2::ChargingProfile& profile, const ChargingLimitSourceEnum charging_limit_source = ChargingLimitSourceEnum::CSO) override; bool delete_charging_profile(const int profile_id) override; void delete_charging_profile_by_transaction_id(const std::string& transaction_id) override; @@ -279,15 +279,15 @@ class DatabaseHandler : public DatabaseHandlerInterface, public common::Database std::vector get_charging_profiles_matching_criteria(const std::optional evse_id, const ChargingProfileCriterion& criteria) override; - std::vector get_charging_profiles_for_evse(const int evse_id) override; - std::vector get_all_charging_profiles() override; - virtual std::map> get_all_charging_profiles_group_by_evse() override; + std::vector get_charging_profiles_for_evse(const int evse_id) override; + std::vector get_all_charging_profiles() override; + virtual std::map> get_all_charging_profiles_group_by_evse() override; ChargingLimitSourceEnum get_charging_limit_source_for_profile(const int profile_id) override; std::unique_ptr new_statement(const std::string& sql) override; }; -} // namespace v201 +} // namespace v2 } // namespace ocpp #endif diff --git a/include/ocpp/v201/device_model.hpp b/include/ocpp/v2/device_model.hpp similarity index 98% rename from include/ocpp/v201/device_model.hpp rename to include/ocpp/v2/device_model.hpp index 1de9af3b1..c14a7f975 100644 --- a/include/ocpp/v201/device_model.hpp +++ b/include/ocpp/v2/device_model.hpp @@ -8,10 +8,10 @@ #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Response to requesting a value from the device model /// \tparam T @@ -133,8 +133,7 @@ class DeviceModel { /// @param variable_ current variable /// @return true if the component is found according to any of the requirement conditions. bool component_variables_match(const std::vector& component_variables, - const ocpp::v201::Component& component_, - const struct ocpp::v201::Variable& variable_); + const ocpp::v2::Component& component_, const struct ocpp::v2::Variable& variable_); public: /// \brief Constructor for the device model @@ -311,7 +310,7 @@ class DeviceModel { void check_integrity(const std::map& evse_connector_structure); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp #endif // DEVICE_MODEL_HPP diff --git a/include/ocpp/v201/device_model_storage_interface.hpp b/include/ocpp/v2/device_model_storage_interface.hpp similarity index 97% rename from include/ocpp/v201/device_model_storage_interface.hpp rename to include/ocpp/v2/device_model_storage_interface.hpp index b666874e4..eede8df7a 100644 --- a/include/ocpp/v201/device_model_storage_interface.hpp +++ b/include/ocpp/v2/device_model_storage_interface.hpp @@ -6,14 +6,14 @@ #include #include #include -#include +#include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Helper struct that holds database only values that don't have spec coverage struct VariableMonitoringMeta { @@ -138,5 +138,5 @@ class DeviceModelStorageInterface { virtual void check_integrity() = 0; }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/device_model_storage_sqlite.hpp b/include/ocpp/v2/device_model_storage_sqlite.hpp similarity index 97% rename from include/ocpp/v201/device_model_storage_sqlite.hpp rename to include/ocpp/v2/device_model_storage_sqlite.hpp index e5370f59c..ce039c638 100644 --- a/include/ocpp/v201/device_model_storage_sqlite.hpp +++ b/include/ocpp/v2/device_model_storage_sqlite.hpp @@ -9,10 +9,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { class DeviceModelStorageSqlite : public DeviceModelStorageInterface { @@ -67,7 +67,7 @@ class DeviceModelStorageSqlite : public DeviceModelStorageInterface { void check_integrity() final; }; -} // namespace v201 +} // namespace v2 } // namespace ocpp #endif // DEVICE_MODEL_STORAGE_SQLITE_HPP diff --git a/include/ocpp/v201/enums.hpp b/include/ocpp/v2/enums.hpp similarity index 89% rename from include/ocpp/v201/enums.hpp rename to include/ocpp/v2/enums.hpp index cb13ab4d3..fef94d41e 100644 --- a/include/ocpp/v201/enums.hpp +++ b/include/ocpp/v2/enums.hpp @@ -2,13 +2,13 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // Manually added enums for OCPP, for the auto-generated ones see 'ocpp_enums.hpp' -#ifndef OCPP_V201_ENUMS_HPP -#define OCPP_V201_ENUMS_HPP +#ifndef OCPP_V2_ENUMS_HPP +#define OCPP_V2_ENUMS_HPP #include namespace ocpp { -namespace v201 { +namespace v2 { enum class VariableMonitorType { HardWiredMonitor, @@ -38,7 +38,7 @@ constexpr int32_t MIN = Danger; constexpr int32_t MAX = Debug; } // namespace MonitoringLevelSeverity -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_ENUMS_HPP +#endif // OCPP_V2_ENUMS_HPP diff --git a/include/ocpp/v201/evse.hpp b/include/ocpp/v2/evse.hpp similarity index 97% rename from include/ocpp/v201/evse.hpp rename to include/ocpp/v2/evse.hpp index f2280aebb..4eee09631 100644 --- a/include/ocpp/v201/evse.hpp +++ b/include/ocpp/v2/evse.hpp @@ -7,16 +7,16 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { enum class CurrentPhaseType { AC, @@ -303,5 +303,5 @@ class Evse : public EvseInterface { boost::asio::io_service& io_service); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/evse_manager.hpp b/include/ocpp/v2/evse_manager.hpp similarity index 98% rename from include/ocpp/v201/evse_manager.hpp rename to include/ocpp/v2/evse_manager.hpp index 395e208f4..15648bd53 100644 --- a/include/ocpp/v201/evse_manager.hpp +++ b/include/ocpp/v2/evse_manager.hpp @@ -4,10 +4,10 @@ #pragma once #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// /// \brief Set all connectors of a given evse to unavailable. @@ -107,5 +107,5 @@ class EvseManager : public EvseManagerInterface { EvseIterator end() override; }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/functional_blocks/authorization.hpp b/include/ocpp/v2/functional_blocks/authorization.hpp similarity index 96% rename from include/ocpp/v201/functional_blocks/authorization.hpp rename to include/ocpp/v2/functional_blocks/authorization.hpp index e9f4a44da..0c60a9bd4 100644 --- a/include/ocpp/v201/functional_blocks/authorization.hpp +++ b/include/ocpp/v2/functional_blocks/authorization.hpp @@ -3,11 +3,11 @@ #pragma once -#include -#include -#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { struct AuthorizationCacheEntry; struct AuthorizeResponse; struct ClearCacheRequest; @@ -97,4 +97,4 @@ class Authorization : public AuthorizationInterface { ///\retval Accepted if applied, otherwise will return either Failed or VersionMismatch SendLocalListStatusEnum apply_local_authorization_list(const SendLocalListRequest& request); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/availability.hpp b/include/ocpp/v2/functional_blocks/availability.hpp similarity index 97% rename from include/ocpp/v201/functional_blocks/availability.hpp rename to include/ocpp/v2/functional_blocks/availability.hpp index 6aca24983..2bffcaaf9 100644 --- a/include/ocpp/v201/functional_blocks/availability.hpp +++ b/include/ocpp/v2/functional_blocks/availability.hpp @@ -3,12 +3,12 @@ #pragma once -#include -#include +#include +#include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DeviceModel; class EvseManagerInterface; class ComponentStateManagerInterface; @@ -153,4 +153,4 @@ class Availability : public AvailabilityInterface { void set_connector_operative_status(int32_t evse_id, int32_t connector_id, OperationalStatusEnum new_status, bool persist); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/data_transfer.hpp b/include/ocpp/v2/functional_blocks/data_transfer.hpp similarity index 95% rename from include/ocpp/v201/functional_blocks/data_transfer.hpp rename to include/ocpp/v2/functional_blocks/data_transfer.hpp index bd729b392..c4b0ad411 100644 --- a/include/ocpp/v201/functional_blocks/data_transfer.hpp +++ b/include/ocpp/v2/functional_blocks/data_transfer.hpp @@ -3,11 +3,11 @@ #pragma once -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { struct DataTransferRequest; struct DataTransferResponse; @@ -57,5 +57,5 @@ class DataTransfer : public DataTransferInterface { std::optional data_transfer_req(const DataTransferRequest& request) override; }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/functional_blocks/diagnostics.hpp b/include/ocpp/v2/functional_blocks/diagnostics.hpp similarity index 96% rename from include/ocpp/v201/functional_blocks/diagnostics.hpp rename to include/ocpp/v2/functional_blocks/diagnostics.hpp index b359a131d..f03cbeebe 100644 --- a/include/ocpp/v201/functional_blocks/diagnostics.hpp +++ b/include/ocpp/v2/functional_blocks/diagnostics.hpp @@ -3,12 +3,12 @@ #pragma once -#include +#include -#include -#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DeviceModel; class AuthorizationInterface; class ConnectivityManagerInterface; @@ -83,7 +83,7 @@ class Diagnostics : public DiagnosticsInterface { void handle_set_monitoring_base_req(Call call); void handle_set_monitoring_level_req(Call call); - void handle_set_variable_monitoring_req(const EnhancedMessage& message); + void handle_set_variable_monitoring_req(const EnhancedMessage& message); void handle_get_monitoring_report_req(Call call); void handle_clear_variable_monitoring_req(Call call); @@ -110,4 +110,4 @@ class Diagnostics : public DiagnosticsInterface { const std::optional id_token, const std::optional> customer_identifier); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/display_message.hpp b/include/ocpp/v2/functional_blocks/display_message.hpp similarity index 93% rename from include/ocpp/v201/functional_blocks/display_message.hpp rename to include/ocpp/v2/functional_blocks/display_message.hpp index 2df6fb529..c091415ef 100644 --- a/include/ocpp/v201/functional_blocks/display_message.hpp +++ b/include/ocpp/v2/functional_blocks/display_message.hpp @@ -3,12 +3,12 @@ #pragma once -#include -#include +#include +#include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class EvseManagerInterface; struct GetDisplayMessagesRequest; struct ClearDisplayMessageResponse; @@ -68,4 +68,4 @@ class DisplayMessageBlock : public DisplayMessageInterface { void handle_clear_display_message(Call call); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/firmware_update.hpp b/include/ocpp/v2/functional_blocks/firmware_update.hpp similarity index 94% rename from include/ocpp/v201/functional_blocks/firmware_update.hpp rename to include/ocpp/v2/functional_blocks/firmware_update.hpp index 53f91f875..5aca213d4 100644 --- a/include/ocpp/v201/functional_blocks/firmware_update.hpp +++ b/include/ocpp/v2/functional_blocks/firmware_update.hpp @@ -4,13 +4,13 @@ #pragma once #include -#include +#include namespace ocpp { // Forward declarations. class EvseSecurity; -namespace v201 { +namespace v2 { // Formward declarations. class DeviceModel; @@ -55,7 +55,7 @@ class FirmwareUpdate : public FirmwareUpdateInterface { public: FirmwareUpdate(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, EvseManagerInterface& evse_manager, EvseSecurity& evse_security, - ocpp::v201::AvailabilityInterface& availability, SecurityInterface& security, + ocpp::v2::AvailabilityInterface& availability, SecurityInterface& security, UpdateFirmwareRequestCallback update_firmware_request_callback, std::optional all_connectors_unavailable_callback); void handle_message(const ocpp::EnhancedMessage& message) override; @@ -76,5 +76,5 @@ class FirmwareUpdate : public FirmwareUpdateInterface { /// \brief Restores all connectors to their persisted state void restore_all_connector_states(); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/functional_blocks/meter_values.hpp b/include/ocpp/v2/functional_blocks/meter_values.hpp similarity index 92% rename from include/ocpp/v201/functional_blocks/meter_values.hpp rename to include/ocpp/v2/functional_blocks/meter_values.hpp index 1614b603e..8a87316c7 100644 --- a/include/ocpp/v201/functional_blocks/meter_values.hpp +++ b/include/ocpp/v2/functional_blocks/meter_values.hpp @@ -3,13 +3,13 @@ #pragma once -#include +#include #include -#include -#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class EvseManagerInterface; class DeviceModel; @@ -54,4 +54,4 @@ class MeterValues : public MeterValuesInterface { // Internal helper functions void update_dm_evse_power(const int32_t evse_id, const MeterValue& meter_value); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/provisioning.hpp b/include/ocpp/v2/functional_blocks/provisioning.hpp similarity index 93% rename from include/ocpp/v201/functional_blocks/provisioning.hpp rename to include/ocpp/v2/functional_blocks/provisioning.hpp index 2159ab70c..5164e5a24 100644 --- a/include/ocpp/v201/functional_blocks/provisioning.hpp +++ b/include/ocpp/v2/functional_blocks/provisioning.hpp @@ -3,14 +3,14 @@ #pragma once -#include +#include -#include +#include namespace ocpp { class EvseSecurity; -namespace v201 { +namespace v2 { class DeviceModel; class ConnectivityManagerInterface; class ComponentStateManagerInterface; @@ -29,7 +29,7 @@ struct GetBaseReportRequest; struct ResetRequest; typedef std::function TimeSyncCallback; -typedef std::function +typedef std::function BootNotificationCallback; typedef std::function @@ -73,7 +73,7 @@ class ProvisioningInterface : public MessageHandlerInterface { class Provisioning : public ProvisioningInterface { public: Provisioning(DeviceModel& device_model, MessageDispatcherInterface& message_dispatcher, - MessageQueue& message_queue, ConnectivityManagerInterface& connectivity_manager, + MessageQueue& message_queue, ConnectivityManagerInterface& connectivity_manager, ComponentStateManagerInterface& component_state_manager, OcspUpdaterInterface& ocsp_updater, EvseManagerInterface& evse_manager, EvseSecurity& evse_security, @@ -99,7 +99,7 @@ class Provisioning : public ProvisioningInterface { private: // Members DeviceModel& device_model; MessageDispatcherInterface& message_dispatcher; - MessageQueue& message_queue; + MessageQueue& message_queue; ConnectivityManagerInterface& connectivity_manager; ComponentStateManagerInterface& component_state_manager; OcspUpdaterInterface& ocsp_updater; @@ -133,9 +133,9 @@ class Provisioning : public ProvisioningInterface { void handle_boot_notification_response(CallResult call_result); void handle_set_variables_req(Call call); - void handle_get_variables_req(const EnhancedMessage& message); + void handle_get_variables_req(const EnhancedMessage& message); void handle_get_base_report_req(Call call); - void handle_get_report_req(const EnhancedMessage& message); + void handle_get_report_req(const EnhancedMessage& message); void handle_set_network_profile_req(Call call); void handle_reset_req(Call call); @@ -157,5 +157,5 @@ class Provisioning : public ProvisioningInterface { set_variables_internal(const std::vector& set_variable_data_vector, const std::string& source, const bool allow_read_only); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/functional_blocks/remote_transaction_control.hpp b/include/ocpp/v2/functional_blocks/remote_transaction_control.hpp similarity index 97% rename from include/ocpp/v201/functional_blocks/remote_transaction_control.hpp rename to include/ocpp/v2/functional_blocks/remote_transaction_control.hpp index 14d26914b..1ec5fa239 100644 --- a/include/ocpp/v201/functional_blocks/remote_transaction_control.hpp +++ b/include/ocpp/v2/functional_blocks/remote_transaction_control.hpp @@ -3,11 +3,11 @@ #pragma once -#include +#include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class ConnectivityManagerInterface; class DeviceModel; class EvseManagerInterface; @@ -110,4 +110,4 @@ class RemoteTransactionControl : public RemoteTransactionControlInterface { ReservationCheckStatus is_evse_reserved_for_other(EvseInterface& evse, const IdToken& id_token, const std::optional& group_id_token) const; }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/reservation.hpp b/include/ocpp/v2/functional_blocks/reservation.hpp similarity index 96% rename from include/ocpp/v201/functional_blocks/reservation.hpp rename to include/ocpp/v2/functional_blocks/reservation.hpp index 3b9b5ba5b..dca87d4a2 100644 --- a/include/ocpp/v201/functional_blocks/reservation.hpp +++ b/include/ocpp/v2/functional_blocks/reservation.hpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include -#include +#include +#include #pragma once -namespace ocpp::v201 { +namespace ocpp::v2 { class EvseInterface; class EvseManagerInterface; @@ -66,4 +66,4 @@ class Reservation : public ReservationInterface { void send_reserve_now_rejected_response(const MessageId& unique_id, const std::string& status_info); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/security.hpp b/include/ocpp/v2/functional_blocks/security.hpp similarity index 96% rename from include/ocpp/v201/functional_blocks/security.hpp rename to include/ocpp/v2/functional_blocks/security.hpp index d2b282c90..97bff42a4 100644 --- a/include/ocpp/v201/functional_blocks/security.hpp +++ b/include/ocpp/v2/functional_blocks/security.hpp @@ -5,11 +5,11 @@ #include -#include -#include -#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { struct CertificateSignedRequest; struct CertificateSignedResponse; struct GetInstalledCertificateIdsRequest; @@ -99,4 +99,4 @@ class Security : public SecurityInterface { void scheduled_check_client_certificate_expiration(); void scheduled_check_v2g_certificate_expiration(); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/smart_charging.hpp b/include/ocpp/v2/functional_blocks/smart_charging.hpp similarity index 98% rename from include/ocpp/v201/functional_blocks/smart_charging.hpp rename to include/ocpp/v2/functional_blocks/smart_charging.hpp index 9eb75c7e3..b1da008af 100644 --- a/include/ocpp/v201/functional_blocks/smart_charging.hpp +++ b/include/ocpp/v2/functional_blocks/smart_charging.hpp @@ -3,13 +3,13 @@ #pragma once -#include +#include -#include -#include -#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DeviceModel; class EvseManagerInterface; class ConnectivityManagerInterface; @@ -266,4 +266,4 @@ class SmartCharging : public SmartChargingInterface { void conform_validity_periods(ChargingProfile& profile) const; CurrentPhaseType get_current_phase_type(const std::optional evse_opt) const; }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/tariff_and_cost.hpp b/include/ocpp/v2/functional_blocks/tariff_and_cost.hpp similarity index 95% rename from include/ocpp/v201/functional_blocks/tariff_and_cost.hpp rename to include/ocpp/v2/functional_blocks/tariff_and_cost.hpp index 1243541b6..2fa358399 100644 --- a/include/ocpp/v201/functional_blocks/tariff_and_cost.hpp +++ b/include/ocpp/v2/functional_blocks/tariff_and_cost.hpp @@ -3,12 +3,12 @@ #pragma once -#include +#include #include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DeviceModel; class EvseManagerInterface; class MeterValuesInterface; @@ -78,4 +78,4 @@ class TariffAndCost : public TariffAndCostInterface { /// bool is_cost_enabled() const; }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/functional_blocks/transaction.hpp b/include/ocpp/v2/functional_blocks/transaction.hpp similarity index 89% rename from include/ocpp/v201/functional_blocks/transaction.hpp rename to include/ocpp/v2/functional_blocks/transaction.hpp index 8205cd3a2..fc045d48f 100644 --- a/include/ocpp/v201/functional_blocks/transaction.hpp +++ b/include/ocpp/v2/functional_blocks/transaction.hpp @@ -3,11 +3,11 @@ #pragma once -#include +#include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DeviceModel; class AuthorizationInterface; class ConnectivityManagerInterface; @@ -46,7 +46,7 @@ class TransactionInterface : public MessageHandlerInterface { /// \param charging_state The new charging state virtual void on_transaction_started(const int32_t evse_id, const int32_t connector_id, const std::string& session_id, - const DateTime& timestamp, const ocpp::v201::TriggerReasonEnum trigger_reason, + const DateTime& timestamp, const TriggerReasonEnum trigger_reason, const MeterValue& meter_start, const std::optional& id_token, const std::optional& group_id_token, const std::optional& reservation_id, const std::optional& remote_start_id, const ChargingStateEnum charging_state) = 0; @@ -69,12 +69,10 @@ class TransactionInterface : public MessageHandlerInterface { // Functional Block E: Transactions virtual void transaction_event_req(const TransactionEventEnum& event_type, const DateTime& timestamp, - const ocpp::v201::Transaction& transaction, - const ocpp::v201::TriggerReasonEnum& trigger_reason, const int32_t seq_no, - const std::optional& cable_max_current, - const std::optional& evse, - const std::optional& id_token, - const std::optional>& meter_value, + const Transaction& transaction, const TriggerReasonEnum& trigger_reason, + const int32_t seq_no, const std::optional& cable_max_current, + const std::optional& evse, const std::optional& id_token, + const std::optional>& meter_value, const std::optional& number_of_phases_used, const bool offline, const std::optional& reservation_id, const bool initiated_by_trigger_message = false) = 0; @@ -88,7 +86,7 @@ class TransactionBlock : public TransactionInterface { public: TransactionBlock(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, ConnectivityManagerInterface& connectivity_manager, EvseManagerInterface& evse_manager, - MessageQueue& message_queue, DatabaseHandlerInterface& database_handler, + MessageQueue& message_queue, DatabaseHandlerInterface& database_handler, AuthorizationInterface& authorization, AvailabilityInterface& availability, SmartChargingInterface& smart_charging, TariffAndCostInterface& tariff_and_cost, StopTransactionCallback stop_transaction_callback, PauseChargingCallback pause_charging_callback, @@ -125,7 +123,7 @@ class TransactionBlock : public TransactionInterface { DeviceModel& device_model; ConnectivityManagerInterface& connectivity_manager; EvseManagerInterface& evse_manager; - MessageQueue& message_queue; + MessageQueue& message_queue; DatabaseHandlerInterface& database_handler; AuthorizationInterface& authorization; AvailabilityInterface& availability; @@ -147,7 +145,7 @@ class TransactionBlock : public TransactionInterface { /* OCPP message handlers */ // Functional Block E: Transaction - void handle_transaction_event_response(const EnhancedMessage& message); + void handle_transaction_event_response(const EnhancedMessage& message); void handle_get_transaction_status(const Call call); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/init_device_model_db.hpp b/include/ocpp/v2/init_device_model_db.hpp similarity index 98% rename from include/ocpp/v201/init_device_model_db.hpp rename to include/ocpp/v2/init_device_model_db.hpp index a74cca055..b6382594f 100644 --- a/include/ocpp/v201/init_device_model_db.hpp +++ b/include/ocpp/v2/init_device_model_db.hpp @@ -3,10 +3,10 @@ /// /// @file init_device_model_db.hpp -/// @brief @copybrief ocpp::v201::InitDeviceModelDb/// -/// @details @copydetails ocpp::v201::InitDeviceModelDb +/// @brief @copybrief ocpp::v2::InitDeviceModelDb/// +/// @details @copydetails ocpp::v2::InitDeviceModelDb /// -/// @class ocpp::v201::InitDeviceModelDb +/// @class ocpp::v2::InitDeviceModelDb /// @brief Class to initialize the device model db using the component config files /// /// This class will read the device model config files and put them in the device model database. @@ -36,9 +36,9 @@ #include #include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { /// /// \brief Class that holds a component. /// @@ -453,4 +453,4 @@ class InitDeviceModelDb : public common::DatabaseHandlerCommon { /// virtual void init_sql() override; }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/message_dispatcher.hpp b/include/ocpp/v2/message_dispatcher.hpp similarity index 89% rename from include/ocpp/v201/message_dispatcher.hpp rename to include/ocpp/v2/message_dispatcher.hpp index caebb462c..3ca1ed85d 100644 --- a/include/ocpp/v201/message_dispatcher.hpp +++ b/include/ocpp/v2/message_dispatcher.hpp @@ -4,11 +4,11 @@ #pragma once #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { class MessageDispatcher : public MessageDispatcherInterface { @@ -27,5 +27,5 @@ class MessageDispatcher : public MessageDispatcherInterface { std::atomic& registration_status; }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/include/ocpp/v201/message_handler.hpp b/include/ocpp/v2/message_handler.hpp similarity index 96% rename from include/ocpp/v201/message_handler.hpp rename to include/ocpp/v2/message_handler.hpp index 2cb72a6f0..80c107c99 100644 --- a/include/ocpp/v201/message_handler.hpp +++ b/include/ocpp/v2/message_handler.hpp @@ -6,7 +6,7 @@ #include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Interface for handling OCPP2.0.1 CALL messages from the CSMS. Classes implementing a functional block shall /// extend this interface. @@ -35,5 +35,5 @@ class MessageTypeNotImplementedException : public std::exception { } }; -} // namespace v201 +} // namespace v2 } // namespace ocpp \ No newline at end of file diff --git a/include/ocpp/v201/messages/Authorize.hpp b/include/ocpp/v2/messages/Authorize.hpp similarity index 91% rename from include/ocpp/v201/messages/Authorize.hpp rename to include/ocpp/v2/messages/Authorize.hpp index 9e20e8569..56cff8e76 100644 --- a/include/ocpp/v201/messages/Authorize.hpp +++ b/include/ocpp/v2/messages/Authorize.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_AUTHORIZE_HPP -#define OCPP_V201_AUTHORIZE_HPP +#ifndef OCPP_V2_AUTHORIZE_HPP +#define OCPP_V2_AUTHORIZE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP Authorize message struct AuthorizeRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, AuthorizeResponse& k); /// \returns an output stream with the AuthorizeResponse written to std::ostream& operator<<(std::ostream& os, const AuthorizeResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_AUTHORIZE_HPP +#endif // OCPP_V2_AUTHORIZE_HPP diff --git a/include/ocpp/v201/messages/BootNotification.hpp b/include/ocpp/v2/messages/BootNotification.hpp similarity index 91% rename from include/ocpp/v201/messages/BootNotification.hpp rename to include/ocpp/v2/messages/BootNotification.hpp index 6fd3e52be..bf77d3e55 100644 --- a/include/ocpp/v201/messages/BootNotification.hpp +++ b/include/ocpp/v2/messages/BootNotification.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_BOOTNOTIFICATION_HPP -#define OCPP_V201_BOOTNOTIFICATION_HPP +#ifndef OCPP_V2_BOOTNOTIFICATION_HPP +#define OCPP_V2_BOOTNOTIFICATION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP BootNotification message struct BootNotificationRequest : public ocpp::Message { @@ -59,7 +59,7 @@ void from_json(const json& j, BootNotificationResponse& k); /// \returns an output stream with the BootNotificationResponse written to std::ostream& operator<<(std::ostream& os, const BootNotificationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_BOOTNOTIFICATION_HPP +#endif // OCPP_V2_BOOTNOTIFICATION_HPP diff --git a/include/ocpp/v201/messages/CancelReservation.hpp b/include/ocpp/v2/messages/CancelReservation.hpp similarity index 91% rename from include/ocpp/v201/messages/CancelReservation.hpp rename to include/ocpp/v2/messages/CancelReservation.hpp index ccf8dff2e..3994bb0dd 100644 --- a/include/ocpp/v201/messages/CancelReservation.hpp +++ b/include/ocpp/v2/messages/CancelReservation.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CANCELRESERVATION_HPP -#define OCPP_V201_CANCELRESERVATION_HPP +#ifndef OCPP_V2_CANCELRESERVATION_HPP +#define OCPP_V2_CANCELRESERVATION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP CancelReservation message struct CancelReservationRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, CancelReservationResponse& k); /// \returns an output stream with the CancelReservationResponse written to std::ostream& operator<<(std::ostream& os, const CancelReservationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CANCELRESERVATION_HPP +#endif // OCPP_V2_CANCELRESERVATION_HPP diff --git a/include/ocpp/v201/messages/CertificateSigned.hpp b/include/ocpp/v2/messages/CertificateSigned.hpp similarity index 91% rename from include/ocpp/v201/messages/CertificateSigned.hpp rename to include/ocpp/v2/messages/CertificateSigned.hpp index 720f2afc6..c79e93201 100644 --- a/include/ocpp/v201/messages/CertificateSigned.hpp +++ b/include/ocpp/v2/messages/CertificateSigned.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CERTIFICATESIGNED_HPP -#define OCPP_V201_CERTIFICATESIGNED_HPP +#ifndef OCPP_V2_CERTIFICATESIGNED_HPP +#define OCPP_V2_CERTIFICATESIGNED_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP CertificateSigned message struct CertificateSignedRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, CertificateSignedResponse& k); /// \returns an output stream with the CertificateSignedResponse written to std::ostream& operator<<(std::ostream& os, const CertificateSignedResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CERTIFICATESIGNED_HPP +#endif // OCPP_V2_CERTIFICATESIGNED_HPP diff --git a/include/ocpp/v201/messages/ChangeAvailability.hpp b/include/ocpp/v2/messages/ChangeAvailability.hpp similarity index 91% rename from include/ocpp/v201/messages/ChangeAvailability.hpp rename to include/ocpp/v2/messages/ChangeAvailability.hpp index b11e99774..b9c90db34 100644 --- a/include/ocpp/v201/messages/ChangeAvailability.hpp +++ b/include/ocpp/v2/messages/ChangeAvailability.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CHANGEAVAILABILITY_HPP -#define OCPP_V201_CHANGEAVAILABILITY_HPP +#ifndef OCPP_V2_CHANGEAVAILABILITY_HPP +#define OCPP_V2_CHANGEAVAILABILITY_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ChangeAvailability message struct ChangeAvailabilityRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, ChangeAvailabilityResponse& k); /// os \returns an output stream with the ChangeAvailabilityResponse written to std::ostream& operator<<(std::ostream& os, const ChangeAvailabilityResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CHANGEAVAILABILITY_HPP +#endif // OCPP_V2_CHANGEAVAILABILITY_HPP diff --git a/include/ocpp/v201/messages/ClearCache.hpp b/include/ocpp/v2/messages/ClearCache.hpp similarity index 91% rename from include/ocpp/v201/messages/ClearCache.hpp rename to include/ocpp/v2/messages/ClearCache.hpp index f22dbcfd5..df0c3f780 100644 --- a/include/ocpp/v201/messages/ClearCache.hpp +++ b/include/ocpp/v2/messages/ClearCache.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CLEARCACHE_HPP -#define OCPP_V201_CLEARCACHE_HPP +#ifndef OCPP_V2_CLEARCACHE_HPP +#define OCPP_V2_CLEARCACHE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ClearCache message struct ClearCacheRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, ClearCacheResponse& k); /// \returns an output stream with the ClearCacheResponse written to std::ostream& operator<<(std::ostream& os, const ClearCacheResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CLEARCACHE_HPP +#endif // OCPP_V2_CLEARCACHE_HPP diff --git a/include/ocpp/v201/messages/ClearChargingProfile.hpp b/include/ocpp/v2/messages/ClearChargingProfile.hpp similarity index 91% rename from include/ocpp/v201/messages/ClearChargingProfile.hpp rename to include/ocpp/v2/messages/ClearChargingProfile.hpp index 8fd1f8cbf..990784e00 100644 --- a/include/ocpp/v201/messages/ClearChargingProfile.hpp +++ b/include/ocpp/v2/messages/ClearChargingProfile.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CLEARCHARGINGPROFILE_HPP -#define OCPP_V201_CLEARCHARGINGPROFILE_HPP +#ifndef OCPP_V2_CLEARCHARGINGPROFILE_HPP +#define OCPP_V2_CLEARCHARGINGPROFILE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ClearChargingProfile message struct ClearChargingProfileRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, ClearChargingProfileResponse& k); /// os \returns an output stream with the ClearChargingProfileResponse written to std::ostream& operator<<(std::ostream& os, const ClearChargingProfileResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CLEARCHARGINGPROFILE_HPP +#endif // OCPP_V2_CLEARCHARGINGPROFILE_HPP diff --git a/include/ocpp/v201/messages/ClearDisplayMessage.hpp b/include/ocpp/v2/messages/ClearDisplayMessage.hpp similarity index 90% rename from include/ocpp/v201/messages/ClearDisplayMessage.hpp rename to include/ocpp/v2/messages/ClearDisplayMessage.hpp index 85f2c193b..edf659853 100644 --- a/include/ocpp/v201/messages/ClearDisplayMessage.hpp +++ b/include/ocpp/v2/messages/ClearDisplayMessage.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CLEARDISPLAYMESSAGE_HPP -#define OCPP_V201_CLEARDISPLAYMESSAGE_HPP +#ifndef OCPP_V2_CLEARDISPLAYMESSAGE_HPP +#define OCPP_V2_CLEARDISPLAYMESSAGE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ClearDisplayMessage message struct ClearDisplayMessageRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, ClearDisplayMessageResponse& k); /// os \returns an output stream with the ClearDisplayMessageResponse written to std::ostream& operator<<(std::ostream& os, const ClearDisplayMessageResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CLEARDISPLAYMESSAGE_HPP +#endif // OCPP_V2_CLEARDISPLAYMESSAGE_HPP diff --git a/include/ocpp/v201/messages/ClearVariableMonitoring.hpp b/include/ocpp/v2/messages/ClearVariableMonitoring.hpp similarity index 90% rename from include/ocpp/v201/messages/ClearVariableMonitoring.hpp rename to include/ocpp/v2/messages/ClearVariableMonitoring.hpp index db3cf4de2..05b632179 100644 --- a/include/ocpp/v201/messages/ClearVariableMonitoring.hpp +++ b/include/ocpp/v2/messages/ClearVariableMonitoring.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CLEARVARIABLEMONITORING_HPP -#define OCPP_V201_CLEARVARIABLEMONITORING_HPP +#ifndef OCPP_V2_CLEARVARIABLEMONITORING_HPP +#define OCPP_V2_CLEARVARIABLEMONITORING_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ClearVariableMonitoring message struct ClearVariableMonitoringRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, ClearVariableMonitoringResponse& k); /// \p os \returns an output stream with the ClearVariableMonitoringResponse written to std::ostream& operator<<(std::ostream& os, const ClearVariableMonitoringResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CLEARVARIABLEMONITORING_HPP +#endif // OCPP_V2_CLEARVARIABLEMONITORING_HPP diff --git a/include/ocpp/v201/messages/ClearedChargingLimit.hpp b/include/ocpp/v2/messages/ClearedChargingLimit.hpp similarity index 90% rename from include/ocpp/v201/messages/ClearedChargingLimit.hpp rename to include/ocpp/v2/messages/ClearedChargingLimit.hpp index 4912aeca6..1e11ebc38 100644 --- a/include/ocpp/v201/messages/ClearedChargingLimit.hpp +++ b/include/ocpp/v2/messages/ClearedChargingLimit.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CLEAREDCHARGINGLIMIT_HPP -#define OCPP_V201_CLEAREDCHARGINGLIMIT_HPP +#ifndef OCPP_V2_CLEAREDCHARGINGLIMIT_HPP +#define OCPP_V2_CLEAREDCHARGINGLIMIT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ClearedChargingLimit message struct ClearedChargingLimitRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, ClearedChargingLimitResponse& k); /// os \returns an output stream with the ClearedChargingLimitResponse written to std::ostream& operator<<(std::ostream& os, const ClearedChargingLimitResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CLEAREDCHARGINGLIMIT_HPP +#endif // OCPP_V2_CLEAREDCHARGINGLIMIT_HPP diff --git a/include/ocpp/v201/messages/CostUpdated.hpp b/include/ocpp/v2/messages/CostUpdated.hpp similarity index 92% rename from include/ocpp/v201/messages/CostUpdated.hpp rename to include/ocpp/v2/messages/CostUpdated.hpp index 18f3867e8..79dad42db 100644 --- a/include/ocpp/v201/messages/CostUpdated.hpp +++ b/include/ocpp/v2/messages/CostUpdated.hpp @@ -2,17 +2,17 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_COSTUPDATED_HPP -#define OCPP_V201_COSTUPDATED_HPP +#ifndef OCPP_V2_COSTUPDATED_HPP +#define OCPP_V2_COSTUPDATED_HPP #include #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP CostUpdated message struct CostUpdatedRequest : public ocpp::Message { @@ -54,7 +54,7 @@ void from_json(const json& j, CostUpdatedResponse& k); /// \returns an output stream with the CostUpdatedResponse written to std::ostream& operator<<(std::ostream& os, const CostUpdatedResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_COSTUPDATED_HPP +#endif // OCPP_V2_COSTUPDATED_HPP diff --git a/include/ocpp/v201/messages/CustomerInformation.hpp b/include/ocpp/v2/messages/CustomerInformation.hpp similarity index 91% rename from include/ocpp/v201/messages/CustomerInformation.hpp rename to include/ocpp/v2/messages/CustomerInformation.hpp index 1cd94b03b..4fc3ceeab 100644 --- a/include/ocpp/v201/messages/CustomerInformation.hpp +++ b/include/ocpp/v2/messages/CustomerInformation.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_CUSTOMERINFORMATION_HPP -#define OCPP_V201_CUSTOMERINFORMATION_HPP +#ifndef OCPP_V2_CUSTOMERINFORMATION_HPP +#define OCPP_V2_CUSTOMERINFORMATION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP CustomerInformation message struct CustomerInformationRequest : public ocpp::Message { @@ -61,7 +61,7 @@ void from_json(const json& j, CustomerInformationResponse& k); /// os \returns an output stream with the CustomerInformationResponse written to std::ostream& operator<<(std::ostream& os, const CustomerInformationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_CUSTOMERINFORMATION_HPP +#endif // OCPP_V2_CUSTOMERINFORMATION_HPP diff --git a/include/ocpp/v201/messages/DataTransfer.hpp b/include/ocpp/v2/messages/DataTransfer.hpp similarity index 91% rename from include/ocpp/v201/messages/DataTransfer.hpp rename to include/ocpp/v2/messages/DataTransfer.hpp index e3a5bbadc..38867e9f6 100644 --- a/include/ocpp/v201/messages/DataTransfer.hpp +++ b/include/ocpp/v2/messages/DataTransfer.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_DATATRANSFER_HPP -#define OCPP_V201_DATATRANSFER_HPP +#ifndef OCPP_V2_DATATRANSFER_HPP +#define OCPP_V2_DATATRANSFER_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP DataTransfer message struct DataTransferRequest : public ocpp::Message { @@ -59,7 +59,7 @@ void from_json(const json& j, DataTransferResponse& k); /// \returns an output stream with the DataTransferResponse written to std::ostream& operator<<(std::ostream& os, const DataTransferResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_DATATRANSFER_HPP +#endif // OCPP_V2_DATATRANSFER_HPP diff --git a/include/ocpp/v201/messages/DeleteCertificate.hpp b/include/ocpp/v2/messages/DeleteCertificate.hpp similarity index 91% rename from include/ocpp/v201/messages/DeleteCertificate.hpp rename to include/ocpp/v2/messages/DeleteCertificate.hpp index 397d6b4e2..908828191 100644 --- a/include/ocpp/v201/messages/DeleteCertificate.hpp +++ b/include/ocpp/v2/messages/DeleteCertificate.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_DELETECERTIFICATE_HPP -#define OCPP_V201_DELETECERTIFICATE_HPP +#ifndef OCPP_V2_DELETECERTIFICATE_HPP +#define OCPP_V2_DELETECERTIFICATE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP DeleteCertificate message struct DeleteCertificateRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, DeleteCertificateResponse& k); /// \returns an output stream with the DeleteCertificateResponse written to std::ostream& operator<<(std::ostream& os, const DeleteCertificateResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_DELETECERTIFICATE_HPP +#endif // OCPP_V2_DELETECERTIFICATE_HPP diff --git a/include/ocpp/v201/messages/FirmwareStatusNotification.hpp b/include/ocpp/v2/messages/FirmwareStatusNotification.hpp similarity index 90% rename from include/ocpp/v201/messages/FirmwareStatusNotification.hpp rename to include/ocpp/v2/messages/FirmwareStatusNotification.hpp index 50dd623f2..ec7b52c63 100644 --- a/include/ocpp/v201/messages/FirmwareStatusNotification.hpp +++ b/include/ocpp/v2/messages/FirmwareStatusNotification.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_FIRMWARESTATUSNOTIFICATION_HPP -#define OCPP_V201_FIRMWARESTATUSNOTIFICATION_HPP +#ifndef OCPP_V2_FIRMWARESTATUSNOTIFICATION_HPP +#define OCPP_V2_FIRMWARESTATUSNOTIFICATION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP FirmwareStatusNotification message struct FirmwareStatusNotificationRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, FirmwareStatusNotificationResponse& k); /// stream \p os \returns an output stream with the FirmwareStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const FirmwareStatusNotificationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_FIRMWARESTATUSNOTIFICATION_HPP +#endif // OCPP_V2_FIRMWARESTATUSNOTIFICATION_HPP diff --git a/include/ocpp/v201/messages/Get15118EVCertificate.hpp b/include/ocpp/v2/messages/Get15118EVCertificate.hpp similarity index 90% rename from include/ocpp/v201/messages/Get15118EVCertificate.hpp rename to include/ocpp/v2/messages/Get15118EVCertificate.hpp index 73e66cb69..19a6d28e6 100644 --- a/include/ocpp/v201/messages/Get15118EVCertificate.hpp +++ b/include/ocpp/v2/messages/Get15118EVCertificate.hpp @@ -2,19 +2,19 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GET15118EVCERTIFICATE_HPP -#define OCPP_V201_GET15118EVCERTIFICATE_HPP +#ifndef OCPP_V2_GET15118EVCERTIFICATE_HPP +#define OCPP_V2_GET15118EVCERTIFICATE_HPP #include #include #include -#include -#include -#include +#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP Get15118EVCertificate message struct Get15118EVCertificateRequest : public ocpp::Message { @@ -60,7 +60,7 @@ void from_json(const json& j, Get15118EVCertificateResponse& k); /// \p os \returns an output stream with the Get15118EVCertificateResponse written to std::ostream& operator<<(std::ostream& os, const Get15118EVCertificateResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GET15118EVCERTIFICATE_HPP +#endif // OCPP_V2_GET15118EVCERTIFICATE_HPP diff --git a/include/ocpp/v201/messages/GetBaseReport.hpp b/include/ocpp/v2/messages/GetBaseReport.hpp similarity index 91% rename from include/ocpp/v201/messages/GetBaseReport.hpp rename to include/ocpp/v2/messages/GetBaseReport.hpp index 7df85fa0d..11b70c39e 100644 --- a/include/ocpp/v201/messages/GetBaseReport.hpp +++ b/include/ocpp/v2/messages/GetBaseReport.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETBASEREPORT_HPP -#define OCPP_V201_GETBASEREPORT_HPP +#ifndef OCPP_V2_GETBASEREPORT_HPP +#define OCPP_V2_GETBASEREPORT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetBaseReport message struct GetBaseReportRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, GetBaseReportResponse& k); /// \returns an output stream with the GetBaseReportResponse written to std::ostream& operator<<(std::ostream& os, const GetBaseReportResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETBASEREPORT_HPP +#endif // OCPP_V2_GETBASEREPORT_HPP diff --git a/include/ocpp/v201/messages/GetCertificateStatus.hpp b/include/ocpp/v2/messages/GetCertificateStatus.hpp similarity index 91% rename from include/ocpp/v201/messages/GetCertificateStatus.hpp rename to include/ocpp/v2/messages/GetCertificateStatus.hpp index 692061b73..8a623610a 100644 --- a/include/ocpp/v201/messages/GetCertificateStatus.hpp +++ b/include/ocpp/v2/messages/GetCertificateStatus.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETCERTIFICATESTATUS_HPP -#define OCPP_V201_GETCERTIFICATESTATUS_HPP +#ifndef OCPP_V2_GETCERTIFICATESTATUS_HPP +#define OCPP_V2_GETCERTIFICATESTATUS_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetCertificateStatus message struct GetCertificateStatusRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, GetCertificateStatusResponse& k); /// os \returns an output stream with the GetCertificateStatusResponse written to std::ostream& operator<<(std::ostream& os, const GetCertificateStatusResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETCERTIFICATESTATUS_HPP +#endif // OCPP_V2_GETCERTIFICATESTATUS_HPP diff --git a/include/ocpp/v201/messages/GetChargingProfiles.hpp b/include/ocpp/v2/messages/GetChargingProfiles.hpp similarity index 91% rename from include/ocpp/v201/messages/GetChargingProfiles.hpp rename to include/ocpp/v2/messages/GetChargingProfiles.hpp index cc33bb397..9475aad07 100644 --- a/include/ocpp/v201/messages/GetChargingProfiles.hpp +++ b/include/ocpp/v2/messages/GetChargingProfiles.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETCHARGINGPROFILES_HPP -#define OCPP_V201_GETCHARGINGPROFILES_HPP +#ifndef OCPP_V2_GETCHARGINGPROFILES_HPP +#define OCPP_V2_GETCHARGINGPROFILES_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetChargingProfiles message struct GetChargingProfilesRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, GetChargingProfilesResponse& k); /// os \returns an output stream with the GetChargingProfilesResponse written to std::ostream& operator<<(std::ostream& os, const GetChargingProfilesResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETCHARGINGPROFILES_HPP +#endif // OCPP_V2_GETCHARGINGPROFILES_HPP diff --git a/include/ocpp/v201/messages/GetCompositeSchedule.hpp b/include/ocpp/v2/messages/GetCompositeSchedule.hpp similarity index 91% rename from include/ocpp/v201/messages/GetCompositeSchedule.hpp rename to include/ocpp/v2/messages/GetCompositeSchedule.hpp index 8d8d67e1d..5c51d9871 100644 --- a/include/ocpp/v201/messages/GetCompositeSchedule.hpp +++ b/include/ocpp/v2/messages/GetCompositeSchedule.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETCOMPOSITESCHEDULE_HPP -#define OCPP_V201_GETCOMPOSITESCHEDULE_HPP +#ifndef OCPP_V2_GETCOMPOSITESCHEDULE_HPP +#define OCPP_V2_GETCOMPOSITESCHEDULE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetCompositeSchedule message struct GetCompositeScheduleRequest : public ocpp::Message { @@ -59,7 +59,7 @@ void from_json(const json& j, GetCompositeScheduleResponse& k); /// os \returns an output stream with the GetCompositeScheduleResponse written to std::ostream& operator<<(std::ostream& os, const GetCompositeScheduleResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETCOMPOSITESCHEDULE_HPP +#endif // OCPP_V2_GETCOMPOSITESCHEDULE_HPP diff --git a/include/ocpp/v201/messages/GetDisplayMessages.hpp b/include/ocpp/v2/messages/GetDisplayMessages.hpp similarity index 91% rename from include/ocpp/v201/messages/GetDisplayMessages.hpp rename to include/ocpp/v2/messages/GetDisplayMessages.hpp index 21236dcf0..d917614fe 100644 --- a/include/ocpp/v201/messages/GetDisplayMessages.hpp +++ b/include/ocpp/v2/messages/GetDisplayMessages.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETDISPLAYMESSAGES_HPP -#define OCPP_V201_GETDISPLAYMESSAGES_HPP +#ifndef OCPP_V2_GETDISPLAYMESSAGES_HPP +#define OCPP_V2_GETDISPLAYMESSAGES_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetDisplayMessages message struct GetDisplayMessagesRequest : public ocpp::Message { @@ -59,7 +59,7 @@ void from_json(const json& j, GetDisplayMessagesResponse& k); /// os \returns an output stream with the GetDisplayMessagesResponse written to std::ostream& operator<<(std::ostream& os, const GetDisplayMessagesResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETDISPLAYMESSAGES_HPP +#endif // OCPP_V2_GETDISPLAYMESSAGES_HPP diff --git a/include/ocpp/v201/messages/GetInstalledCertificateIds.hpp b/include/ocpp/v2/messages/GetInstalledCertificateIds.hpp similarity index 91% rename from include/ocpp/v201/messages/GetInstalledCertificateIds.hpp rename to include/ocpp/v2/messages/GetInstalledCertificateIds.hpp index 6646cb5cd..c8d69a172 100644 --- a/include/ocpp/v201/messages/GetInstalledCertificateIds.hpp +++ b/include/ocpp/v2/messages/GetInstalledCertificateIds.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETINSTALLEDCERTIFICATEIDS_HPP -#define OCPP_V201_GETINSTALLEDCERTIFICATEIDS_HPP +#ifndef OCPP_V2_GETINSTALLEDCERTIFICATEIDS_HPP +#define OCPP_V2_GETINSTALLEDCERTIFICATEIDS_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetInstalledCertificateIds message struct GetInstalledCertificateIdsRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, GetInstalledCertificateIdsResponse& k); /// stream \p os \returns an output stream with the GetInstalledCertificateIdsResponse written to std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateIdsResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETINSTALLEDCERTIFICATEIDS_HPP +#endif // OCPP_V2_GETINSTALLEDCERTIFICATEIDS_HPP diff --git a/include/ocpp/v201/messages/GetLocalListVersion.hpp b/include/ocpp/v2/messages/GetLocalListVersion.hpp similarity index 91% rename from include/ocpp/v201/messages/GetLocalListVersion.hpp rename to include/ocpp/v2/messages/GetLocalListVersion.hpp index 13824f89f..9f60d5500 100644 --- a/include/ocpp/v201/messages/GetLocalListVersion.hpp +++ b/include/ocpp/v2/messages/GetLocalListVersion.hpp @@ -2,17 +2,17 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETLOCALLISTVERSION_HPP -#define OCPP_V201_GETLOCALLISTVERSION_HPP +#ifndef OCPP_V2_GETLOCALLISTVERSION_HPP +#define OCPP_V2_GETLOCALLISTVERSION_HPP #include #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetLocalListVersion message struct GetLocalListVersionRequest : public ocpp::Message { @@ -53,7 +53,7 @@ void from_json(const json& j, GetLocalListVersionResponse& k); /// os \returns an output stream with the GetLocalListVersionResponse written to std::ostream& operator<<(std::ostream& os, const GetLocalListVersionResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETLOCALLISTVERSION_HPP +#endif // OCPP_V2_GETLOCALLISTVERSION_HPP diff --git a/include/ocpp/v201/messages/GetLog.hpp b/include/ocpp/v2/messages/GetLog.hpp similarity index 91% rename from include/ocpp/v201/messages/GetLog.hpp rename to include/ocpp/v2/messages/GetLog.hpp index fb4282e83..35b83ac6b 100644 --- a/include/ocpp/v201/messages/GetLog.hpp +++ b/include/ocpp/v2/messages/GetLog.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETLOG_HPP -#define OCPP_V201_GETLOG_HPP +#ifndef OCPP_V2_GETLOG_HPP +#define OCPP_V2_GETLOG_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetLog message struct GetLogRequest : public ocpp::Message { @@ -61,7 +61,7 @@ void from_json(const json& j, GetLogResponse& k); /// \returns an output stream with the GetLogResponse written to std::ostream& operator<<(std::ostream& os, const GetLogResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETLOG_HPP +#endif // OCPP_V2_GETLOG_HPP diff --git a/include/ocpp/v201/messages/GetMonitoringReport.hpp b/include/ocpp/v2/messages/GetMonitoringReport.hpp similarity index 91% rename from include/ocpp/v201/messages/GetMonitoringReport.hpp rename to include/ocpp/v2/messages/GetMonitoringReport.hpp index 0bce5aaed..ea7025a80 100644 --- a/include/ocpp/v201/messages/GetMonitoringReport.hpp +++ b/include/ocpp/v2/messages/GetMonitoringReport.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETMONITORINGREPORT_HPP -#define OCPP_V201_GETMONITORINGREPORT_HPP +#ifndef OCPP_V2_GETMONITORINGREPORT_HPP +#define OCPP_V2_GETMONITORINGREPORT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetMonitoringReport message struct GetMonitoringReportRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, GetMonitoringReportResponse& k); /// os \returns an output stream with the GetMonitoringReportResponse written to std::ostream& operator<<(std::ostream& os, const GetMonitoringReportResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETMONITORINGREPORT_HPP +#endif // OCPP_V2_GETMONITORINGREPORT_HPP diff --git a/include/ocpp/v201/messages/GetReport.hpp b/include/ocpp/v2/messages/GetReport.hpp similarity index 91% rename from include/ocpp/v201/messages/GetReport.hpp rename to include/ocpp/v2/messages/GetReport.hpp index 50ec85045..0936bf4f3 100644 --- a/include/ocpp/v201/messages/GetReport.hpp +++ b/include/ocpp/v2/messages/GetReport.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETREPORT_HPP -#define OCPP_V201_GETREPORT_HPP +#ifndef OCPP_V2_GETREPORT_HPP +#define OCPP_V2_GETREPORT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetReport message struct GetReportRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, GetReportResponse& k); /// \returns an output stream with the GetReportResponse written to std::ostream& operator<<(std::ostream& os, const GetReportResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETREPORT_HPP +#endif // OCPP_V2_GETREPORT_HPP diff --git a/include/ocpp/v201/messages/GetTransactionStatus.hpp b/include/ocpp/v2/messages/GetTransactionStatus.hpp similarity index 92% rename from include/ocpp/v201/messages/GetTransactionStatus.hpp rename to include/ocpp/v2/messages/GetTransactionStatus.hpp index e7d592356..befe02e02 100644 --- a/include/ocpp/v201/messages/GetTransactionStatus.hpp +++ b/include/ocpp/v2/messages/GetTransactionStatus.hpp @@ -2,17 +2,17 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETTRANSACTIONSTATUS_HPP -#define OCPP_V201_GETTRANSACTIONSTATUS_HPP +#ifndef OCPP_V2_GETTRANSACTIONSTATUS_HPP +#define OCPP_V2_GETTRANSACTIONSTATUS_HPP #include #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetTransactionStatus message struct GetTransactionStatusRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, GetTransactionStatusResponse& k); /// os \returns an output stream with the GetTransactionStatusResponse written to std::ostream& operator<<(std::ostream& os, const GetTransactionStatusResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETTRANSACTIONSTATUS_HPP +#endif // OCPP_V2_GETTRANSACTIONSTATUS_HPP diff --git a/include/ocpp/v201/messages/GetVariables.hpp b/include/ocpp/v2/messages/GetVariables.hpp similarity index 91% rename from include/ocpp/v201/messages/GetVariables.hpp rename to include/ocpp/v2/messages/GetVariables.hpp index 453024dec..74f4cbfab 100644 --- a/include/ocpp/v201/messages/GetVariables.hpp +++ b/include/ocpp/v2/messages/GetVariables.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_GETVARIABLES_HPP -#define OCPP_V201_GETVARIABLES_HPP +#ifndef OCPP_V2_GETVARIABLES_HPP +#define OCPP_V2_GETVARIABLES_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP GetVariables message struct GetVariablesRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, GetVariablesResponse& k); /// \returns an output stream with the GetVariablesResponse written to std::ostream& operator<<(std::ostream& os, const GetVariablesResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_GETVARIABLES_HPP +#endif // OCPP_V2_GETVARIABLES_HPP diff --git a/include/ocpp/v201/messages/Heartbeat.hpp b/include/ocpp/v2/messages/Heartbeat.hpp similarity index 92% rename from include/ocpp/v201/messages/Heartbeat.hpp rename to include/ocpp/v2/messages/Heartbeat.hpp index 6df26f5a5..8e28d2abf 100644 --- a/include/ocpp/v201/messages/Heartbeat.hpp +++ b/include/ocpp/v2/messages/Heartbeat.hpp @@ -2,17 +2,17 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_HEARTBEAT_HPP -#define OCPP_V201_HEARTBEAT_HPP +#ifndef OCPP_V2_HEARTBEAT_HPP +#define OCPP_V2_HEARTBEAT_HPP #include #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP Heartbeat message struct HeartbeatRequest : public ocpp::Message { @@ -53,7 +53,7 @@ void from_json(const json& j, HeartbeatResponse& k); /// \returns an output stream with the HeartbeatResponse written to std::ostream& operator<<(std::ostream& os, const HeartbeatResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_HEARTBEAT_HPP +#endif // OCPP_V2_HEARTBEAT_HPP diff --git a/include/ocpp/v201/messages/InstallCertificate.hpp b/include/ocpp/v2/messages/InstallCertificate.hpp similarity index 91% rename from include/ocpp/v201/messages/InstallCertificate.hpp rename to include/ocpp/v2/messages/InstallCertificate.hpp index d12eab7f7..d19224289 100644 --- a/include/ocpp/v201/messages/InstallCertificate.hpp +++ b/include/ocpp/v2/messages/InstallCertificate.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_INSTALLCERTIFICATE_HPP -#define OCPP_V201_INSTALLCERTIFICATE_HPP +#ifndef OCPP_V2_INSTALLCERTIFICATE_HPP +#define OCPP_V2_INSTALLCERTIFICATE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP InstallCertificate message struct InstallCertificateRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, InstallCertificateResponse& k); /// os \returns an output stream with the InstallCertificateResponse written to std::ostream& operator<<(std::ostream& os, const InstallCertificateResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_INSTALLCERTIFICATE_HPP +#endif // OCPP_V2_INSTALLCERTIFICATE_HPP diff --git a/include/ocpp/v201/messages/LogStatusNotification.hpp b/include/ocpp/v2/messages/LogStatusNotification.hpp similarity index 90% rename from include/ocpp/v201/messages/LogStatusNotification.hpp rename to include/ocpp/v2/messages/LogStatusNotification.hpp index 58d2c7995..41fbd59de 100644 --- a/include/ocpp/v201/messages/LogStatusNotification.hpp +++ b/include/ocpp/v2/messages/LogStatusNotification.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_LOGSTATUSNOTIFICATION_HPP -#define OCPP_V201_LOGSTATUSNOTIFICATION_HPP +#ifndef OCPP_V2_LOGSTATUSNOTIFICATION_HPP +#define OCPP_V2_LOGSTATUSNOTIFICATION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP LogStatusNotification message struct LogStatusNotificationRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, LogStatusNotificationResponse& k); /// \p os \returns an output stream with the LogStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const LogStatusNotificationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_LOGSTATUSNOTIFICATION_HPP +#endif // OCPP_V2_LOGSTATUSNOTIFICATION_HPP diff --git a/include/ocpp/v201/messages/MeterValues.hpp b/include/ocpp/v2/messages/MeterValues.hpp similarity index 91% rename from include/ocpp/v201/messages/MeterValues.hpp rename to include/ocpp/v2/messages/MeterValues.hpp index cec93d7e7..9e114423f 100644 --- a/include/ocpp/v201/messages/MeterValues.hpp +++ b/include/ocpp/v2/messages/MeterValues.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_METERVALUES_HPP -#define OCPP_V201_METERVALUES_HPP +#ifndef OCPP_V2_METERVALUES_HPP +#define OCPP_V2_METERVALUES_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP MeterValues message struct MeterValuesRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, MeterValuesResponse& k); /// \returns an output stream with the MeterValuesResponse written to std::ostream& operator<<(std::ostream& os, const MeterValuesResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_METERVALUES_HPP +#endif // OCPP_V2_METERVALUES_HPP diff --git a/include/ocpp/v201/messages/NotifyChargingLimit.hpp b/include/ocpp/v2/messages/NotifyChargingLimit.hpp similarity index 91% rename from include/ocpp/v201/messages/NotifyChargingLimit.hpp rename to include/ocpp/v2/messages/NotifyChargingLimit.hpp index e4889a704..8c0b25300 100644 --- a/include/ocpp/v201/messages/NotifyChargingLimit.hpp +++ b/include/ocpp/v2/messages/NotifyChargingLimit.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYCHARGINGLIMIT_HPP -#define OCPP_V201_NOTIFYCHARGINGLIMIT_HPP +#ifndef OCPP_V2_NOTIFYCHARGINGLIMIT_HPP +#define OCPP_V2_NOTIFYCHARGINGLIMIT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyChargingLimit message struct NotifyChargingLimitRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, NotifyChargingLimitResponse& k); /// os \returns an output stream with the NotifyChargingLimitResponse written to std::ostream& operator<<(std::ostream& os, const NotifyChargingLimitResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYCHARGINGLIMIT_HPP +#endif // OCPP_V2_NOTIFYCHARGINGLIMIT_HPP diff --git a/include/ocpp/v201/messages/NotifyCustomerInformation.hpp b/include/ocpp/v2/messages/NotifyCustomerInformation.hpp similarity index 92% rename from include/ocpp/v201/messages/NotifyCustomerInformation.hpp rename to include/ocpp/v2/messages/NotifyCustomerInformation.hpp index 04bb9a188..ea544350f 100644 --- a/include/ocpp/v201/messages/NotifyCustomerInformation.hpp +++ b/include/ocpp/v2/messages/NotifyCustomerInformation.hpp @@ -2,17 +2,17 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYCUSTOMERINFORMATION_HPP -#define OCPP_V201_NOTIFYCUSTOMERINFORMATION_HPP +#ifndef OCPP_V2_NOTIFYCUSTOMERINFORMATION_HPP +#define OCPP_V2_NOTIFYCUSTOMERINFORMATION_HPP #include #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyCustomerInformation message struct NotifyCustomerInformationRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, NotifyCustomerInformationResponse& k); /// stream \p os \returns an output stream with the NotifyCustomerInformationResponse written to std::ostream& operator<<(std::ostream& os, const NotifyCustomerInformationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYCUSTOMERINFORMATION_HPP +#endif // OCPP_V2_NOTIFYCUSTOMERINFORMATION_HPP diff --git a/include/ocpp/v201/messages/NotifyDisplayMessages.hpp b/include/ocpp/v2/messages/NotifyDisplayMessages.hpp similarity index 90% rename from include/ocpp/v201/messages/NotifyDisplayMessages.hpp rename to include/ocpp/v2/messages/NotifyDisplayMessages.hpp index e9fc34eed..175d7b3af 100644 --- a/include/ocpp/v201/messages/NotifyDisplayMessages.hpp +++ b/include/ocpp/v2/messages/NotifyDisplayMessages.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYDISPLAYMESSAGES_HPP -#define OCPP_V201_NOTIFYDISPLAYMESSAGES_HPP +#ifndef OCPP_V2_NOTIFYDISPLAYMESSAGES_HPP +#define OCPP_V2_NOTIFYDISPLAYMESSAGES_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyDisplayMessages message struct NotifyDisplayMessagesRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, NotifyDisplayMessagesResponse& k); /// \p os \returns an output stream with the NotifyDisplayMessagesResponse written to std::ostream& operator<<(std::ostream& os, const NotifyDisplayMessagesResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYDISPLAYMESSAGES_HPP +#endif // OCPP_V2_NOTIFYDISPLAYMESSAGES_HPP diff --git a/include/ocpp/v201/messages/NotifyEVChargingNeeds.hpp b/include/ocpp/v2/messages/NotifyEVChargingNeeds.hpp similarity index 91% rename from include/ocpp/v201/messages/NotifyEVChargingNeeds.hpp rename to include/ocpp/v2/messages/NotifyEVChargingNeeds.hpp index fa84aed9f..e7e3a1376 100644 --- a/include/ocpp/v201/messages/NotifyEVChargingNeeds.hpp +++ b/include/ocpp/v2/messages/NotifyEVChargingNeeds.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYEVCHARGINGNEEDS_HPP -#define OCPP_V201_NOTIFYEVCHARGINGNEEDS_HPP +#ifndef OCPP_V2_NOTIFYEVCHARGINGNEEDS_HPP +#define OCPP_V2_NOTIFYEVCHARGINGNEEDS_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyEVChargingNeeds message struct NotifyEVChargingNeedsRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, NotifyEVChargingNeedsResponse& k); /// \p os \returns an output stream with the NotifyEVChargingNeedsResponse written to std::ostream& operator<<(std::ostream& os, const NotifyEVChargingNeedsResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYEVCHARGINGNEEDS_HPP +#endif // OCPP_V2_NOTIFYEVCHARGINGNEEDS_HPP diff --git a/include/ocpp/v201/messages/NotifyEVChargingSchedule.hpp b/include/ocpp/v2/messages/NotifyEVChargingSchedule.hpp similarity index 90% rename from include/ocpp/v201/messages/NotifyEVChargingSchedule.hpp rename to include/ocpp/v2/messages/NotifyEVChargingSchedule.hpp index a2c4f8b5c..f08566359 100644 --- a/include/ocpp/v201/messages/NotifyEVChargingSchedule.hpp +++ b/include/ocpp/v2/messages/NotifyEVChargingSchedule.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYEVCHARGINGSCHEDULE_HPP -#define OCPP_V201_NOTIFYEVCHARGINGSCHEDULE_HPP +#ifndef OCPP_V2_NOTIFYEVCHARGINGSCHEDULE_HPP +#define OCPP_V2_NOTIFYEVCHARGINGSCHEDULE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyEVChargingSchedule message struct NotifyEVChargingScheduleRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, NotifyEVChargingScheduleResponse& k); /// stream \p os \returns an output stream with the NotifyEVChargingScheduleResponse written to std::ostream& operator<<(std::ostream& os, const NotifyEVChargingScheduleResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYEVCHARGINGSCHEDULE_HPP +#endif // OCPP_V2_NOTIFYEVCHARGINGSCHEDULE_HPP diff --git a/include/ocpp/v201/messages/NotifyEvent.hpp b/include/ocpp/v2/messages/NotifyEvent.hpp similarity index 91% rename from include/ocpp/v201/messages/NotifyEvent.hpp rename to include/ocpp/v2/messages/NotifyEvent.hpp index 400dcb549..1411dc271 100644 --- a/include/ocpp/v201/messages/NotifyEvent.hpp +++ b/include/ocpp/v2/messages/NotifyEvent.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYEVENT_HPP -#define OCPP_V201_NOTIFYEVENT_HPP +#ifndef OCPP_V2_NOTIFYEVENT_HPP +#define OCPP_V2_NOTIFYEVENT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyEvent message struct NotifyEventRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, NotifyEventResponse& k); /// \returns an output stream with the NotifyEventResponse written to std::ostream& operator<<(std::ostream& os, const NotifyEventResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYEVENT_HPP +#endif // OCPP_V2_NOTIFYEVENT_HPP diff --git a/include/ocpp/v201/messages/NotifyMonitoringReport.hpp b/include/ocpp/v2/messages/NotifyMonitoringReport.hpp similarity index 91% rename from include/ocpp/v201/messages/NotifyMonitoringReport.hpp rename to include/ocpp/v2/messages/NotifyMonitoringReport.hpp index 0c98dc0b4..c52f44146 100644 --- a/include/ocpp/v201/messages/NotifyMonitoringReport.hpp +++ b/include/ocpp/v2/messages/NotifyMonitoringReport.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYMONITORINGREPORT_HPP -#define OCPP_V201_NOTIFYMONITORINGREPORT_HPP +#ifndef OCPP_V2_NOTIFYMONITORINGREPORT_HPP +#define OCPP_V2_NOTIFYMONITORINGREPORT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyMonitoringReport message struct NotifyMonitoringReportRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, NotifyMonitoringReportResponse& k); /// \p os \returns an output stream with the NotifyMonitoringReportResponse written to std::ostream& operator<<(std::ostream& os, const NotifyMonitoringReportResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYMONITORINGREPORT_HPP +#endif // OCPP_V2_NOTIFYMONITORINGREPORT_HPP diff --git a/include/ocpp/v201/messages/NotifyReport.hpp b/include/ocpp/v2/messages/NotifyReport.hpp similarity index 91% rename from include/ocpp/v201/messages/NotifyReport.hpp rename to include/ocpp/v2/messages/NotifyReport.hpp index 7d91fba36..81d701652 100644 --- a/include/ocpp/v201/messages/NotifyReport.hpp +++ b/include/ocpp/v2/messages/NotifyReport.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_NOTIFYREPORT_HPP -#define OCPP_V201_NOTIFYREPORT_HPP +#ifndef OCPP_V2_NOTIFYREPORT_HPP +#define OCPP_V2_NOTIFYREPORT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP NotifyReport message struct NotifyReportRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, NotifyReportResponse& k); /// \returns an output stream with the NotifyReportResponse written to std::ostream& operator<<(std::ostream& os, const NotifyReportResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_NOTIFYREPORT_HPP +#endif // OCPP_V2_NOTIFYREPORT_HPP diff --git a/include/ocpp/v201/messages/PublishFirmware.hpp b/include/ocpp/v2/messages/PublishFirmware.hpp similarity index 91% rename from include/ocpp/v201/messages/PublishFirmware.hpp rename to include/ocpp/v2/messages/PublishFirmware.hpp index 71ef28ae8..7507e451d 100644 --- a/include/ocpp/v201/messages/PublishFirmware.hpp +++ b/include/ocpp/v2/messages/PublishFirmware.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_PUBLISHFIRMWARE_HPP -#define OCPP_V201_PUBLISHFIRMWARE_HPP +#ifndef OCPP_V2_PUBLISHFIRMWARE_HPP +#define OCPP_V2_PUBLISHFIRMWARE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP PublishFirmware message struct PublishFirmwareRequest : public ocpp::Message { @@ -60,7 +60,7 @@ void from_json(const json& j, PublishFirmwareResponse& k); /// \returns an output stream with the PublishFirmwareResponse written to std::ostream& operator<<(std::ostream& os, const PublishFirmwareResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_PUBLISHFIRMWARE_HPP +#endif // OCPP_V2_PUBLISHFIRMWARE_HPP diff --git a/include/ocpp/v201/messages/PublishFirmwareStatusNotification.hpp b/include/ocpp/v2/messages/PublishFirmwareStatusNotification.hpp similarity index 90% rename from include/ocpp/v201/messages/PublishFirmwareStatusNotification.hpp rename to include/ocpp/v2/messages/PublishFirmwareStatusNotification.hpp index 6ad6076fc..2c96b7674 100644 --- a/include/ocpp/v201/messages/PublishFirmwareStatusNotification.hpp +++ b/include/ocpp/v2/messages/PublishFirmwareStatusNotification.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_PUBLISHFIRMWARESTATUSNOTIFICATION_HPP -#define OCPP_V201_PUBLISHFIRMWARESTATUSNOTIFICATION_HPP +#ifndef OCPP_V2_PUBLISHFIRMWARESTATUSNOTIFICATION_HPP +#define OCPP_V2_PUBLISHFIRMWARESTATUSNOTIFICATION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP PublishFirmwareStatusNotification message struct PublishFirmwareStatusNotificationRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, PublishFirmwareStatusNotificationResponse& k); /// output stream \p os \returns an output stream with the PublishFirmwareStatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const PublishFirmwareStatusNotificationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_PUBLISHFIRMWARESTATUSNOTIFICATION_HPP +#endif // OCPP_V2_PUBLISHFIRMWARESTATUSNOTIFICATION_HPP diff --git a/include/ocpp/v201/messages/ReportChargingProfiles.hpp b/include/ocpp/v2/messages/ReportChargingProfiles.hpp similarity index 91% rename from include/ocpp/v201/messages/ReportChargingProfiles.hpp rename to include/ocpp/v2/messages/ReportChargingProfiles.hpp index 3993868a3..68614921e 100644 --- a/include/ocpp/v201/messages/ReportChargingProfiles.hpp +++ b/include/ocpp/v2/messages/ReportChargingProfiles.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_REPORTCHARGINGPROFILES_HPP -#define OCPP_V201_REPORTCHARGINGPROFILES_HPP +#ifndef OCPP_V2_REPORTCHARGINGPROFILES_HPP +#define OCPP_V2_REPORTCHARGINGPROFILES_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ReportChargingProfiles message struct ReportChargingProfilesRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, ReportChargingProfilesResponse& k); /// \p os \returns an output stream with the ReportChargingProfilesResponse written to std::ostream& operator<<(std::ostream& os, const ReportChargingProfilesResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_REPORTCHARGINGPROFILES_HPP +#endif // OCPP_V2_REPORTCHARGINGPROFILES_HPP diff --git a/include/ocpp/v201/messages/RequestStartTransaction.hpp b/include/ocpp/v2/messages/RequestStartTransaction.hpp similarity index 91% rename from include/ocpp/v201/messages/RequestStartTransaction.hpp rename to include/ocpp/v2/messages/RequestStartTransaction.hpp index 05501ac00..a0c690e18 100644 --- a/include/ocpp/v201/messages/RequestStartTransaction.hpp +++ b/include/ocpp/v2/messages/RequestStartTransaction.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_REQUESTSTARTTRANSACTION_HPP -#define OCPP_V201_REQUESTSTARTTRANSACTION_HPP +#ifndef OCPP_V2_REQUESTSTARTTRANSACTION_HPP +#define OCPP_V2_REQUESTSTARTTRANSACTION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP StartTransaction message struct RequestStartTransactionRequest : public ocpp::Message { @@ -61,7 +61,7 @@ void from_json(const json& j, RequestStartTransactionResponse& k); /// \p os \returns an output stream with the RequestStartTransactionResponse written to std::ostream& operator<<(std::ostream& os, const RequestStartTransactionResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_REQUESTSTARTTRANSACTION_HPP +#endif // OCPP_V2_REQUESTSTARTTRANSACTION_HPP diff --git a/include/ocpp/v201/messages/RequestStopTransaction.hpp b/include/ocpp/v2/messages/RequestStopTransaction.hpp similarity index 90% rename from include/ocpp/v201/messages/RequestStopTransaction.hpp rename to include/ocpp/v2/messages/RequestStopTransaction.hpp index 8361b2e68..5c783eba3 100644 --- a/include/ocpp/v201/messages/RequestStopTransaction.hpp +++ b/include/ocpp/v2/messages/RequestStopTransaction.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_REQUESTSTOPTRANSACTION_HPP -#define OCPP_V201_REQUESTSTOPTRANSACTION_HPP +#ifndef OCPP_V2_REQUESTSTOPTRANSACTION_HPP +#define OCPP_V2_REQUESTSTOPTRANSACTION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP StopTransaction message struct RequestStopTransactionRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, RequestStopTransactionResponse& k); /// \p os \returns an output stream with the RequestStopTransactionResponse written to std::ostream& operator<<(std::ostream& os, const RequestStopTransactionResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_REQUESTSTOPTRANSACTION_HPP +#endif // OCPP_V2_REQUESTSTOPTRANSACTION_HPP diff --git a/include/ocpp/v201/messages/ReservationStatusUpdate.hpp b/include/ocpp/v2/messages/ReservationStatusUpdate.hpp similarity index 90% rename from include/ocpp/v201/messages/ReservationStatusUpdate.hpp rename to include/ocpp/v2/messages/ReservationStatusUpdate.hpp index 5523d82af..2e2589377 100644 --- a/include/ocpp/v201/messages/ReservationStatusUpdate.hpp +++ b/include/ocpp/v2/messages/ReservationStatusUpdate.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_RESERVATIONSTATUSUPDATE_HPP -#define OCPP_V201_RESERVATIONSTATUSUPDATE_HPP +#ifndef OCPP_V2_RESERVATIONSTATUSUPDATE_HPP +#define OCPP_V2_RESERVATIONSTATUSUPDATE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ReservationStatusUpdate message struct ReservationStatusUpdateRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, ReservationStatusUpdateResponse& k); /// \p os \returns an output stream with the ReservationStatusUpdateResponse written to std::ostream& operator<<(std::ostream& os, const ReservationStatusUpdateResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_RESERVATIONSTATUSUPDATE_HPP +#endif // OCPP_V2_RESERVATIONSTATUSUPDATE_HPP diff --git a/include/ocpp/v201/messages/ReserveNow.hpp b/include/ocpp/v2/messages/ReserveNow.hpp similarity index 91% rename from include/ocpp/v201/messages/ReserveNow.hpp rename to include/ocpp/v2/messages/ReserveNow.hpp index acb262679..57d07e440 100644 --- a/include/ocpp/v201/messages/ReserveNow.hpp +++ b/include/ocpp/v2/messages/ReserveNow.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_RESERVENOW_HPP -#define OCPP_V201_RESERVENOW_HPP +#ifndef OCPP_V2_RESERVENOW_HPP +#define OCPP_V2_RESERVENOW_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP ReserveNow message struct ReserveNowRequest : public ocpp::Message { @@ -61,7 +61,7 @@ void from_json(const json& j, ReserveNowResponse& k); /// \returns an output stream with the ReserveNowResponse written to std::ostream& operator<<(std::ostream& os, const ReserveNowResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_RESERVENOW_HPP +#endif // OCPP_V2_RESERVENOW_HPP diff --git a/include/ocpp/v201/messages/Reset.hpp b/include/ocpp/v2/messages/Reset.hpp similarity index 91% rename from include/ocpp/v201/messages/Reset.hpp rename to include/ocpp/v2/messages/Reset.hpp index c3a58ae6f..fb90ea148 100644 --- a/include/ocpp/v201/messages/Reset.hpp +++ b/include/ocpp/v2/messages/Reset.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_RESET_HPP -#define OCPP_V201_RESET_HPP +#ifndef OCPP_V2_RESET_HPP +#define OCPP_V2_RESET_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP Reset message struct ResetRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, ResetResponse& k); /// \returns an output stream with the ResetResponse written to std::ostream& operator<<(std::ostream& os, const ResetResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_RESET_HPP +#endif // OCPP_V2_RESET_HPP diff --git a/include/ocpp/v201/messages/SecurityEventNotification.hpp b/include/ocpp/v2/messages/SecurityEventNotification.hpp similarity index 91% rename from include/ocpp/v201/messages/SecurityEventNotification.hpp rename to include/ocpp/v2/messages/SecurityEventNotification.hpp index ce04f5645..21bc4f7ea 100644 --- a/include/ocpp/v201/messages/SecurityEventNotification.hpp +++ b/include/ocpp/v2/messages/SecurityEventNotification.hpp @@ -2,17 +2,17 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SECURITYEVENTNOTIFICATION_HPP -#define OCPP_V201_SECURITYEVENTNOTIFICATION_HPP +#ifndef OCPP_V2_SECURITYEVENTNOTIFICATION_HPP +#define OCPP_V2_SECURITYEVENTNOTIFICATION_HPP #include #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SecurityEventNotification message struct SecurityEventNotificationRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, SecurityEventNotificationResponse& k); /// stream \p os \returns an output stream with the SecurityEventNotificationResponse written to std::ostream& operator<<(std::ostream& os, const SecurityEventNotificationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SECURITYEVENTNOTIFICATION_HPP +#endif // OCPP_V2_SECURITYEVENTNOTIFICATION_HPP diff --git a/include/ocpp/v201/messages/SendLocalList.hpp b/include/ocpp/v2/messages/SendLocalList.hpp similarity index 91% rename from include/ocpp/v201/messages/SendLocalList.hpp rename to include/ocpp/v2/messages/SendLocalList.hpp index da8b299d9..2e625da5b 100644 --- a/include/ocpp/v201/messages/SendLocalList.hpp +++ b/include/ocpp/v2/messages/SendLocalList.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SENDLOCALLIST_HPP -#define OCPP_V201_SENDLOCALLIST_HPP +#ifndef OCPP_V2_SENDLOCALLIST_HPP +#define OCPP_V2_SENDLOCALLIST_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SendLocalList message struct SendLocalListRequest : public ocpp::Message { @@ -58,7 +58,7 @@ void from_json(const json& j, SendLocalListResponse& k); /// \returns an output stream with the SendLocalListResponse written to std::ostream& operator<<(std::ostream& os, const SendLocalListResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SENDLOCALLIST_HPP +#endif // OCPP_V2_SENDLOCALLIST_HPP diff --git a/include/ocpp/v201/messages/SetChargingProfile.hpp b/include/ocpp/v2/messages/SetChargingProfile.hpp similarity index 91% rename from include/ocpp/v201/messages/SetChargingProfile.hpp rename to include/ocpp/v2/messages/SetChargingProfile.hpp index 6075b5716..1a20b9248 100644 --- a/include/ocpp/v201/messages/SetChargingProfile.hpp +++ b/include/ocpp/v2/messages/SetChargingProfile.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SETCHARGINGPROFILE_HPP -#define OCPP_V201_SETCHARGINGPROFILE_HPP +#ifndef OCPP_V2_SETCHARGINGPROFILE_HPP +#define OCPP_V2_SETCHARGINGPROFILE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SetChargingProfile message struct SetChargingProfileRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, SetChargingProfileResponse& k); /// os \returns an output stream with the SetChargingProfileResponse written to std::ostream& operator<<(std::ostream& os, const SetChargingProfileResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SETCHARGINGPROFILE_HPP +#endif // OCPP_V2_SETCHARGINGPROFILE_HPP diff --git a/include/ocpp/v201/messages/SetDisplayMessage.hpp b/include/ocpp/v2/messages/SetDisplayMessage.hpp similarity index 91% rename from include/ocpp/v201/messages/SetDisplayMessage.hpp rename to include/ocpp/v2/messages/SetDisplayMessage.hpp index 28218e3da..482a77456 100644 --- a/include/ocpp/v201/messages/SetDisplayMessage.hpp +++ b/include/ocpp/v2/messages/SetDisplayMessage.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SETDISPLAYMESSAGE_HPP -#define OCPP_V201_SETDISPLAYMESSAGE_HPP +#ifndef OCPP_V2_SETDISPLAYMESSAGE_HPP +#define OCPP_V2_SETDISPLAYMESSAGE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SetDisplayMessage message struct SetDisplayMessageRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, SetDisplayMessageResponse& k); /// \returns an output stream with the SetDisplayMessageResponse written to std::ostream& operator<<(std::ostream& os, const SetDisplayMessageResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SETDISPLAYMESSAGE_HPP +#endif // OCPP_V2_SETDISPLAYMESSAGE_HPP diff --git a/include/ocpp/v201/messages/SetMonitoringBase.hpp b/include/ocpp/v2/messages/SetMonitoringBase.hpp similarity index 91% rename from include/ocpp/v201/messages/SetMonitoringBase.hpp rename to include/ocpp/v2/messages/SetMonitoringBase.hpp index 3dfad877c..606721858 100644 --- a/include/ocpp/v201/messages/SetMonitoringBase.hpp +++ b/include/ocpp/v2/messages/SetMonitoringBase.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SETMONITORINGBASE_HPP -#define OCPP_V201_SETMONITORINGBASE_HPP +#ifndef OCPP_V2_SETMONITORINGBASE_HPP +#define OCPP_V2_SETMONITORINGBASE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SetMonitoringBase message struct SetMonitoringBaseRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, SetMonitoringBaseResponse& k); /// \returns an output stream with the SetMonitoringBaseResponse written to std::ostream& operator<<(std::ostream& os, const SetMonitoringBaseResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SETMONITORINGBASE_HPP +#endif // OCPP_V2_SETMONITORINGBASE_HPP diff --git a/include/ocpp/v201/messages/SetMonitoringLevel.hpp b/include/ocpp/v2/messages/SetMonitoringLevel.hpp similarity index 90% rename from include/ocpp/v201/messages/SetMonitoringLevel.hpp rename to include/ocpp/v2/messages/SetMonitoringLevel.hpp index efab74419..7630fdbc9 100644 --- a/include/ocpp/v201/messages/SetMonitoringLevel.hpp +++ b/include/ocpp/v2/messages/SetMonitoringLevel.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SETMONITORINGLEVEL_HPP -#define OCPP_V201_SETMONITORINGLEVEL_HPP +#ifndef OCPP_V2_SETMONITORINGLEVEL_HPP +#define OCPP_V2_SETMONITORINGLEVEL_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SetMonitoringLevel message struct SetMonitoringLevelRequest : public ocpp::Message { @@ -56,7 +56,7 @@ void from_json(const json& j, SetMonitoringLevelResponse& k); /// os \returns an output stream with the SetMonitoringLevelResponse written to std::ostream& operator<<(std::ostream& os, const SetMonitoringLevelResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SETMONITORINGLEVEL_HPP +#endif // OCPP_V2_SETMONITORINGLEVEL_HPP diff --git a/include/ocpp/v201/messages/SetNetworkProfile.hpp b/include/ocpp/v2/messages/SetNetworkProfile.hpp similarity index 91% rename from include/ocpp/v201/messages/SetNetworkProfile.hpp rename to include/ocpp/v2/messages/SetNetworkProfile.hpp index d144af439..e6e427949 100644 --- a/include/ocpp/v201/messages/SetNetworkProfile.hpp +++ b/include/ocpp/v2/messages/SetNetworkProfile.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SETNETWORKPROFILE_HPP -#define OCPP_V201_SETNETWORKPROFILE_HPP +#ifndef OCPP_V2_SETNETWORKPROFILE_HPP +#define OCPP_V2_SETNETWORKPROFILE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SetNetworkProfile message struct SetNetworkProfileRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, SetNetworkProfileResponse& k); /// \returns an output stream with the SetNetworkProfileResponse written to std::ostream& operator<<(std::ostream& os, const SetNetworkProfileResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SETNETWORKPROFILE_HPP +#endif // OCPP_V2_SETNETWORKPROFILE_HPP diff --git a/include/ocpp/v201/messages/SetVariableMonitoring.hpp b/include/ocpp/v2/messages/SetVariableMonitoring.hpp similarity index 90% rename from include/ocpp/v201/messages/SetVariableMonitoring.hpp rename to include/ocpp/v2/messages/SetVariableMonitoring.hpp index 5f91ec5a3..851d9dba2 100644 --- a/include/ocpp/v201/messages/SetVariableMonitoring.hpp +++ b/include/ocpp/v2/messages/SetVariableMonitoring.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SETVARIABLEMONITORING_HPP -#define OCPP_V201_SETVARIABLEMONITORING_HPP +#ifndef OCPP_V2_SETVARIABLEMONITORING_HPP +#define OCPP_V2_SETVARIABLEMONITORING_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SetVariableMonitoring message struct SetVariableMonitoringRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, SetVariableMonitoringResponse& k); /// \p os \returns an output stream with the SetVariableMonitoringResponse written to std::ostream& operator<<(std::ostream& os, const SetVariableMonitoringResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SETVARIABLEMONITORING_HPP +#endif // OCPP_V2_SETVARIABLEMONITORING_HPP diff --git a/include/ocpp/v201/messages/SetVariables.hpp b/include/ocpp/v2/messages/SetVariables.hpp similarity index 91% rename from include/ocpp/v201/messages/SetVariables.hpp rename to include/ocpp/v2/messages/SetVariables.hpp index 4af7db7df..5da708ece 100644 --- a/include/ocpp/v201/messages/SetVariables.hpp +++ b/include/ocpp/v2/messages/SetVariables.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SETVARIABLES_HPP -#define OCPP_V201_SETVARIABLES_HPP +#ifndef OCPP_V2_SETVARIABLES_HPP +#define OCPP_V2_SETVARIABLES_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SetVariables message struct SetVariablesRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, SetVariablesResponse& k); /// \returns an output stream with the SetVariablesResponse written to std::ostream& operator<<(std::ostream& os, const SetVariablesResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SETVARIABLES_HPP +#endif // OCPP_V2_SETVARIABLES_HPP diff --git a/include/ocpp/v201/messages/SignCertificate.hpp b/include/ocpp/v2/messages/SignCertificate.hpp similarity index 91% rename from include/ocpp/v201/messages/SignCertificate.hpp rename to include/ocpp/v2/messages/SignCertificate.hpp index 3f663ae57..88c8a3770 100644 --- a/include/ocpp/v201/messages/SignCertificate.hpp +++ b/include/ocpp/v2/messages/SignCertificate.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_SIGNCERTIFICATE_HPP -#define OCPP_V201_SIGNCERTIFICATE_HPP +#ifndef OCPP_V2_SIGNCERTIFICATE_HPP +#define OCPP_V2_SIGNCERTIFICATE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP SignCertificate message struct SignCertificateRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, SignCertificateResponse& k); /// \returns an output stream with the SignCertificateResponse written to std::ostream& operator<<(std::ostream& os, const SignCertificateResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_SIGNCERTIFICATE_HPP +#endif // OCPP_V2_SIGNCERTIFICATE_HPP diff --git a/include/ocpp/v201/messages/StatusNotification.hpp b/include/ocpp/v2/messages/StatusNotification.hpp similarity index 91% rename from include/ocpp/v201/messages/StatusNotification.hpp rename to include/ocpp/v2/messages/StatusNotification.hpp index e5b561081..c1e762156 100644 --- a/include/ocpp/v201/messages/StatusNotification.hpp +++ b/include/ocpp/v2/messages/StatusNotification.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_STATUSNOTIFICATION_HPP -#define OCPP_V201_STATUSNOTIFICATION_HPP +#ifndef OCPP_V2_STATUSNOTIFICATION_HPP +#define OCPP_V2_STATUSNOTIFICATION_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP StatusNotification message struct StatusNotificationRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, StatusNotificationResponse& k); /// os \returns an output stream with the StatusNotificationResponse written to std::ostream& operator<<(std::ostream& os, const StatusNotificationResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_STATUSNOTIFICATION_HPP +#endif // OCPP_V2_STATUSNOTIFICATION_HPP diff --git a/include/ocpp/v201/messages/TransactionEvent.hpp b/include/ocpp/v2/messages/TransactionEvent.hpp similarity index 92% rename from include/ocpp/v201/messages/TransactionEvent.hpp rename to include/ocpp/v2/messages/TransactionEvent.hpp index 2837f176f..1cdd80cc1 100644 --- a/include/ocpp/v201/messages/TransactionEvent.hpp +++ b/include/ocpp/v2/messages/TransactionEvent.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_TRANSACTIONEVENT_HPP -#define OCPP_V201_TRANSACTIONEVENT_HPP +#ifndef OCPP_V2_TRANSACTIONEVENT_HPP +#define OCPP_V2_TRANSACTIONEVENT_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP TransactionEvent message struct TransactionEventRequest : public ocpp::Message { @@ -69,7 +69,7 @@ void from_json(const json& j, TransactionEventResponse& k); /// \returns an output stream with the TransactionEventResponse written to std::ostream& operator<<(std::ostream& os, const TransactionEventResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_TRANSACTIONEVENT_HPP +#endif // OCPP_V2_TRANSACTIONEVENT_HPP diff --git a/include/ocpp/v201/messages/TriggerMessage.hpp b/include/ocpp/v2/messages/TriggerMessage.hpp similarity index 91% rename from include/ocpp/v201/messages/TriggerMessage.hpp rename to include/ocpp/v2/messages/TriggerMessage.hpp index d50e66989..f1312804c 100644 --- a/include/ocpp/v201/messages/TriggerMessage.hpp +++ b/include/ocpp/v2/messages/TriggerMessage.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_TRIGGERMESSAGE_HPP -#define OCPP_V201_TRIGGERMESSAGE_HPP +#ifndef OCPP_V2_TRIGGERMESSAGE_HPP +#define OCPP_V2_TRIGGERMESSAGE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP TriggerMessage message struct TriggerMessageRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, TriggerMessageResponse& k); /// \returns an output stream with the TriggerMessageResponse written to std::ostream& operator<<(std::ostream& os, const TriggerMessageResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_TRIGGERMESSAGE_HPP +#endif // OCPP_V2_TRIGGERMESSAGE_HPP diff --git a/include/ocpp/v201/messages/UnlockConnector.hpp b/include/ocpp/v2/messages/UnlockConnector.hpp similarity index 91% rename from include/ocpp/v201/messages/UnlockConnector.hpp rename to include/ocpp/v2/messages/UnlockConnector.hpp index d3bc48f14..205bca67c 100644 --- a/include/ocpp/v201/messages/UnlockConnector.hpp +++ b/include/ocpp/v2/messages/UnlockConnector.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_UNLOCKCONNECTOR_HPP -#define OCPP_V201_UNLOCKCONNECTOR_HPP +#ifndef OCPP_V2_UNLOCKCONNECTOR_HPP +#define OCPP_V2_UNLOCKCONNECTOR_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP UnlockConnector message struct UnlockConnectorRequest : public ocpp::Message { @@ -57,7 +57,7 @@ void from_json(const json& j, UnlockConnectorResponse& k); /// \returns an output stream with the UnlockConnectorResponse written to std::ostream& operator<<(std::ostream& os, const UnlockConnectorResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_UNLOCKCONNECTOR_HPP +#endif // OCPP_V2_UNLOCKCONNECTOR_HPP diff --git a/include/ocpp/v201/messages/UnpublishFirmware.hpp b/include/ocpp/v2/messages/UnpublishFirmware.hpp similarity index 90% rename from include/ocpp/v201/messages/UnpublishFirmware.hpp rename to include/ocpp/v2/messages/UnpublishFirmware.hpp index b6fbd6e2f..5eadb73c7 100644 --- a/include/ocpp/v201/messages/UnpublishFirmware.hpp +++ b/include/ocpp/v2/messages/UnpublishFirmware.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_UNPUBLISHFIRMWARE_HPP -#define OCPP_V201_UNPUBLISHFIRMWARE_HPP +#ifndef OCPP_V2_UNPUBLISHFIRMWARE_HPP +#define OCPP_V2_UNPUBLISHFIRMWARE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP UnpublishFirmware message struct UnpublishFirmwareRequest : public ocpp::Message { @@ -55,7 +55,7 @@ void from_json(const json& j, UnpublishFirmwareResponse& k); /// \returns an output stream with the UnpublishFirmwareResponse written to std::ostream& operator<<(std::ostream& os, const UnpublishFirmwareResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_UNPUBLISHFIRMWARE_HPP +#endif // OCPP_V2_UNPUBLISHFIRMWARE_HPP diff --git a/include/ocpp/v201/messages/UpdateFirmware.hpp b/include/ocpp/v2/messages/UpdateFirmware.hpp similarity index 91% rename from include/ocpp/v201/messages/UpdateFirmware.hpp rename to include/ocpp/v2/messages/UpdateFirmware.hpp index 6e8547950..a73accacb 100644 --- a/include/ocpp/v201/messages/UpdateFirmware.hpp +++ b/include/ocpp/v2/messages/UpdateFirmware.hpp @@ -2,18 +2,18 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_UPDATEFIRMWARE_HPP -#define OCPP_V201_UPDATEFIRMWARE_HPP +#ifndef OCPP_V2_UPDATEFIRMWARE_HPP +#define OCPP_V2_UPDATEFIRMWARE_HPP #include #include #include -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains a OCPP UpdateFirmware message struct UpdateFirmwareRequest : public ocpp::Message { @@ -59,7 +59,7 @@ void from_json(const json& j, UpdateFirmwareResponse& k); /// \returns an output stream with the UpdateFirmwareResponse written to std::ostream& operator<<(std::ostream& os, const UpdateFirmwareResponse& k); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_UPDATEFIRMWARE_HPP +#endif // OCPP_V2_UPDATEFIRMWARE_HPP diff --git a/include/ocpp/v201/monitoring_updater.hpp b/include/ocpp/v2/monitoring_updater.hpp similarity index 97% rename from include/ocpp/v201/monitoring_updater.hpp rename to include/ocpp/v2/monitoring_updater.hpp index 7348bf884..5dc9ef426 100644 --- a/include/ocpp/v201/monitoring_updater.hpp +++ b/include/ocpp/v2/monitoring_updater.hpp @@ -7,13 +7,13 @@ #include -#include -#include -#include +#include +#include +#include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DeviceModel; @@ -186,4 +186,4 @@ class MonitoringUpdater { std::unordered_map updater_monitors_meta; }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/include/ocpp/v201/notify_report_requests_splitter.hpp b/include/ocpp/v2/notify_report_requests_splitter.hpp similarity index 81% rename from include/ocpp/v201/notify_report_requests_splitter.hpp rename to include/ocpp/v2/notify_report_requests_splitter.hpp index ccfd7aa2d..68c7122fd 100644 --- a/include/ocpp/v201/notify_report_requests_splitter.hpp +++ b/include/ocpp/v2/notify_report_requests_splitter.hpp @@ -5,11 +5,11 @@ #define OCPP_NOTIFY_REPORT_REQUESTS_SPLITTER_HPP #include "ocpp/common/call_types.hpp" -#include "ocpp/v201/messages/NotifyReport.hpp" -#include "ocpp/v201/types.hpp" +#include "ocpp/v2/messages/NotifyReport.hpp" +#include "ocpp/v2/types.hpp" namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Utility class that is used to split NotifyReportRequest into several ones in case ReportData is too big. class NotifyReportRequestsSplitter { @@ -39,18 +39,17 @@ class NotifyReportRequestsSplitter { size_t create_request_template_json_and_return_skeleton_size(); // Create next call payload (with as many reportData items as possible) - json create_next_payload(const int& seq_no, - std::vector::const_iterator& report_data_iterator, - const std::vector::const_iterator& report_data_end, + json create_next_payload(const int& seq_no, std::vector::const_iterator& report_data_iterator, + const std::vector::const_iterator& report_data_end, const std::string& message_id); // Create next request payload (with as many reportData items as possible) to be contained in next call payload - static json create_next_report_data_json(std::vector::const_iterator& report_data_iterator, - const std::vector::const_iterator& report_data_end, + static json create_next_report_data_json(std::vector::const_iterator& report_data_iterator, + const std::vector::const_iterator& report_data_end, const size_t& remaining_size); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp #endif // OCPP_NOTIFY_REPORT_REQUESTS_SPLITTER_HPP diff --git a/include/ocpp/v201/ocpp_enums.hpp b/include/ocpp/v2/ocpp_enums.hpp similarity index 99% rename from include/ocpp/v201/ocpp_enums.hpp rename to include/ocpp/v2/ocpp_enums.hpp index 8f91b0a83..bd8344e84 100644 --- a/include/ocpp/v201/ocpp_enums.hpp +++ b/include/ocpp/v2/ocpp_enums.hpp @@ -2,14 +2,14 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_OCPP_ENUMS_HPP -#define OCPP_V201_OCPP_ENUMS_HPP +#ifndef OCPP_V2_OCPP_ENUMS_HPP +#define OCPP_V2_OCPP_ENUMS_HPP #include #include namespace ocpp { -namespace v201 { +namespace v2 { // from: AuthorizeRequest enum class IdTokenEnum { @@ -2036,7 +2036,7 @@ UpdateFirmwareStatusEnum string_to_update_firmware_status_enum(const std::string /// given output stream \p os \returns an output stream with the UpdateFirmwareStatusEnum written to std::ostream& operator<<(std::ostream& os, const UpdateFirmwareStatusEnum& update_firmware_status_enum); -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_OCPP_ENUMS_HPP +#endif // OCPP_V2_OCPP_ENUMS_HPP diff --git a/include/ocpp/v201/ocpp_types.hpp b/include/ocpp/v2/ocpp_types.hpp similarity index 99% rename from include/ocpp/v201/ocpp_types.hpp rename to include/ocpp/v2/ocpp_types.hpp index 0676cb74a..43f392fc9 100644 --- a/include/ocpp/v201/ocpp_types.hpp +++ b/include/ocpp/v2/ocpp_types.hpp @@ -2,8 +2,8 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#ifndef OCPP_V201_OCPP_TYPES_HPP -#define OCPP_V201_OCPP_TYPES_HPP +#ifndef OCPP_V2_OCPP_TYPES_HPP +#define OCPP_V2_OCPP_TYPES_HPP #include @@ -11,10 +11,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { using CustomData = nlohmann::json; @@ -967,7 +967,7 @@ void from_json(const json& j, Firmware& k); std::ostream& operator<<(std::ostream& os, const Firmware& k); struct RequiredComponentVariable : ComponentVariable {}; -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_OCPP_TYPES_HPP +#endif // OCPP_V2_OCPP_TYPES_HPP diff --git a/include/ocpp/v201/ocsp_updater.hpp b/include/ocpp/v2/ocsp_updater.hpp similarity index 96% rename from include/ocpp/v201/ocsp_updater.hpp rename to include/ocpp/v2/ocsp_updater.hpp index 335a3d113..0249eb6c0 100644 --- a/include/ocpp/v201/ocsp_updater.hpp +++ b/include/ocpp/v2/ocsp_updater.hpp @@ -12,9 +12,9 @@ #include #include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class OcspUpdateFailedException : public std::exception { public: @@ -96,6 +96,6 @@ class OcspUpdater : public OcspUpdaterInterface { void execute_ocsp_update(); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 #endif // OCPP_OCSP_UPDATER_HPP diff --git a/include/ocpp/v201/profile.hpp b/include/ocpp/v2/profile.hpp similarity index 99% rename from include/ocpp/v201/profile.hpp rename to include/ocpp/v2/profile.hpp index 57c5ffdda..8b241cab2 100644 --- a/include/ocpp/v201/profile.hpp +++ b/include/ocpp/v2/profile.hpp @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { struct IntermediatePeriod { int32_t startPeriod; @@ -131,5 +131,5 @@ std::vector convert_intermediate_into_schedule(const IntermediateProfile& profile, ChargingRateUnitEnum charging_rate_unit, float default_limit, int32_t default_number_phases, float supply_voltage); -} // namespace v201 +} // namespace v2 } // namespace ocpp \ No newline at end of file diff --git a/include/ocpp/v201/transaction.hpp b/include/ocpp/v2/transaction.hpp similarity index 88% rename from include/ocpp/v201/transaction.hpp rename to include/ocpp/v2/transaction.hpp index 8ed57b172..05b0f50e3 100644 --- a/include/ocpp/v201/transaction.hpp +++ b/include/ocpp/v2/transaction.hpp @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest -#ifndef OCPP_V201_TRANSACTION_HANDLER_HPP -#define OCPP_V201_TRANSACTION_HANDLER_HPP +#ifndef OCPP_V2_TRANSACTION_HANDLER_HPP +#define OCPP_V2_TRANSACTION_HANDLER_HPP #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { class DatabaseHandler; @@ -47,8 +47,8 @@ struct EnhancedTransaction : public Transaction { DatabaseHandler& database_handler; bool database_enabled; }; -} // namespace v201 +} // namespace v2 } // namespace ocpp -#endif // OCPP_V201_TRANSACTION_HANDLER_HPP +#endif // OCPP_V2_TRANSACTION_HANDLER_HPP diff --git a/include/ocpp/v201/types.hpp b/include/ocpp/v2/types.hpp similarity index 97% rename from include/ocpp/v201/types.hpp rename to include/ocpp/v2/types.hpp index 75d1f67a5..854c45c0d 100644 --- a/include/ocpp/v201/types.hpp +++ b/include/ocpp/v2/types.hpp @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest -#ifndef V201_TYPES_HPP -#define V201_TYPES_HPP +#ifndef V2_TYPES_HPP +#define V2_TYPES_HPP -#include +#include #include #include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Contains all supported OCPP 2.0.1 message types enum class MessageType { @@ -172,7 +172,7 @@ MessageType string_to_messagetype(const std::string& s); /// \returns an output stream with the MessageType written to std::ostream& operator<<(std::ostream& os, const MessageType& message_type); -} // namespace v201 +} // namespace v2 } // namespace ocpp #endif diff --git a/include/ocpp/v201/utils.hpp b/include/ocpp/v2/utils.hpp similarity index 96% rename from include/ocpp/v201/utils.hpp rename to include/ocpp/v2/utils.hpp index 73f07160b..5281c3e18 100644 --- a/include/ocpp/v201/utils.hpp +++ b/include/ocpp/v2/utils.hpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#ifndef V201_UTILS_HPP -#define V201_UTILS_HPP +#ifndef V2_UTILS_HPP +#define V2_UTILS_HPP -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { namespace utils { /// \brief This function returns the configured Measurand as an std::vector @@ -75,7 +75,7 @@ bool is_critical(const std::string& security_event); std::vector get_purposes_to_ignore(const std::string& csl, const bool is_offline); } // namespace utils -} // namespace v201 +} // namespace v2 } // namespace ocpp #endif diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4306ecfeb..a30d2006e 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -12,8 +12,8 @@ target_compile_options(ocpp target_compile_definitions(ocpp PRIVATE MIGRATION_FILE_VERSION_V16=${MIGRATION_FILE_VERSION_V16} - MIGRATION_FILE_VERSION_V201=${MIGRATION_FILE_VERSION_V201} - MIGRATION_DEVICE_MODEL_FILE_VERSION_V201=${MIGRATION_DEVICE_MODEL_FILE_VERSION_V201} + MIGRATION_FILE_VERSION_V2=${MIGRATION_FILE_VERSION_V2} + MIGRATION_DEVICE_MODEL_FILE_VERSION_V2=${MIGRATION_DEVICE_MODEL_FILE_VERSION_V2} ) target_sources(ocpp @@ -49,66 +49,66 @@ if(LIBOCPP_ENABLE_V16) ocpp/v16/ocpp_types.cpp ocpp/v16/types.cpp ocpp/v16/utils.cpp - ocpp/v201/messages/InstallCertificate.cpp - ocpp/v201/messages/CertificateSigned.cpp - ocpp/v201/messages/Authorize.cpp - ocpp/v201/messages/GetCertificateStatus.cpp - ocpp/v201/messages/Get15118EVCertificate.cpp - ocpp/v201/messages/DeleteCertificate.cpp - ocpp/v201/messages/TriggerMessage.cpp - ocpp/v201/ocpp_enums.cpp - ocpp/v201/ocpp_types.cpp - ocpp/v201/types.cpp - ocpp/v201/messages/SignCertificate.cpp - ocpp/v201/messages/GetInstalledCertificateIds.cpp + ocpp/v2/messages/InstallCertificate.cpp + ocpp/v2/messages/CertificateSigned.cpp + ocpp/v2/messages/Authorize.cpp + ocpp/v2/messages/GetCertificateStatus.cpp + ocpp/v2/messages/Get15118EVCertificate.cpp + ocpp/v2/messages/DeleteCertificate.cpp + ocpp/v2/messages/TriggerMessage.cpp + ocpp/v2/ocpp_enums.cpp + ocpp/v2/ocpp_types.cpp + ocpp/v2/types.cpp + ocpp/v2/messages/SignCertificate.cpp + ocpp/v2/messages/GetInstalledCertificateIds.cpp ) add_subdirectory(ocpp/v16/messages) endif() -if(LIBOCPP_ENABLE_V201) +if(LIBOCPP_ENABLE_V2) target_sources(ocpp PRIVATE - ocpp/v201/average_meter_values.cpp - ocpp/v201/charge_point.cpp - ocpp/v201/charge_point_callbacks.cpp - ocpp/v201/connector.cpp - ocpp/v201/ctrlr_component_variables.cpp - ocpp/v201/database_handler.cpp - ocpp/v201/device_model.cpp - ocpp/v201/device_model_storage_sqlite.cpp - ocpp/v201/enums.cpp - ocpp/v201/evse.cpp - ocpp/v201/evse_manager.cpp - ocpp/v201/init_device_model_db.cpp - ocpp/v201/notify_report_requests_splitter.cpp - ocpp/v201/message_queue.cpp - ocpp/v201/ocpp_enums.cpp - ocpp/v201/profile.cpp - ocpp/v201/ocpp_types.cpp - ocpp/v201/ocsp_updater.cpp - ocpp/v201/monitoring_updater.cpp - ocpp/v201/transaction.cpp - ocpp/v201/types.cpp - ocpp/v201/utils.cpp - ocpp/v201/component_state_manager.cpp - ocpp/v201/connectivity_manager.cpp - ocpp/v201/message_dispatcher.cpp - ocpp/v201/functional_blocks/authorization.cpp - ocpp/v201/functional_blocks/availability.cpp - ocpp/v201/functional_blocks/security.cpp - ocpp/v201/functional_blocks/smart_charging.cpp - ocpp/v201/functional_blocks/data_transfer.cpp - ocpp/v201/functional_blocks/firmware_update.cpp - ocpp/v201/functional_blocks/reservation.cpp - ocpp/v201/functional_blocks/diagnostics.cpp - ocpp/v201/functional_blocks/display_message.cpp - ocpp/v201/functional_blocks/meter_values.cpp - ocpp/v201/functional_blocks/provisioning.cpp - ocpp/v201/functional_blocks/remote_transaction_control.cpp - ocpp/v201/functional_blocks/tariff_and_cost.cpp - ocpp/v201/functional_blocks/transaction.cpp + ocpp/v2/average_meter_values.cpp + ocpp/v2/charge_point.cpp + ocpp/v2/charge_point_callbacks.cpp + ocpp/v2/connector.cpp + ocpp/v2/ctrlr_component_variables.cpp + ocpp/v2/database_handler.cpp + ocpp/v2/device_model.cpp + ocpp/v2/device_model_storage_sqlite.cpp + ocpp/v2/enums.cpp + ocpp/v2/evse.cpp + ocpp/v2/evse_manager.cpp + ocpp/v2/init_device_model_db.cpp + ocpp/v2/notify_report_requests_splitter.cpp + ocpp/v2/message_queue.cpp + ocpp/v2/ocpp_enums.cpp + ocpp/v2/profile.cpp + ocpp/v2/ocpp_types.cpp + ocpp/v2/ocsp_updater.cpp + ocpp/v2/monitoring_updater.cpp + ocpp/v2/transaction.cpp + ocpp/v2/types.cpp + ocpp/v2/utils.cpp + ocpp/v2/component_state_manager.cpp + ocpp/v2/connectivity_manager.cpp + ocpp/v2/message_dispatcher.cpp + ocpp/v2/functional_blocks/authorization.cpp + ocpp/v2/functional_blocks/availability.cpp + ocpp/v2/functional_blocks/security.cpp + ocpp/v2/functional_blocks/smart_charging.cpp + ocpp/v2/functional_blocks/data_transfer.cpp + ocpp/v2/functional_blocks/firmware_update.cpp + ocpp/v2/functional_blocks/reservation.cpp + ocpp/v2/functional_blocks/diagnostics.cpp + ocpp/v2/functional_blocks/display_message.cpp + ocpp/v2/functional_blocks/meter_values.cpp + ocpp/v2/functional_blocks/provisioning.cpp + ocpp/v2/functional_blocks/remote_transaction_control.cpp + ocpp/v2/functional_blocks/tariff_and_cost.cpp + ocpp/v2/functional_blocks/transaction.cpp ) - add_subdirectory(ocpp/v201/messages) + add_subdirectory(ocpp/v2/messages) endif() add_subdirectory(ocpp/common/websocket) diff --git a/lib/ocpp/common/evse_security.cpp b/lib/ocpp/common/evse_security.cpp index 1e82713a9..a77df7bb7 100644 --- a/lib/ocpp/common/evse_security.cpp +++ b/lib/ocpp/common/evse_security.cpp @@ -7,213 +7,213 @@ namespace ocpp { namespace evse_security_conversions { -ocpp::v201::GetCertificateIdUseEnum to_ocpp_v201(ocpp::CertificateType other) { +ocpp::v2::GetCertificateIdUseEnum to_ocpp_v2(ocpp::CertificateType other) { switch (other) { case ocpp::CertificateType::V2GRootCertificate: - return ocpp::v201::GetCertificateIdUseEnum::V2GRootCertificate; + return ocpp::v2::GetCertificateIdUseEnum::V2GRootCertificate; case ocpp::CertificateType::MORootCertificate: - return ocpp::v201::GetCertificateIdUseEnum::MORootCertificate; + return ocpp::v2::GetCertificateIdUseEnum::MORootCertificate; case ocpp::CertificateType::CSMSRootCertificate: - return ocpp::v201::GetCertificateIdUseEnum::CSMSRootCertificate; + return ocpp::v2::GetCertificateIdUseEnum::CSMSRootCertificate; case ocpp::CertificateType::V2GCertificateChain: - return ocpp::v201::GetCertificateIdUseEnum::V2GCertificateChain; + return ocpp::v2::GetCertificateIdUseEnum::V2GCertificateChain; case ocpp::CertificateType::MFRootCertificate: - return ocpp::v201::GetCertificateIdUseEnum::ManufacturerRootCertificate; + return ocpp::v2::GetCertificateIdUseEnum::ManufacturerRootCertificate; default: throw std::runtime_error("Could not convert CertificateType to GetCertificateIdUseEnum"); } } -ocpp::v201::InstallCertificateUseEnum to_ocpp_v201(ocpp::CaCertificateType other) { +ocpp::v2::InstallCertificateUseEnum to_ocpp_v2(ocpp::CaCertificateType other) { switch (other) { case ocpp::CaCertificateType::V2G: - return ocpp::v201::InstallCertificateUseEnum::V2GRootCertificate; + return ocpp::v2::InstallCertificateUseEnum::V2GRootCertificate; case ocpp::CaCertificateType::MO: - return ocpp::v201::InstallCertificateUseEnum::MORootCertificate; + return ocpp::v2::InstallCertificateUseEnum::MORootCertificate; case ocpp::CaCertificateType::CSMS: - return ocpp::v201::InstallCertificateUseEnum::CSMSRootCertificate; + return ocpp::v2::InstallCertificateUseEnum::CSMSRootCertificate; case ocpp::CaCertificateType::MF: - return ocpp::v201::InstallCertificateUseEnum::ManufacturerRootCertificate; + return ocpp::v2::InstallCertificateUseEnum::ManufacturerRootCertificate; default: throw std::runtime_error("Could not convert CaCertificateType to InstallCertificateUseEnum"); } } -ocpp::v201::CertificateSigningUseEnum to_ocpp_v201(ocpp::CertificateSigningUseEnum other) { +ocpp::v2::CertificateSigningUseEnum to_ocpp_v2(ocpp::CertificateSigningUseEnum other) { switch (other) { case ocpp::CertificateSigningUseEnum::ChargingStationCertificate: - return ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate; + return ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate; case ocpp::CertificateSigningUseEnum::V2GCertificate: - return ocpp::v201::CertificateSigningUseEnum::V2GCertificate; + return ocpp::v2::CertificateSigningUseEnum::V2GCertificate; default: throw std::runtime_error("Could not convert CertificateSigningUseEnum to CertificateSigningUseEnum"); } } -ocpp::v201::HashAlgorithmEnum to_ocpp_v201(ocpp::HashAlgorithmEnumType other) { +ocpp::v2::HashAlgorithmEnum to_ocpp_v2(ocpp::HashAlgorithmEnumType other) { switch (other) { case ocpp::HashAlgorithmEnumType::SHA256: - return ocpp::v201::HashAlgorithmEnum::SHA256; + return ocpp::v2::HashAlgorithmEnum::SHA256; case ocpp::HashAlgorithmEnumType::SHA384: - return ocpp::v201::HashAlgorithmEnum::SHA384; + return ocpp::v2::HashAlgorithmEnum::SHA384; case ocpp::HashAlgorithmEnumType::SHA512: - return ocpp::v201::HashAlgorithmEnum::SHA512; + return ocpp::v2::HashAlgorithmEnum::SHA512; default: throw std::runtime_error("Could not convert HashAlgorithmEnumType to HashAlgorithmEnum"); } } -ocpp::v201::InstallCertificateStatusEnum to_ocpp_v201(ocpp::InstallCertificateResult other) { +ocpp::v2::InstallCertificateStatusEnum to_ocpp_v2(ocpp::InstallCertificateResult other) { switch (other) { case ocpp::InstallCertificateResult::InvalidSignature: - return ocpp::v201::InstallCertificateStatusEnum::Rejected; + return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::InvalidCertificateChain: - return ocpp::v201::InstallCertificateStatusEnum::Rejected; + return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::InvalidFormat: - return ocpp::v201::InstallCertificateStatusEnum::Rejected; + return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::InvalidCommonName: - return ocpp::v201::InstallCertificateStatusEnum::Rejected; + return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::NoRootCertificateInstalled: - return ocpp::v201::InstallCertificateStatusEnum::Rejected; + return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::Expired: - return ocpp::v201::InstallCertificateStatusEnum::Rejected; + return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::CertificateStoreMaxLengthExceeded: - return ocpp::v201::InstallCertificateStatusEnum::Rejected; + return ocpp::v2::InstallCertificateStatusEnum::Rejected; case ocpp::InstallCertificateResult::WriteError: - return ocpp::v201::InstallCertificateStatusEnum::Failed; + return ocpp::v2::InstallCertificateStatusEnum::Failed; case ocpp::InstallCertificateResult::Accepted: - return ocpp::v201::InstallCertificateStatusEnum::Accepted; + return ocpp::v2::InstallCertificateStatusEnum::Accepted; default: throw std::runtime_error("Could not convert InstallCertificateResult to InstallCertificateStatusEnum"); } } -ocpp::v201::DeleteCertificateStatusEnum to_ocpp_v201(ocpp::DeleteCertificateResult other) { +ocpp::v2::DeleteCertificateStatusEnum to_ocpp_v2(ocpp::DeleteCertificateResult other) { switch (other) { case ocpp::DeleteCertificateResult::Accepted: - return ocpp::v201::DeleteCertificateStatusEnum ::Accepted; + return ocpp::v2::DeleteCertificateStatusEnum ::Accepted; case ocpp::DeleteCertificateResult::Failed: - return ocpp::v201::DeleteCertificateStatusEnum ::Failed; + return ocpp::v2::DeleteCertificateStatusEnum ::Failed; case ocpp::DeleteCertificateResult::NotFound: - return ocpp::v201::DeleteCertificateStatusEnum ::NotFound; + return ocpp::v2::DeleteCertificateStatusEnum ::NotFound; default: throw std::runtime_error("Could not convert DeleteCertificateResult to DeleteCertificateResult"); } } -ocpp::v201::CertificateHashDataType to_ocpp_v201(ocpp::CertificateHashDataType other) { - ocpp::v201::CertificateHashDataType lhs; - lhs.hashAlgorithm = to_ocpp_v201(other.hashAlgorithm); +ocpp::v2::CertificateHashDataType to_ocpp_v2(ocpp::CertificateHashDataType other) { + ocpp::v2::CertificateHashDataType lhs; + lhs.hashAlgorithm = to_ocpp_v2(other.hashAlgorithm); lhs.issuerNameHash = other.issuerNameHash; lhs.issuerKeyHash = other.issuerKeyHash; lhs.serialNumber = other.serialNumber; return lhs; } -ocpp::v201::CertificateHashDataChain to_ocpp_v201(ocpp::CertificateHashDataChain other) { - ocpp::v201::CertificateHashDataChain lhs; - lhs.certificateType = to_ocpp_v201(other.certificateType); - lhs.certificateHashData = to_ocpp_v201(other.certificateHashData); +ocpp::v2::CertificateHashDataChain to_ocpp_v2(ocpp::CertificateHashDataChain other) { + ocpp::v2::CertificateHashDataChain lhs; + lhs.certificateType = to_ocpp_v2(other.certificateType); + lhs.certificateHashData = to_ocpp_v2(other.certificateHashData); if (other.childCertificateHashData.has_value() && !other.childCertificateHashData.value().empty()) { - std::vector v; + std::vector v; for (const auto& certificate_hash_data : other.childCertificateHashData.value()) { - v.push_back(to_ocpp_v201(certificate_hash_data)); + v.push_back(to_ocpp_v2(certificate_hash_data)); } lhs.childCertificateHashData = v; } return lhs; } -ocpp::v201::OCSPRequestData to_ocpp_v201(ocpp::OCSPRequestData other) { - ocpp::v201::OCSPRequestData lhs; +ocpp::v2::OCSPRequestData to_ocpp_v2(ocpp::OCSPRequestData other) { + ocpp::v2::OCSPRequestData lhs; lhs.issuerNameHash = other.issuerNameHash; lhs.issuerKeyHash = other.issuerKeyHash; lhs.serialNumber = other.serialNumber; lhs.responderURL = other.responderUrl; - lhs.hashAlgorithm = to_ocpp_v201(other.hashAlgorithm); + lhs.hashAlgorithm = to_ocpp_v2(other.hashAlgorithm); return lhs; } -std::vector to_ocpp_v201(const std::vector& ocsp_request_data) { - std::vector ocsp_request_data_list; +std::vector to_ocpp_v2(const std::vector& ocsp_request_data) { + std::vector ocsp_request_data_list; for (const auto& ocsp_data : ocsp_request_data) { - ocpp::v201::OCSPRequestData request = to_ocpp_v201(ocsp_data); + ocpp::v2::OCSPRequestData request = to_ocpp_v2(ocsp_data); ocsp_request_data_list.push_back(request); } return ocsp_request_data_list; } -ocpp::CertificateType from_ocpp_v201(ocpp::v201::GetCertificateIdUseEnum other) { +ocpp::CertificateType from_ocpp_v2(ocpp::v2::GetCertificateIdUseEnum other) { switch (other) { - case ocpp::v201::GetCertificateIdUseEnum::V2GRootCertificate: + case ocpp::v2::GetCertificateIdUseEnum::V2GRootCertificate: return ocpp::CertificateType::V2GRootCertificate; - case ocpp::v201::GetCertificateIdUseEnum::V2GCertificateChain: + case ocpp::v2::GetCertificateIdUseEnum::V2GCertificateChain: return ocpp::CertificateType::V2GCertificateChain; - case ocpp::v201::GetCertificateIdUseEnum::MORootCertificate: + case ocpp::v2::GetCertificateIdUseEnum::MORootCertificate: return ocpp::CertificateType::MORootCertificate; - case ocpp::v201::GetCertificateIdUseEnum::CSMSRootCertificate: + case ocpp::v2::GetCertificateIdUseEnum::CSMSRootCertificate: return ocpp::CertificateType::CSMSRootCertificate; - case ocpp::v201::GetCertificateIdUseEnum::ManufacturerRootCertificate: + case ocpp::v2::GetCertificateIdUseEnum::ManufacturerRootCertificate: return ocpp::CertificateType::MFRootCertificate; default: throw std::runtime_error("Could not convert GetCertificateIdUseEnum to CertificateType"); } } -std::vector from_ocpp_v201(const std::vector& other) { +std::vector from_ocpp_v2(const std::vector& other) { std::vector certificate_types; for (const auto& certificate_id_use_enum : other) { - certificate_types.push_back(from_ocpp_v201(certificate_id_use_enum)); + certificate_types.push_back(from_ocpp_v2(certificate_id_use_enum)); } return certificate_types; } -ocpp::CaCertificateType from_ocpp_v201(ocpp::v201::InstallCertificateUseEnum other) { +ocpp::CaCertificateType from_ocpp_v2(ocpp::v2::InstallCertificateUseEnum other) { switch (other) { - case ocpp::v201::InstallCertificateUseEnum::V2GRootCertificate: + case ocpp::v2::InstallCertificateUseEnum::V2GRootCertificate: return ocpp::CaCertificateType::V2G; - case ocpp::v201::InstallCertificateUseEnum::MORootCertificate: + case ocpp::v2::InstallCertificateUseEnum::MORootCertificate: return ocpp::CaCertificateType::MO; - case ocpp::v201::InstallCertificateUseEnum::CSMSRootCertificate: + case ocpp::v2::InstallCertificateUseEnum::CSMSRootCertificate: return ocpp::CaCertificateType::CSMS; - case ocpp::v201::InstallCertificateUseEnum::ManufacturerRootCertificate: + case ocpp::v2::InstallCertificateUseEnum::ManufacturerRootCertificate: return ocpp::CaCertificateType::MF; default: throw std::runtime_error("Could not convert CaCertificateType to InstallCertificateUseEnum"); } } -ocpp::CertificateSigningUseEnum from_ocpp_v201(ocpp::v201::CertificateSigningUseEnum other) { +ocpp::CertificateSigningUseEnum from_ocpp_v2(ocpp::v2::CertificateSigningUseEnum other) { switch (other) { - case ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate: + case ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate: return ocpp::CertificateSigningUseEnum::ChargingStationCertificate; - case ocpp::v201::CertificateSigningUseEnum::V2GCertificate: + case ocpp::v2::CertificateSigningUseEnum::V2GCertificate: return ocpp::CertificateSigningUseEnum::V2GCertificate; default: throw std::runtime_error("Could not convert CertificateSigningUseEnum to CertificateSigningUseEnum"); } } -ocpp::HashAlgorithmEnumType from_ocpp_v201(ocpp::v201::HashAlgorithmEnum other) { +ocpp::HashAlgorithmEnumType from_ocpp_v2(ocpp::v2::HashAlgorithmEnum other) { switch (other) { - case ocpp::v201::HashAlgorithmEnum::SHA256: + case ocpp::v2::HashAlgorithmEnum::SHA256: return ocpp::HashAlgorithmEnumType::SHA256; - case ocpp::v201::HashAlgorithmEnum::SHA384: + case ocpp::v2::HashAlgorithmEnum::SHA384: return ocpp::HashAlgorithmEnumType::SHA384; - case ocpp::v201::HashAlgorithmEnum::SHA512: + case ocpp::v2::HashAlgorithmEnum::SHA512: return ocpp::HashAlgorithmEnumType::SHA512; default: throw std::runtime_error("Could not convert HashAlgorithmEnum to HashAlgorithmEnumType"); } } -ocpp::InstallCertificateResult from_ocpp_v201(ocpp::v201::InstallCertificateStatusEnum other) { +ocpp::InstallCertificateResult from_ocpp_v2(ocpp::v2::InstallCertificateStatusEnum other) { switch (other) { - case ocpp::v201::InstallCertificateStatusEnum::Rejected: + case ocpp::v2::InstallCertificateStatusEnum::Rejected: return ocpp::InstallCertificateResult::InvalidCertificateChain; - case ocpp::v201::InstallCertificateStatusEnum::Failed: + case ocpp::v2::InstallCertificateStatusEnum::Failed: return ocpp::InstallCertificateResult::WriteError; - case ocpp::v201::InstallCertificateStatusEnum::Accepted: + case ocpp::v2::InstallCertificateStatusEnum::Accepted: return ocpp::InstallCertificateResult::Accepted; default: throw std::runtime_error( @@ -221,43 +221,43 @@ ocpp::InstallCertificateResult from_ocpp_v201(ocpp::v201::InstallCertificateStat } } -ocpp::DeleteCertificateResult from_ocpp_v201(ocpp::v201::DeleteCertificateStatusEnum other) { +ocpp::DeleteCertificateResult from_ocpp_v2(ocpp::v2::DeleteCertificateStatusEnum other) { switch (other) { - case ocpp::v201::DeleteCertificateStatusEnum::Accepted: + case ocpp::v2::DeleteCertificateStatusEnum::Accepted: return ocpp::DeleteCertificateResult::Accepted; - case ocpp::v201::DeleteCertificateStatusEnum::Failed: + case ocpp::v2::DeleteCertificateStatusEnum::Failed: return ocpp::DeleteCertificateResult::Failed; - case ocpp::v201::DeleteCertificateStatusEnum::NotFound: + case ocpp::v2::DeleteCertificateStatusEnum::NotFound: return ocpp::DeleteCertificateResult::NotFound; default: throw std::runtime_error("Could not convert DeleteCertificateResult to evse_security::DeleteCertificateResult"); } } -ocpp::CertificateHashDataType from_ocpp_v201(ocpp::v201::CertificateHashDataType other) { +ocpp::CertificateHashDataType from_ocpp_v2(ocpp::v2::CertificateHashDataType other) { ocpp::CertificateHashDataType lhs; - lhs.hashAlgorithm = from_ocpp_v201(other.hashAlgorithm); + lhs.hashAlgorithm = from_ocpp_v2(other.hashAlgorithm); lhs.issuerNameHash = other.issuerNameHash; lhs.issuerKeyHash = other.issuerKeyHash; lhs.serialNumber = other.serialNumber; return lhs; } -ocpp::CertificateHashDataChain from_ocpp_v201(ocpp::v201::CertificateHashDataChain other) { +ocpp::CertificateHashDataChain from_ocpp_v2(ocpp::v2::CertificateHashDataChain other) { ocpp::CertificateHashDataChain lhs; - lhs.certificateType = from_ocpp_v201(other.certificateType); - lhs.certificateHashData = from_ocpp_v201(other.certificateHashData); + lhs.certificateType = from_ocpp_v2(other.certificateType); + lhs.certificateHashData = from_ocpp_v2(other.certificateHashData); if (other.childCertificateHashData.has_value()) { std::vector v; for (const auto& certificate_hash_data : other.childCertificateHashData.value()) { - v.push_back(from_ocpp_v201(certificate_hash_data)); + v.push_back(from_ocpp_v2(certificate_hash_data)); } lhs.childCertificateHashData = v; } return lhs; } -ocpp::OCSPRequestData from_ocpp_v201(ocpp::v201::OCSPRequestData other) { +ocpp::OCSPRequestData from_ocpp_v2(ocpp::v2::OCSPRequestData other) { ocpp::OCSPRequestData lhs; lhs.issuerNameHash = other.issuerNameHash; lhs.issuerKeyHash = other.issuerKeyHash; diff --git a/lib/ocpp/common/types.cpp b/lib/ocpp/common/types.cpp index dc670c0a0..3898322c9 100644 --- a/lib/ocpp/common/types.cpp +++ b/lib/ocpp/common/types.cpp @@ -559,7 +559,7 @@ void from_json(const json& j, DisplayMessageContent& m) { } if (j.contains("format")) { - m.message_format = v201::conversions::string_to_message_format_enum(j.at("format")); + m.message_format = v2::conversions::string_to_message_format_enum(j.at("format")); } if (j.contains("language")) { @@ -571,7 +571,7 @@ void to_json(json& j, const DisplayMessageContent& m) { j["message"] = m.message; if (m.message_format.has_value()) { - j["format"] = v201::conversions::message_format_enum_to_string(m.message_format.value()); + j["format"] = v2::conversions::message_format_enum_to_string(m.message_format.value()); } if (m.language.has_value()) { diff --git a/lib/ocpp/v16/charge_point.cpp b/lib/ocpp/v16/charge_point.cpp index b73467f8c..b72e7258b 100644 --- a/lib/ocpp/v16/charge_point.cpp +++ b/lib/ocpp/v16/charge_point.cpp @@ -50,16 +50,16 @@ IdTagInfo ChargePoint::authorize_id_token(CiString<20> id_token) { return this->charge_point->authorize_id_token(id_token); } -ocpp::v201::AuthorizeResponse ChargePoint::data_transfer_pnc_authorize( +ocpp::v2::AuthorizeResponse ChargePoint::data_transfer_pnc_authorize( const std::string& emaid, const std::optional& certificate, - const std::optional>& iso15118_certificate_hash_data) { + const std::optional>& iso15118_certificate_hash_data) { return this->charge_point->data_transfer_pnc_authorize(emaid, certificate, iso15118_certificate_hash_data); } void ChargePoint::data_transfer_pnc_get_15118_ev_certificate( const int32_t connector_id, const std::string& exi_request, const std::string& iso15118_schema_version, - const ocpp::v201::CertificateActionEnum& certificate_action) { + const ocpp::v2::CertificateActionEnum& certificate_action) { this->charge_point->data_transfer_pnc_get_15118_ev_certificate(connector_id, exi_request, iso15118_schema_version, certificate_action); @@ -290,8 +290,8 @@ void ChargePoint::register_connection_state_changed_callback(const std::function void ChargePoint::register_get_15118_ev_certificate_response_callback( const std::function& callback) { + const ocpp::v2::Get15118EVCertificateResponse& certificate_response, + const ocpp::v2::CertificateActionEnum& certificate_action)>& callback) { this->charge_point->register_get_15118_ev_certificate_response_callback(callback); } diff --git a/lib/ocpp/v16/charge_point_impl.cpp b/lib/ocpp/v16/charge_point_impl.cpp index c05f98d8b..b1fd70bdd 100644 --- a/lib/ocpp/v16/charge_point_impl.cpp +++ b/lib/ocpp/v16/charge_point_impl.cpp @@ -12,9 +12,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include @@ -2679,8 +2679,8 @@ void ChargePointImpl::update_ocsp_cache() { EVLOG_info << "Requesting OCSP response."; const auto ocsp_request_data = this->evse_security->get_v2g_ocsp_request_data(); for (const auto& ocsp_request_entry : ocsp_request_data) { - ocpp::v201::OCSPRequestData ocsp_request = - ocpp::evse_security_conversions::to_ocpp_v201(ocsp_request_entry); + ocpp::v2::OCSPRequestData ocsp_request = + ocpp::evse_security_conversions::to_ocpp_v2(ocsp_request_entry); this->data_transfer_pnc_get_certificate_status(ocsp_request); } this->database_handler->insert_ocsp_update(); @@ -3418,13 +3418,13 @@ bool ChargePointImpl::is_pnc_enabled() { this->configuration->getISO15118PnCEnabled(); } -ocpp::v201::AuthorizeResponse ChargePointImpl::data_transfer_pnc_authorize( +ocpp::v2::AuthorizeResponse ChargePointImpl::data_transfer_pnc_authorize( const std::string& emaid, const std::optional& certificate, - const std::optional>& iso15118_certificate_hash_data) { + const std::optional>& iso15118_certificate_hash_data) { - ocpp::v201::AuthorizeResponse authorize_response; - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Invalid; + ocpp::v2::AuthorizeResponse authorize_response; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Invalid; if (!this->is_pnc_enabled()) { EVLOG_warning << "Received request to send DataTransfer(Authorize.req) while PnC is disabled"; @@ -3435,10 +3435,10 @@ ocpp::v201::AuthorizeResponse ChargePointImpl::data_transfer_pnc_authorize( req.vendorId = ISO15118_PNC_VENDOR_ID; req.messageId.emplace(CiString<50>(std::string("Authorize"))); - ocpp::v201::AuthorizeRequest authorize_req; - ocpp::v201::IdToken id_token; + ocpp::v2::AuthorizeRequest authorize_req; + ocpp::v2::IdToken id_token; - id_token.type = ocpp::v201::IdTokenEnum::eMAID; + id_token.type = ocpp::v2::IdTokenEnum::eMAID; id_token.idToken = emaid; authorize_req.idToken = id_token; @@ -3471,11 +3471,11 @@ ocpp::v201::AuthorizeResponse ChargePointImpl::data_transfer_pnc_authorize( forward_to_csms = true; } else { EVLOG_warning << "Online: Central Contract Validation not allowed"; - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Invalid; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Invalid; } } else { // Try to generate the OCSP data from the certificate chain and use that - const auto generated_ocsp_request_data_list = ocpp::evse_security_conversions::to_ocpp_v201( + const auto generated_ocsp_request_data_list = ocpp::evse_security_conversions::to_ocpp_v2( this->evse_security->get_mo_ocsp_request_data(certificate.value())); if (generated_ocsp_request_data_list.size() > 0) { EVLOG_info << "Online: Pass generated OCSP data to CSMS"; @@ -3490,7 +3490,7 @@ ocpp::v201::AuthorizeResponse ChargePointImpl::data_transfer_pnc_authorize( } else { EVLOG_warning << "Online: OCSP data could not be generated and CentralContractValidation not allowed"; - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Invalid; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Invalid; } } } @@ -3510,32 +3510,31 @@ ocpp::v201::AuthorizeResponse ChargePointImpl::data_transfer_pnc_authorize( } else { // No requirement states what to do when ContractValidationOffline is true // and LocalAuthorizeOffline is false - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Unknown; - authorize_response.certificateStatus = ocpp::v201::AuthorizeCertificateStatusEnum::Accepted; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Unknown; + authorize_response.certificateStatus = ocpp::v2::AuthorizeCertificateStatusEnum::Accepted; } break; case CertificateValidationResult::Expired: - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Expired; - authorize_response.certificateStatus = - ocpp::v201::AuthorizeCertificateStatusEnum::CertificateExpired; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Expired; + authorize_response.certificateStatus = ocpp::v2::AuthorizeCertificateStatusEnum::CertificateExpired; break; default: - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Unknown; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Unknown; break; } } else { EVLOG_warning << "Offline: ContractValidationOffline is disabled. Validation not allowed"; // C07.FR.07: CS shall not allow charging - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::NotAtThisTime; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::NotAtThisTime; } } } else { EVLOG_warning << "Can not validate eMAID without certificate chain"; - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Invalid; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Invalid; } if (forward_to_csms) { - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Unknown; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Unknown; // AuthorizeRequest sent to CSMS, let's show the results req.data.emplace(json(authorize_req).dump()); @@ -3577,9 +3576,9 @@ ocpp::v201::AuthorizeResponse ChargePointImpl::data_transfer_pnc_authorize( } else { const auto local_authorize_result = this->authorize_id_token(emaid, true); if (local_authorize_result.status == AuthorizationStatus::Accepted) { - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Accepted; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Accepted; } else { - authorize_response.idTokenInfo.status = ocpp::v201::AuthorizationStatusEnum::Invalid; + authorize_response.idTokenInfo.status = ocpp::v2::AuthorizationStatusEnum::Invalid; } return authorize_response; } @@ -3598,7 +3597,7 @@ void ChargePointImpl::data_transfer_pnc_sign_certificate() { req.vendorId = ISO15118_PNC_VENDOR_ID; req.messageId.emplace(CiString<50>(std::string("SignCertificate"))); - ocpp::v201::SignCertificateRequest csr_req; + ocpp::v2::SignCertificateRequest csr_req; const auto result = this->evse_security->generate_certificate_signing_request( ocpp::CertificateSigningUseEnum::V2GCertificate, @@ -3619,7 +3618,7 @@ void ChargePointImpl::data_transfer_pnc_sign_certificate() { } csr_req.csr = result.csr.value(); - csr_req.certificateType = ocpp::v201::CertificateSigningUseEnum::V2GCertificate; + csr_req.certificateType = ocpp::v2::CertificateSigningUseEnum::V2GCertificate; req.data.emplace(json(csr_req).dump()); Call call(req); @@ -3628,7 +3627,7 @@ void ChargePointImpl::data_transfer_pnc_sign_certificate() { void ChargePointImpl::data_transfer_pnc_get_15118_ev_certificate( const int32_t connector_id, const std::string& exi_request, const std::string& iso15118_schema_version, - const ocpp::v201::CertificateActionEnum& certificate_action) { + const ocpp::v2::CertificateActionEnum& certificate_action) { if (!this->is_pnc_enabled()) { EVLOG_warning @@ -3641,7 +3640,7 @@ void ChargePointImpl::data_transfer_pnc_get_15118_ev_certificate( req.vendorId = ISO15118_PNC_VENDOR_ID; req.messageId.emplace(CiString<50>(std::string("Get15118EVCertificate"))); - ocpp::v201::Get15118EVCertificateRequest cert_req; + ocpp::v2::Get15118EVCertificateRequest cert_req; cert_req.action = certificate_action; cert_req.exiRequest = exi_request; cert_req.iso15118SchemaVersion = iso15118_schema_version; @@ -3663,7 +3662,7 @@ void ChargePointImpl::data_transfer_pnc_get_15118_ev_certificate( try { ocpp::CallResult call_result = enhanced_message.message; if (call_result.msg.data.has_value() and call_result.msg.status == DataTransferStatus::Accepted) { - ocpp::v201::Get15118EVCertificateResponse ev_certificate_response = + ocpp::v2::Get15118EVCertificateResponse ev_certificate_response = json::parse(call_result.msg.data.value()); this->get_15118_ev_certificate_response_callback(connector_id, ev_certificate_response, certificate_action); @@ -3686,14 +3685,14 @@ void ChargePointImpl::data_transfer_pnc_get_15118_ev_certificate( } } -void ChargePointImpl::data_transfer_pnc_get_certificate_status(const ocpp::v201::OCSPRequestData& ocsp_request_data) { +void ChargePointImpl::data_transfer_pnc_get_certificate_status(const ocpp::v2::OCSPRequestData& ocsp_request_data) { EVLOG_info << "Requesting OCSP certificate Status"; DataTransferRequest req; req.vendorId = ISO15118_PNC_VENDOR_ID; req.messageId.emplace(CiString<50>(std::string("GetCertificateStatus"))); - ocpp::v201::GetCertificateStatusRequest cert_status_req; + ocpp::v2::GetCertificateStatusRequest cert_status_req; cert_status_req.ocspRequestData = ocsp_request_data; req.data.emplace(json(cert_status_req).dump()); @@ -3712,13 +3711,12 @@ void ChargePointImpl::data_transfer_pnc_get_certificate_status(const ocpp::v201: try { ocpp::CallResult call_result = enhanced_message.message; if (call_result.msg.data.has_value()) { - ocpp::v201::GetCertificateStatusResponse cert_status_response = - json::parse(call_result.msg.data.value()); - if (cert_status_response.status == ocpp::v201::GetCertificateStatusEnum::Accepted) { + ocpp::v2::GetCertificateStatusResponse cert_status_response = json::parse(call_result.msg.data.value()); + if (cert_status_response.status == ocpp::v2::GetCertificateStatusEnum::Accepted) { if (cert_status_response.ocspResult.has_value()) { ocpp::CertificateHashDataType certificate_hash_data; certificate_hash_data.hashAlgorithm = - ocpp::evse_security_conversions::from_ocpp_v201(ocsp_request_data.hashAlgorithm); + ocpp::evse_security_conversions::from_ocpp_v2(ocsp_request_data.hashAlgorithm); certificate_hash_data.issuerKeyHash = ocsp_request_data.issuerKeyHash.get(); certificate_hash_data.issuerNameHash = ocsp_request_data.issuerNameHash.get(); certificate_hash_data.serialNumber = ocsp_request_data.serialNumber.get(); @@ -3758,8 +3756,8 @@ void ChargePointImpl::handle_data_transfer_pnc_trigger_message(Callconfiguration->getCpoName().has_value() or this->configuration->getSeccLeafSubjectOrganization().has_value()) { response.status = DataTransferStatus::Accepted; - ocpp::v201::TriggerMessageResponse trigger_message_response; - trigger_message_response.status = ocpp::v201::TriggerMessageStatusEnum::Accepted; + ocpp::v2::TriggerMessageResponse trigger_message_response; + trigger_message_response.status = ocpp::v2::TriggerMessageStatusEnum::Accepted; response.data.emplace(json(trigger_message_response).dump()); } else { EVLOG_warning << "Received Data Transfer TriggerMessage to trigger CSR but no " @@ -3785,7 +3783,7 @@ void ChargePointImpl::handle_data_transfer_pnc_certificate_signed(Call certificate_types; if (req.certificateType.has_value()) { - certificate_types = ocpp::evse_security_conversions::from_ocpp_v201(req.certificateType.value()); + certificate_types = ocpp::evse_security_conversions::from_ocpp_v2(req.certificateType.value()); } - ocpp::v201::GetInstalledCertificateIdsResponse get_certificate_ids_response; - get_certificate_ids_response.status = ocpp::v201::GetInstalledCertificateStatusEnum::NotFound; + ocpp::v2::GetInstalledCertificateIdsResponse get_certificate_ids_response; + get_certificate_ids_response.status = ocpp::v2::GetInstalledCertificateStatusEnum::NotFound; const auto certificate_hash_data_chains = this->evse_security->get_installed_certificates(certificate_types); - std::optional> certificate_hash_data_chain_v201_opt; - std::vector certificate_hash_data_chain_v201; + std::optional> certificate_hash_data_chain_v2_opt; + std::vector certificate_hash_data_chain_v2; for (const auto certificate_hash_data_chain_entry : certificate_hash_data_chains) { - certificate_hash_data_chain_v201.push_back( - ocpp::evse_security_conversions::to_ocpp_v201(certificate_hash_data_chain_entry)); + certificate_hash_data_chain_v2.push_back( + ocpp::evse_security_conversions::to_ocpp_v2(certificate_hash_data_chain_entry)); } - certificate_hash_data_chain_v201_opt.emplace(certificate_hash_data_chain_v201); - get_certificate_ids_response.certificateHashDataChain = certificate_hash_data_chain_v201_opt; - get_certificate_ids_response.status = ocpp::v201::GetInstalledCertificateStatusEnum::Accepted; + certificate_hash_data_chain_v2_opt.emplace(certificate_hash_data_chain_v2); + get_certificate_ids_response.certificateHashDataChain = certificate_hash_data_chain_v2_opt; + get_certificate_ids_response.status = ocpp::v2::GetInstalledCertificateStatusEnum::Accepted; response.data.emplace(json(get_certificate_ids_response).dump()); } else { @@ -3890,13 +3888,13 @@ void ChargePointImpl::handle_data_transfer_delete_certificate(Callevse_security->delete_certificate(certificate_hash_data)); response.data.emplace(json(delete_cert_response).dump()); @@ -3920,13 +3918,12 @@ void ChargePointImpl::handle_data_transfer_install_certificate(Callevse_security->install_ca_certificate(req.certificate.get(), ca_certificate_type); - ocpp::v201::InstallCertificateResponse install_cert_response; - install_cert_response.status = ocpp::evse_security_conversions::to_ocpp_v201(result); + ocpp::v2::InstallCertificateResponse install_cert_response; + install_cert_response.status = ocpp::evse_security_conversions::to_ocpp_v2(result); response.data.emplace(json(install_cert_response).dump()); } catch (const json::exception& e) { EVLOG_warning << "Could not parse data of DataTransfer message InstallCertificate.req: " << e.what(); @@ -4497,8 +4494,8 @@ void ChargePointImpl::register_connection_state_changed_callback( void ChargePointImpl::register_get_15118_ev_certificate_response_callback( const std::function& callback) { + const ocpp::v2::Get15118EVCertificateResponse& certificate_response, + const ocpp::v2::CertificateActionEnum& certificate_action)>& callback) { this->get_15118_ev_certificate_response_callback = callback; } diff --git a/lib/ocpp/v201/average_meter_values.cpp b/lib/ocpp/v2/average_meter_values.cpp similarity index 96% rename from lib/ocpp/v201/average_meter_values.cpp rename to lib/ocpp/v2/average_meter_values.cpp index c7f207b54..bc8fd7b71 100644 --- a/lib/ocpp/v201/average_meter_values.cpp +++ b/lib/ocpp/v2/average_meter_values.cpp @@ -3,10 +3,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { AverageMeterValues::AverageMeterValues() { } void AverageMeterValues::clear_values() { @@ -61,5 +61,5 @@ bool AverageMeterValues::is_avg_meas(const SampledValue& sample) { return false; } } -} // namespace v201 +} // namespace v2 } // namespace ocpp \ No newline at end of file diff --git a/lib/ocpp/v201/charge_point.cpp b/lib/ocpp/v2/charge_point.cpp similarity index 96% rename from lib/ocpp/v201/charge_point.cpp rename to lib/ocpp/v2/charge_point.cpp index 2bf6b85ea..a4cfd59d4 100644 --- a/lib/ocpp/v201/charge_point.cpp +++ b/lib/ocpp/v2/charge_point.cpp @@ -1,37 +1,37 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include @@ -42,13 +42,13 @@ using namespace std::chrono_literals; using DatabaseException = ocpp::common::DatabaseException; namespace ocpp { -namespace v201 { +namespace v2 { const auto DEFAULT_MESSAGE_QUEUE_SIZE_THRESHOLD = 2E5; ChargePoint::ChargePoint(const std::map& evse_connector_structure, std::shared_ptr device_model, std::shared_ptr database_handler, - std::shared_ptr> message_queue, + std::shared_ptr> message_queue, const std::string& message_log_path, const std::shared_ptr evse_security, const Callbacks& callbacks) : ocpp::ChargingStationBase(evse_security), @@ -463,7 +463,7 @@ void ChargePoint::initialize(const std::map& evse_connector_st std::bind(&ChargePoint::websocket_connection_failed, this, std::placeholders::_1)); if (this->message_queue == nullptr) { - std::set message_types_discard_for_queueing; + std::set message_types_discard_for_queueing; try { const auto message_types_discard_for_queueing_csl = ocpp::split_string( this->device_model @@ -481,9 +481,9 @@ void ChargePoint::initialize(const std::map& evse_connector_st EVLOG_warning << "Could not apply MessageTypesDiscardForQueueing configuration"; } - this->message_queue = std::make_unique>( + this->message_queue = std::make_unique>( [this](json message) -> bool { return this->connectivity_manager->send_to_websocket(message.dump()); }, - MessageQueueConfig{ + MessageQueueConfig{ this->device_model->get_value(ControllerComponentVariables::MessageAttempts), this->device_model->get_value(ControllerComponentVariables::MessageAttemptInterval), this->device_model->get_optional_value(ControllerComponentVariables::MessageQueueSizeThreshold) @@ -587,7 +587,7 @@ void ChargePoint::initialize(const std::map& evse_connector_st VARIABLE_ATTRIBUTE_VALUE_SOURCE_INTERNAL, true); } -void ChargePoint::handle_message(const EnhancedMessage& message) { +void ChargePoint::handle_message(const EnhancedMessage& message) { const auto& json_message = message.message; try { switch (message.messageType) { @@ -678,7 +678,7 @@ void ChargePoint::handle_message(const EnhancedMessage& messa } void ChargePoint::message_callback(const std::string& message) { - EnhancedMessage enhanced_message; + EnhancedMessage enhanced_message; try { enhanced_message = this->message_queue->receive(message); } catch (const json::exception& e) { @@ -900,19 +900,19 @@ void ChargePoint::update_dm_availability_state(const int32_t evse_id, const int3 evse_id, connector_id, ConnectorComponentVariables::AvailabilityState); if (evse_cv.variable.has_value()) { this->device_model->set_read_only_value( - evse_cv.component, evse_cv.variable.value(), ocpp::v201::AttributeEnum::Actual, + evse_cv.component, evse_cv.variable.value(), ocpp::v2::AttributeEnum::Actual, conversions::connector_status_enum_to_string(status), VARIABLE_ATTRIBUTE_VALUE_SOURCE_INTERNAL); } if (connector_cv.variable.has_value()) { this->device_model->set_read_only_value( - connector_cv.component, connector_cv.variable.value(), ocpp::v201::AttributeEnum::Actual, + connector_cv.component, connector_cv.variable.value(), ocpp::v2::AttributeEnum::Actual, conversions::connector_status_enum_to_string(status), VARIABLE_ATTRIBUTE_VALUE_SOURCE_INTERNAL); } // if applicable to the entire charging station if (evse_id == 0 and charging_station.variable.has_value()) { this->device_model->set_read_only_value( - charging_station.component, charging_station.variable.value(), ocpp::v201::AttributeEnum::Actual, + charging_station.component, charging_station.variable.value(), ocpp::v2::AttributeEnum::Actual, conversions::connector_status_enum_to_string(status), VARIABLE_ATTRIBUTE_VALUE_SOURCE_INTERNAL); } } @@ -983,5 +983,5 @@ void ChargePoint::send_not_implemented_error(const MessageId unique_message_id, } } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/charge_point_callbacks.cpp b/lib/ocpp/v2/charge_point_callbacks.cpp similarity index 97% rename from lib/ocpp/v201/charge_point_callbacks.cpp rename to lib/ocpp/v2/charge_point_callbacks.cpp index d03aed110..b92ca6504 100644 --- a/lib/ocpp/v201/charge_point_callbacks.cpp +++ b/lib/ocpp/v2/charge_point_callbacks.cpp @@ -1,8 +1,8 @@ -#include +#include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { bool Callbacks::all_callbacks_valid(std::shared_ptr device_model) const { bool valid = @@ -90,4 +90,4 @@ bool Callbacks::all_callbacks_valid(std::shared_ptr device_model) c return valid; } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/component_state_manager.cpp b/lib/ocpp/v2/component_state_manager.cpp similarity index 99% rename from lib/ocpp/v201/component_state_manager.cpp rename to lib/ocpp/v2/component_state_manager.cpp index ab7c17faa..1536d65d4 100644 --- a/lib/ocpp/v201/component_state_manager.cpp +++ b/lib/ocpp/v2/component_state_manager.cpp @@ -1,12 +1,12 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest -#include +#include #include using QueryExecutionException = ocpp::common::QueryExecutionException; -namespace ocpp::v201 { +namespace ocpp::v2 { ComponentStateManagerInterface::~ComponentStateManagerInterface() { } @@ -341,4 +341,4 @@ void ComponentStateManager::send_status_notification_single_connector(int32_t ev this->send_status_notification_single_connector_internal(evse_id, connector_id, false, true); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/connectivity_manager.cpp b/lib/ocpp/v2/connectivity_manager.cpp similarity index 99% rename from lib/ocpp/v201/connectivity_manager.cpp rename to lib/ocpp/v2/connectivity_manager.cpp index 3ce5d4040..1de6e46dd 100644 --- a/lib/ocpp/v201/connectivity_manager.cpp +++ b/lib/ocpp/v2/connectivity_manager.cpp @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest -#include +#include #include -#include -#include +#include +#include namespace { const auto WEBSOCKET_INIT_DELAY = std::chrono::seconds(2); @@ -16,7 +16,7 @@ constexpr int32_t default_network_config_timeout_seconds = 60; } // namespace namespace ocpp { -namespace v201 { +namespace v2 { ConnectivityManager::ConnectivityManager(DeviceModel& device_model, std::shared_ptr evse_security, std::shared_ptr logging, @@ -513,5 +513,5 @@ void ConnectivityManager::remove_network_connection_profiles_below_actual_securi AttributeEnum::Actual, new_network_priority, VARIABLE_ATTRIBUTE_VALUE_SOURCE_INTERNAL); } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/connector.cpp b/lib/ocpp/v2/connector.cpp similarity index 98% rename from lib/ocpp/v201/connector.cpp rename to lib/ocpp/v2/connector.cpp index 66969bfd4..19509bc3a 100644 --- a/lib/ocpp/v201/connector.cpp +++ b/lib/ocpp/v2/connector.cpp @@ -4,13 +4,13 @@ #include #include -#include +#include using QueryExecutionException = ocpp::common::QueryExecutionException; using RequiredEntryNotFoundException = ocpp::common::RequiredEntryNotFoundException; namespace ocpp { -namespace v201 { +namespace v2 { namespace conversions { @@ -102,5 +102,5 @@ ConnectorStatusEnum Connector::get_effective_connector_status() { return this->component_state_manager->get_connector_effective_status(this->evse_id, this->connector_id); } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/ctrlr_component_variables.cpp b/lib/ocpp/v2/ctrlr_component_variables.cpp similarity index 99% rename from lib/ocpp/v201/ctrlr_component_variables.cpp rename to lib/ocpp/v2/ctrlr_component_variables.cpp index 050992cd2..5c51544bc 100644 --- a/lib/ocpp/v201/ctrlr_component_variables.cpp +++ b/lib/ocpp/v2/ctrlr_component_variables.cpp @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - Pionix GmbH and Contributors to EVerest -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { namespace ControllerComponents { const Component InternalCtrlr = {"InternalCtrlr"}; @@ -1380,5 +1380,5 @@ ComponentVariable get_component_variable(const int32_t evse_id, const int32_t co } } // namespace ConnectorComponentVariables -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/database_handler.cpp b/lib/ocpp/v2/database_handler.cpp similarity index 98% rename from lib/ocpp/v201/database_handler.cpp rename to lib/ocpp/v2/database_handler.cpp index 6f11fb274..b0ae454d1 100644 --- a/lib/ocpp/v201/database_handler.cpp +++ b/lib/ocpp/v2/database_handler.cpp @@ -3,15 +3,15 @@ #include "everest/logging.hpp" #include "ocpp/common/database/sqlite_statement.hpp" -#include "ocpp/v201/ocpp_enums.hpp" -#include "ocpp/v201/ocpp_types.hpp" +#include "ocpp/v2/ocpp_enums.hpp" +#include "ocpp/v2/ocpp_types.hpp" #include #include #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -19,11 +19,11 @@ namespace ocpp { using namespace common; -namespace v201 { +namespace v2 { DatabaseHandler::DatabaseHandler(std::unique_ptr database, const fs::path& sql_migration_files_path) : - DatabaseHandlerCommon(std::move(database), sql_migration_files_path, MIGRATION_FILE_VERSION_V201) { + DatabaseHandlerCommon(std::move(database), sql_migration_files_path, MIGRATION_FILE_VERSION_V2) { } void DatabaseHandler::init_sql() { @@ -729,7 +729,7 @@ void DatabaseHandler::transaction_delete(const std::string& transaction_id) { } } -void DatabaseHandler::insert_or_update_charging_profile(const int evse_id, const v201::ChargingProfile& profile, +void DatabaseHandler::insert_or_update_charging_profile(const int evse_id, const v2::ChargingProfile& profile, const ChargingLimitSourceEnum charging_limit_source) { // add or replace std::string sql = @@ -931,8 +931,8 @@ DatabaseHandler::get_charging_profiles_matching_criteria(const std::optional DatabaseHandler::get_charging_profiles_for_evse(const int evse_id) { - std::vector profiles; +std::vector DatabaseHandler::get_charging_profiles_for_evse(const int evse_id) { + std::vector profiles; std::string sql = "SELECT PROFILE FROM CHARGING_PROFILES WHERE EVSE_ID = @evse_id"; @@ -948,8 +948,8 @@ std::vector DatabaseHandler::get_charging_profiles_for_ev return profiles; } -std::vector DatabaseHandler::get_all_charging_profiles() { - std::vector profiles; +std::vector DatabaseHandler::get_all_charging_profiles() { + std::vector profiles; std::string sql = "SELECT PROFILE FROM CHARGING_PROFILES"; @@ -963,8 +963,8 @@ std::vector DatabaseHandler::get_all_charging_profiles() return profiles; } -std::map> DatabaseHandler::get_all_charging_profiles_group_by_evse() { - std::map> map; +std::map> DatabaseHandler::get_all_charging_profiles_group_by_evse() { + std::map> map; std::string sql = "SELECT EVSE_ID, PROFILE FROM CHARGING_PROFILES"; @@ -1007,5 +1007,5 @@ std::unique_ptr DatabaseHandler::new_statement(const s return this->database->new_statement(sql); } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/device_model.cpp b/lib/ocpp/v2/device_model.cpp similarity index 99% rename from lib/ocpp/v201/device_model.cpp rename to lib/ocpp/v2/device_model.cpp index f9c70350b..91b8c41f8 100644 --- a/lib/ocpp/v201/device_model.cpp +++ b/lib/ocpp/v2/device_model.cpp @@ -3,13 +3,13 @@ #include #include -#include -#include -#include +#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { using DatabaseException = ocpp::common::DatabaseException; @@ -104,8 +104,7 @@ bool DeviceModel::component_criteria_match(const Component& component, } bool DeviceModel::component_variables_match(const std::vector& component_variables, - const ocpp::v201::Component& component, - const ocpp::v201::Variable& variable) { + const ocpp::v2::Component& component, const ocpp::v2::Variable& variable) { return std::find_if( component_variables.begin(), component_variables.end(), [component, variable](ComponentVariable v) { @@ -869,5 +868,5 @@ int32_t DeviceModel::clear_custom_monitors() { return 0; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/device_model_storage_sqlite.cpp b/lib/ocpp/v2/device_model_storage_sqlite.cpp similarity index 98% rename from lib/ocpp/v201/device_model_storage_sqlite.cpp rename to lib/ocpp/v2/device_model_storage_sqlite.cpp index 0d6146506..b4df2a2b0 100644 --- a/lib/ocpp/v201/device_model_storage_sqlite.cpp +++ b/lib/ocpp/v2/device_model_storage_sqlite.cpp @@ -1,19 +1,19 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest -#include "ocpp/v201/init_device_model_db.hpp" -#include +#include "ocpp/v2/init_device_model_db.hpp" +#include #include #include -#include -#include +#include +#include namespace ocpp { using namespace common; -namespace v201 { +namespace v2 { extern void filter_criteria_monitors(const std::vector& criteria, std::vector& monitors); @@ -488,5 +488,5 @@ void DeviceModelStorageSqlite::check_integrity() { } } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/enums.cpp b/lib/ocpp/v2/enums.cpp similarity index 90% rename from lib/ocpp/v201/enums.cpp rename to lib/ocpp/v2/enums.cpp index 939ad3551..5935d42bc 100644 --- a/lib/ocpp/v201/enums.cpp +++ b/lib/ocpp/v2/enums.cpp @@ -3,9 +3,9 @@ #include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { namespace conversions { /// \brief Converts the given std::string \p s to VariableMonitorType @@ -26,4 +26,4 @@ VariableMonitorType string_to_variable_monitor_type(const std::string& s) { } // namespace conversions -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/evse.cpp b/lib/ocpp/v2/evse.cpp similarity index 99% rename from lib/ocpp/v201/evse.cpp rename to lib/ocpp/v2/evse.cpp index b9690cc4e..37baadac4 100644 --- a/lib/ocpp/v201/evse.cpp +++ b/lib/ocpp/v2/evse.cpp @@ -7,14 +7,14 @@ #include #include -#include -#include +#include +#include using namespace std::chrono_literals; using QueryExecutionException = ocpp::common::QueryExecutionException; namespace ocpp { -namespace v201 { +namespace v2 { // Convert an energy value into Wh static float get_normalized_energy_value(SampledValue sampled_value) { @@ -697,5 +697,5 @@ CurrentPhaseType Evse::get_current_phase_type() { return CurrentPhaseType::Unknown; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/evse_manager.cpp b/lib/ocpp/v2/evse_manager.cpp similarity index 98% rename from lib/ocpp/v201/evse_manager.cpp rename to lib/ocpp/v2/evse_manager.cpp index 3a2c22a08..62d1ffd51 100644 --- a/lib/ocpp/v201/evse_manager.cpp +++ b/lib/ocpp/v2/evse_manager.cpp @@ -1,10 +1,10 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { using EvseIteratorImpl = VectorOfUniquePtrIterator; @@ -116,5 +116,5 @@ void set_evse_connectors_unavailable(EvseInterface& evse, bool persist) { } } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/functional_blocks/authorization.cpp b/lib/ocpp/v2/functional_blocks/authorization.cpp similarity index 90% rename from lib/ocpp/v201/functional_blocks/authorization.cpp rename to lib/ocpp/v2/functional_blocks/authorization.cpp index 7f90d0cfb..e48d1689b 100644 --- a/lib/ocpp/v201/functional_blocks/authorization.cpp +++ b/lib/ocpp/v2/functional_blocks/authorization.cpp @@ -2,27 +2,27 @@ // Copyright Pionix GmbH and Contributors to EVerest #include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include /// /// \brief Check if vector of authorization data has a duplicate id token. /// \param list List to check. /// \return True if there is a duplicate. /// -static bool has_duplicate_in_list(const std::vector& list); -static bool has_no_token_info(const ocpp::v201::AuthorizationData& item); +static bool has_duplicate_in_list(const std::vector& list); +static bool has_no_token_info(const ocpp::v2::AuthorizationData& item); -ocpp::v201::Authorization::Authorization(MessageDispatcherInterface& message_dispatcher, - DeviceModel& device_model, ConnectivityManagerInterface& connectivity_manager, - DatabaseHandlerInterface& database_handler, EvseSecurity& evse_security) : +ocpp::v2::Authorization::Authorization(MessageDispatcherInterface& message_dispatcher, + DeviceModel& device_model, ConnectivityManagerInterface& connectivity_manager, + DatabaseHandlerInterface& database_handler, EvseSecurity& evse_security) : message_dispatcher(message_dispatcher), device_model(device_model), connectivity_manager(connectivity_manager), @@ -31,18 +31,18 @@ ocpp::v201::Authorization::Authorization(MessageDispatcherInterface auth_cache_cleanup_handler_running(false) { } -ocpp::v201::Authorization::~Authorization() { +ocpp::v2::Authorization::~Authorization() { stop_auth_cache_cleanup_thread(); } -void ocpp::v201::Authorization::start_auth_cache_cleanup_thread() { +void ocpp::v2::Authorization::start_auth_cache_cleanup_thread() { if (!auth_cache_cleanup_handler_running) { auth_cache_cleanup_handler_running = true; this->auth_cache_cleanup_thread = std::thread(&Authorization::cache_cleanup_handler, this); } } -void ocpp::v201::Authorization::handle_message(const ocpp::EnhancedMessage& message) { +void ocpp::v2::Authorization::handle_message(const ocpp::EnhancedMessage& message) { const auto& json_message = message.message; switch (message.messageType) { @@ -60,9 +60,9 @@ void ocpp::v201::Authorization::handle_message(const ocpp::EnhancedMessage>& certificate, - const std::optional>& ocsp_request_data) { +ocpp::v2::AuthorizeResponse +ocpp::v2::Authorization::authorize_req(const IdToken id_token, const std::optional>& certificate, + const std::optional>& ocsp_request_data) { AuthorizeRequest req; req.idToken = id_token; req.certificate = certificate; @@ -108,7 +108,7 @@ ocpp::v201::Authorization::authorize_req(const IdToken id_token, const std::opti } } -void ocpp::v201::Authorization::trigger_authorization_cache_cleanup() { +void ocpp::v2::Authorization::trigger_authorization_cache_cleanup() { { std::scoped_lock lk(this->auth_cache_cleanup_mutex); this->auth_cache_cleanup_required = true; @@ -116,7 +116,7 @@ void ocpp::v201::Authorization::trigger_authorization_cache_cleanup() { this->auth_cache_cleanup_cv.notify_one(); } -void ocpp::v201::Authorization::update_authorization_cache_size() { +void ocpp::v2::Authorization::update_authorization_cache_size() { auto& auth_cache_size = ControllerComponentVariables::AuthCacheStorage; if (auth_cache_size.variable.has_value()) { try { @@ -132,28 +132,28 @@ void ocpp::v201::Authorization::update_authorization_cache_size() { } } -bool ocpp::v201::Authorization::is_auth_cache_ctrlr_enabled() { +bool ocpp::v2::Authorization::is_auth_cache_ctrlr_enabled() { return this->device_model.get_optional_value(ControllerComponentVariables::AuthCacheCtrlrEnabled) .value_or(false); } -void ocpp::v201::Authorization::authorization_cache_insert_entry(const std::string& id_token_hash, - const IdTokenInfo& id_token_info) { +void ocpp::v2::Authorization::authorization_cache_insert_entry(const std::string& id_token_hash, + const IdTokenInfo& id_token_info) { this->database_handler.authorization_cache_insert_entry(id_token_hash, id_token_info); } -std::optional -ocpp::v201::Authorization::authorization_cache_get_entry(const std::string& id_token_hash) { +std::optional +ocpp::v2::Authorization::authorization_cache_get_entry(const std::string& id_token_hash) { return this->database_handler.authorization_cache_get_entry(id_token_hash); } -void ocpp::v201::Authorization::authorization_cache_delete_entry(const std::string& id_token_hash) { +void ocpp::v2::Authorization::authorization_cache_delete_entry(const std::string& id_token_hash) { this->database_handler.authorization_cache_delete_entry(id_token_hash); } -ocpp::v201::AuthorizeResponse -ocpp::v201::Authorization::validate_token(const IdToken id_token, const std::optional>& certificate, - const std::optional>& ocsp_request_data) { +ocpp::v2::AuthorizeResponse +ocpp::v2::Authorization::validate_token(const IdToken id_token, const std::optional>& certificate, + const std::optional>& ocsp_request_data) { // TODO(piet): C01.FR.14 // TODO(piet): C01.FR.15 // TODO(piet): C01.FR.16 @@ -216,7 +216,7 @@ ocpp::v201::Authorization::validate_token(const IdToken id_token, const std::opt } } else { // Try to generate the OCSP data from the certificate chain and use that - const auto generated_ocsp_request_data_list = ocpp::evse_security_conversions::to_ocpp_v201( + const auto generated_ocsp_request_data_list = ocpp::evse_security_conversions::to_ocpp_v2( this->evse_security.get_mo_ocsp_request_data(certificate.value())); if (generated_ocsp_request_data_list.size() > 0) { EVLOG_info << "Online: Pass generated OCSP data to CSMS"; @@ -401,7 +401,7 @@ ocpp::v201::Authorization::validate_token(const IdToken id_token, const std::opt return response; } -void ocpp::v201::Authorization::stop_auth_cache_cleanup_thread() { +void ocpp::v2::Authorization::stop_auth_cache_cleanup_thread() { if (this->auth_cache_cleanup_handler_running) { { std::scoped_lock lk(this->auth_cache_cleanup_mutex); @@ -415,7 +415,7 @@ void ocpp::v201::Authorization::stop_auth_cache_cleanup_thread() { } } -void ocpp::v201::Authorization::handle_clear_cache_req(Call call) { +void ocpp::v2::Authorization::handle_clear_cache_req(Call call) { ClearCacheResponse response; response.status = ClearCacheStatusEnum::Rejected; @@ -436,7 +436,7 @@ void ocpp::v201::Authorization::handle_clear_cache_req(Call c this->message_dispatcher.dispatch_call_result(call_result); } -void ocpp::v201::Authorization::cache_cleanup_handler() { +void ocpp::v2::Authorization::cache_cleanup_handler() { // Run the update once so the ram variable gets initialized this->update_authorization_cache_size(); @@ -485,7 +485,7 @@ void ocpp::v201::Authorization::cache_cleanup_handler() { } } -void ocpp::v201::Authorization::handle_send_local_authorization_list_req(Call call) { +void ocpp::v2::Authorization::handle_send_local_authorization_list_req(Call call) { SendLocalListResponse response; if (this->device_model.get_optional_value(ControllerComponentVariables::LocalAuthListCtrlrEnabled) @@ -524,7 +524,7 @@ void ocpp::v201::Authorization::handle_send_local_authorization_list_req(Callmessage_dispatcher.dispatch_call_result(call_result); } -void ocpp::v201::Authorization::handle_get_local_authorization_list_version_req(Call call) { +void ocpp::v2::Authorization::handle_get_local_authorization_list_version_req(Call call) { GetLocalListVersionResponse response; if (this->device_model.get_optional_value(ControllerComponentVariables::LocalAuthListCtrlrEnabled) @@ -545,8 +545,8 @@ void ocpp::v201::Authorization::handle_get_local_authorization_list_version_req( this->message_dispatcher.dispatch_call_result(call_result); } -ocpp::v201::SendLocalListStatusEnum -ocpp::v201::Authorization::apply_local_authorization_list(const SendLocalListRequest& request) { +ocpp::v2::SendLocalListStatusEnum +ocpp::v2::Authorization::apply_local_authorization_list(const SendLocalListRequest& request) { auto status = SendLocalListStatusEnum::Failed; if (request.versionNumber <= 0) { @@ -599,7 +599,7 @@ ocpp::v201::Authorization::apply_local_authorization_list(const SendLocalListReq return status; } -static bool has_duplicate_in_list(const std::vector& list) { +static bool has_duplicate_in_list(const std::vector& list) { for (auto it1 = list.begin(); it1 != list.end(); ++it1) { for (auto it2 = it1 + 1; it2 != list.end(); ++it2) { if (it1->idToken.idToken == it2->idToken.idToken and it1->idToken.type == it2->idToken.type) { @@ -610,6 +610,6 @@ static bool has_duplicate_in_list(const std::vector +#include -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { Availability::Availability(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, EvseManagerInterface& evse_manager, ComponentStateManagerInterface& component_state_manager, std::optional time_sync_callback, @@ -220,4 +220,4 @@ void Availability::set_connector_operative_status(int32_t evse_id, int32_t conne OperationalStatusEnum new_status, bool persist) { this->evse_manager.get_evse(evse_id).set_connector_operative_status(connector_id, new_status, persist); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/data_transfer.cpp b/lib/ocpp/v2/functional_blocks/data_transfer.cpp similarity index 95% rename from lib/ocpp/v201/functional_blocks/data_transfer.cpp rename to lib/ocpp/v2/functional_blocks/data_transfer.cpp index f6edfe096..8bc010e8f 100644 --- a/lib/ocpp/v201/functional_blocks/data_transfer.cpp +++ b/lib/ocpp/v2/functional_blocks/data_transfer.cpp @@ -1,13 +1,13 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { void DataTransfer::handle_message(const EnhancedMessage& message) { if (message.messageType != MessageType::DataTransfer) { @@ -79,5 +79,5 @@ std::optional DataTransfer::data_transfer_req(const DataTr return response; } -}; // namespace v201 +}; // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/functional_blocks/diagnostics.cpp b/lib/ocpp/v2/functional_blocks/diagnostics.cpp similarity index 95% rename from lib/ocpp/v201/functional_blocks/diagnostics.cpp rename to lib/ocpp/v2/functional_blocks/diagnostics.cpp index d8ef0c395..34ad28761 100644 --- a/lib/ocpp/v201/functional_blocks/diagnostics.cpp +++ b/lib/ocpp/v2/functional_blocks/diagnostics.cpp @@ -1,29 +1,29 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include #include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include const auto DEFAULT_MAX_CUSTOMER_INFORMATION_DATA_LENGTH = 51200; -namespace ocpp::v201 { +namespace ocpp::v2 { Diagnostics::Diagnostics(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, ConnectivityManagerInterface& connectivity_manager, AuthorizationInterface& authorization, @@ -402,4 +402,4 @@ void Diagnostics::clear_customer_information(const std::optional -#include -#include +#include +#include +#include -#include -#include -#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { DisplayMessageBlock::DisplayMessageBlock(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, EvseManagerInterface& evse_manager, @@ -228,4 +228,4 @@ DisplayMessage message_info_to_display_message(const MessageInfo& message_info) return display_message; } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/firmware_update.cpp b/lib/ocpp/v2/functional_blocks/firmware_update.cpp similarity index 95% rename from lib/ocpp/v201/functional_blocks/firmware_update.cpp rename to lib/ocpp/v2/functional_blocks/firmware_update.cpp index d98891f43..1114ffb77 100644 --- a/lib/ocpp/v201/functional_blocks/firmware_update.cpp +++ b/lib/ocpp/v2/functional_blocks/firmware_update.cpp @@ -1,20 +1,20 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { // Firmware update end states. const static std::array firmware_status_end_states = { @@ -207,4 +207,4 @@ void FirmwareUpdate::restore_all_connector_states() { } } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/meter_values.cpp b/lib/ocpp/v2/functional_blocks/meter_values.cpp similarity index 76% rename from lib/ocpp/v201/functional_blocks/meter_values.cpp rename to lib/ocpp/v2/functional_blocks/meter_values.cpp index ed5132bf0..8f371fd82 100644 --- a/lib/ocpp/v201/functional_blocks/meter_values.cpp +++ b/lib/ocpp/v2/functional_blocks/meter_values.cpp @@ -1,25 +1,25 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include #include -#include -#include -#include -#include -#include - -ocpp::v201::MeterValues::MeterValues(MessageDispatcherInterface& message_dispatcher, - DeviceModel& device_model, EvseManagerInterface& evse_manager) : +#include +#include +#include +#include +#include + +ocpp::v2::MeterValues::MeterValues(MessageDispatcherInterface& message_dispatcher, + DeviceModel& device_model, EvseManagerInterface& evse_manager) : message_dispatcher(message_dispatcher), device_model(device_model), evse_manager(evse_manager) { } -void ocpp::v201::MeterValues::handle_message(const ocpp::EnhancedMessage& message) { +void ocpp::v2::MeterValues::handle_message(const ocpp::EnhancedMessage& message) { throw MessageTypeNotImplementedException(message.messageType); } -void ocpp::v201::MeterValues::update_aligned_data_interval() { +void ocpp::v2::MeterValues::update_aligned_data_interval() { using namespace std::chrono_literals; auto interval = @@ -55,7 +55,7 @@ void ocpp::v201::MeterValues::update_aligned_data_interval() { if (align_timestamps) { meter_value.timestamp = utils::align_timestamp(DateTime{}, interval); } - this->meter_values_req(0, std::vector(1, meter_value)); + this->meter_values_req(0, std::vector(1, meter_value)); } this->aligned_data_evse0.clear_values(); @@ -76,7 +76,7 @@ void ocpp::v201::MeterValues::update_aligned_data_interval() { if (!meter_value.sampledValue.empty()) { // J01.FR.14 this is the only case where we send a MeterValue.req - this->meter_values_req(evse.get_id(), std::vector(1, meter_value)); + this->meter_values_req(evse.get_id(), std::vector(1, meter_value)); // clear the values } evse.clear_idle_meter_values(); @@ -85,7 +85,7 @@ void ocpp::v201::MeterValues::update_aligned_data_interval() { interval, std::chrono::floor(date::utc_clock::to_sys(date::utc_clock::now()))); } -void ocpp::v201::MeterValues::on_meter_value(const int32_t evse_id, const MeterValue& meter_value) { +void ocpp::v2::MeterValues::on_meter_value(const int32_t evse_id, const MeterValue& meter_value) { if (evse_id == 0) { // if evseId = 0 then store in the chargepoint metervalues this->aligned_data_evse0.set_values(meter_value); @@ -95,9 +95,9 @@ void ocpp::v201::MeterValues::on_meter_value(const int32_t evse_id, const MeterV } } -ocpp::v201::MeterValue -ocpp::v201::MeterValues::get_latest_meter_value_filtered(const MeterValue& meter_value, ReadingContextEnum context, - const RequiredComponentVariable& component_variable) { +ocpp::v2::MeterValue +ocpp::v2::MeterValues::get_latest_meter_value_filtered(const MeterValue& meter_value, ReadingContextEnum context, + const RequiredComponentVariable& component_variable) { auto filtered_meter_value = utils::get_meter_value_with_measurands_applied( meter_value, utils::get_measurands_vec(this->device_model.get_value(component_variable))); for (auto& sampled_value : filtered_meter_value.sampledValue) { @@ -106,8 +106,8 @@ ocpp::v201::MeterValues::get_latest_meter_value_filtered(const MeterValue& meter return filtered_meter_value; } -void ocpp::v201::MeterValues::meter_values_req(const int32_t evse_id, const std::vector& meter_values, - const bool initiated_by_trigger_message) { +void ocpp::v2::MeterValues::meter_values_req(const int32_t evse_id, const std::vector& meter_values, + const bool initiated_by_trigger_message) { MeterValuesRequest req; req.evseId = evse_id; req.meterValue = meter_values; @@ -116,7 +116,7 @@ void ocpp::v201::MeterValues::meter_values_req(const int32_t evse_id, const std: this->message_dispatcher.dispatch_call(call, initiated_by_trigger_message); } -void ocpp::v201::MeterValues::update_dm_evse_power(const int32_t evse_id, const MeterValue& meter_value) { +void ocpp::v2::MeterValues::update_dm_evse_power(const int32_t evse_id, const MeterValue& meter_value) { ComponentVariable evse_power_cv = EvseComponentVariables::get_component_variable(evse_id, EvseComponentVariables::Power); diff --git a/lib/ocpp/v201/functional_blocks/provisioning.cpp b/lib/ocpp/v2/functional_blocks/provisioning.cpp similarity index 97% rename from lib/ocpp/v201/functional_blocks/provisioning.cpp rename to lib/ocpp/v2/functional_blocks/provisioning.cpp index d10b13fa0..b3d95c2d4 100644 --- a/lib/ocpp/v201/functional_blocks/provisioning.cpp +++ b/lib/ocpp/v2/functional_blocks/provisioning.cpp @@ -1,33 +1,33 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include "ocpp/v201/functional_blocks/transaction.hpp" -#include +#include "ocpp/v2/functional_blocks/transaction.hpp" +#include #include #include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include const auto DEFAULT_MAX_MESSAGE_SIZE = 65000; const auto DEFAULT_BOOT_NOTIFICATION_RETRY_INTERVAL = std::chrono::seconds(30); -namespace ocpp::v201 { +namespace ocpp::v2 { static bool component_variable_change_requires_websocket_option_update_without_reconnect( const ComponentVariable& component_variable); @@ -701,4 +701,4 @@ static bool component_variable_change_requires_websocket_option_update_without_r component_variable == ControllerComponentVariables::NetworkProfileConnectionAttempts or component_variable == ControllerComponentVariables::WebSocketPingInterval; } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/remote_transaction_control.cpp b/lib/ocpp/v2/functional_blocks/remote_transaction_control.cpp similarity index 94% rename from lib/ocpp/v201/functional_blocks/remote_transaction_control.cpp rename to lib/ocpp/v2/functional_blocks/remote_transaction_control.cpp index e7ac36fcd..45ea666e3 100644 --- a/lib/ocpp/v201/functional_blocks/remote_transaction_control.cpp +++ b/lib/ocpp/v2/functional_blocks/remote_transaction_control.cpp @@ -1,30 +1,30 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace ocpp::v201 { +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace ocpp::v2 { RemoteTransactionControl::RemoteTransactionControl( MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, @@ -327,7 +327,7 @@ void RemoteTransactionControl::handle_trigger_message(Callmeter_values.meter_values_req(evse_id, std::vector(1, meter_value), true); + this->meter_values.meter_values_req(evse_id, std::vector(1, meter_value), true); } }; send_evse_message(send_meter_value); @@ -431,4 +431,4 @@ RemoteTransactionControl::is_evse_reserved_for_other(EvseInterface& evse, const return ReservationCheckStatus::NotReserved; } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/reservation.cpp b/lib/ocpp/v2/functional_blocks/reservation.cpp similarity index 95% rename from lib/ocpp/v201/functional_blocks/reservation.cpp rename to lib/ocpp/v2/functional_blocks/reservation.cpp index 0ea1b27ec..7701396ed 100644 --- a/lib/ocpp/v201/functional_blocks/reservation.cpp +++ b/lib/ocpp/v2/functional_blocks/reservation.cpp @@ -2,16 +2,16 @@ // Copyright Pionix GmbH and Contributors to EVerest #include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { Reservation::Reservation(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, EvseManagerInterface& evse_manager, ReserveNowCallback reserve_now_callback, CancelReservationCallback cancel_reservation_callback, @@ -199,4 +199,4 @@ void Reservation::send_reserve_now_rejected_response(const MessageId& unique_id, this->message_dispatcher.dispatch_call_result(call_result); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/security.cpp b/lib/ocpp/v2/functional_blocks/security.cpp similarity index 94% rename from lib/ocpp/v201/functional_blocks/security.cpp rename to lib/ocpp/v2/functional_blocks/security.cpp index 67a2e9ae1..cfcf2e173 100644 --- a/lib/ocpp/v201/functional_blocks/security.cpp +++ b/lib/ocpp/v2/functional_blocks/security.cpp @@ -1,23 +1,23 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include #include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include constexpr int32_t minimum_cert_signing_wait_time_seconds = 250; -namespace ocpp::v201 { +namespace ocpp::v2 { Security::Security(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, MessageLogging& logging, EvseSecurity& evse_security, @@ -172,7 +172,7 @@ void Security::sign_certificate_req(const ocpp::CertificateSigningUseEnum& certi bool should_use_tpm = false; if (certificate_signing_use == ocpp::CertificateSigningUseEnum::ChargingStationCertificate) { - req.certificateType = ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate; + req.certificateType = ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate; common = this->device_model.get_optional_value(ControllerComponentVariables::ChargeBoxSerialNumber); organization = @@ -182,7 +182,7 @@ void Security::sign_certificate_req(const ocpp::CertificateSigningUseEnum& certi should_use_tpm = this->device_model.get_optional_value(ControllerComponentVariables::UseTPM).value_or(false); } else { - req.certificateType = ocpp::v201::CertificateSigningUseEnum::V2GCertificate; + req.certificateType = ocpp::v2::CertificateSigningUseEnum::V2GCertificate; common = this->device_model.get_optional_value(ControllerComponentVariables::ISO15118CtrlrSeccId); organization = this->device_model.get_optional_value( ControllerComponentVariables::ISO15118CtrlrOrganizationName); @@ -348,7 +348,7 @@ void Security::handle_get_installed_certificate_ids_req(Call certificate_types; if (msg.certificateType.has_value()) { - certificate_types = ocpp::evse_security_conversions::from_ocpp_v201(msg.certificateType.value()); + certificate_types = ocpp::evse_security_conversions::from_ocpp_v2(msg.certificateType.value()); } else { certificate_types.push_back(CertificateType::CSMSRootCertificate); certificate_types.push_back(CertificateType::MFRootCertificate); @@ -360,17 +360,17 @@ void Security::handle_get_installed_certificate_ids_req(Callevse_security.get_installed_certificates(certificate_types); - // convert the common type back to the v201 type(s) for the response - std::vector certificate_hash_data_chain_v201; + // convert the common type back to the v2 type(s) for the response + std::vector certificate_hash_data_chain_v2; for (const auto& certificate_hash_data_chain_entry : certificate_hash_data_chains) { - certificate_hash_data_chain_v201.push_back( - ocpp::evse_security_conversions::to_ocpp_v201(certificate_hash_data_chain_entry)); + certificate_hash_data_chain_v2.push_back( + ocpp::evse_security_conversions::to_ocpp_v2(certificate_hash_data_chain_entry)); } - if (certificate_hash_data_chain_v201.empty()) { + if (certificate_hash_data_chain_v2.empty()) { response.status = GetInstalledCertificateStatusEnum::NotFound; } else { - response.certificateHashDataChain = certificate_hash_data_chain_v201; + response.certificateHashDataChain = certificate_hash_data_chain_v2; response.status = GetInstalledCertificateStatusEnum::Accepted; } @@ -391,8 +391,8 @@ void Security::handle_install_certificate_req(Call ca response.statusInfo->additionalInfo = "CertificateInstallationNotAllowedWithUnsecureConnection"; } else { const auto result = this->evse_security.install_ca_certificate( - msg.certificate.get(), ocpp::evse_security_conversions::from_ocpp_v201(msg.certificateType)); - response.status = ocpp::evse_security_conversions::to_ocpp_v201(result); + msg.certificate.get(), ocpp::evse_security_conversions::from_ocpp_v2(msg.certificateType)); + response.status = ocpp::evse_security_conversions::to_ocpp_v2(result); if (response.status == InstallCertificateStatusEnum::Accepted) { const auto& security_event = ocpp::security_events::RECONFIGURATIONOFSECURITYPARAMETERS; std::string tech_info = @@ -411,11 +411,11 @@ void Security::handle_delete_certificate_req(Call call const auto msg = call.msg; DeleteCertificateResponse response; - const auto certificate_hash_data = ocpp::evse_security_conversions::from_ocpp_v201(msg.certificateHashData); + const auto certificate_hash_data = ocpp::evse_security_conversions::from_ocpp_v2(msg.certificateHashData); const auto status = this->evse_security.delete_certificate(certificate_hash_data); - response.status = ocpp::evse_security_conversions::to_ocpp_v201(status); + response.status = ocpp::evse_security_conversions::to_ocpp_v2(status); if (response.status == DeleteCertificateStatusEnum::Accepted) { const auto& security_event = ocpp::security_events::RECONFIGURATIONOFSECURITYPARAMETERS; @@ -493,4 +493,4 @@ void Security::scheduled_check_v2g_certificate_expiration() { .value_or(12 * 60 * 60))); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/smart_charging.cpp b/lib/ocpp/v2/functional_blocks/smart_charging.cpp similarity index 98% rename from lib/ocpp/v201/functional_blocks/smart_charging.cpp rename to lib/ocpp/v2/functional_blocks/smart_charging.cpp index b9151087d..2d5be525c 100644 --- a/lib/ocpp/v201/functional_blocks/smart_charging.cpp +++ b/lib/ocpp/v2/functional_blocks/smart_charging.cpp @@ -1,27 +1,27 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include const int32_t STATION_WIDE_ID = 0; -namespace ocpp::v201 { +namespace ocpp::v2 { namespace conversions { std::string profile_validation_result_to_string(ProfileValidationResultEnum e) { switch (e) { @@ -1000,4 +1000,4 @@ CurrentPhaseType SmartCharging::get_current_phase_type(const std::optional +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include +#include const auto DEFAULT_PRICE_NUMBER_OF_DECIMALS = 3; -namespace ocpp::v201 { +namespace ocpp::v2 { TariffAndCost::TariffAndCost(MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, EvseManagerInterface& evse_manager, MeterValuesInterface& meter_values, std::optional& set_display_message_callback, @@ -270,4 +270,4 @@ bool TariffAndCost::is_cost_enabled() const { this->device_model.get_optional_value(ControllerComponentVariables::TariffCostCtrlrEnabledCost) .value_or(false); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/functional_blocks/transaction.cpp b/lib/ocpp/v2/functional_blocks/transaction.cpp similarity index 94% rename from lib/ocpp/v201/functional_blocks/transaction.cpp rename to lib/ocpp/v2/functional_blocks/transaction.cpp index 811339b40..905ae1a35 100644 --- a/lib/ocpp/v201/functional_blocks/transaction.cpp +++ b/lib/ocpp/v2/functional_blocks/transaction.cpp @@ -1,27 +1,27 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { TransactionBlock::TransactionBlock( MessageDispatcherInterface& message_dispatcher, DeviceModel& device_model, ConnectivityManagerInterface& connectivity_manager, EvseManagerInterface& evse_manager, - MessageQueue& message_queue, DatabaseHandlerInterface& database_handler, + MessageQueue& message_queue, DatabaseHandlerInterface& database_handler, AuthorizationInterface& authorization, AvailabilityInterface& availability, SmartChargingInterface& smart_charging, TariffAndCostInterface& tariff_and_cost, StopTransactionCallback stop_transaction_callback, PauseChargingCallback pause_charging_callback, std::optional transaction_event_callback, @@ -113,7 +113,7 @@ void TransactionBlock::on_transaction_finished(const int32_t evse_id, const Date const auto transaction = enhanced_transaction->get_transaction(); const auto transaction_id = enhanced_transaction->transactionId.get(); - std::optional> meter_values = std::nullopt; + std::optional> meter_values = std::nullopt; try { meter_values = std::make_optional(utils::get_meter_values_with_measurands_applied( this->database_handler.transaction_metervalues_get_all(enhanced_transaction->transactionId.get()), @@ -136,7 +136,7 @@ void TransactionBlock::on_transaction_finished(const int32_t evse_id, const Date // E07.FR.02 The field idToken is provided when the authorization of the transaction has been ended const std::optional transaction_id_token = - trigger_reason == ocpp::v201::TriggerReasonEnum::StopAuthorized ? id_token : std::nullopt; + trigger_reason == ocpp::v2::TriggerReasonEnum::StopAuthorized ? id_token : std::nullopt; this->transaction_event_req(TransactionEventEnum::Ended, timestamp, enhanced_transaction->get_transaction(), trigger_reason, enhanced_transaction->get_seq_no(), std::nullopt, std::nullopt, @@ -364,4 +364,4 @@ void TransactionBlock::handle_get_transaction_status(const Call call_result(response, call.uniqueId); this->message_dispatcher.dispatch_call_result(call_result); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/init_device_model_db.cpp b/lib/ocpp/v2/init_device_model_db.cpp similarity index 99% rename from lib/ocpp/v201/init_device_model_db.cpp rename to lib/ocpp/v2/init_device_model_db.cpp index 0b36a1be8..366f33c10 100644 --- a/lib/ocpp/v201/init_device_model_db.cpp +++ b/lib/ocpp/v2/init_device_model_db.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include +#include #include #include @@ -9,12 +9,12 @@ #include #include -#include +#include const static std::string STANDARDIZED_COMPONENT_CONFIG_DIR = "standardized"; const static std::string CUSTOM_COMPONENT_CONFIG_DIR = "custom"; -namespace ocpp::v201 { +namespace ocpp::v2 { // Forward declarations. static void check_integrity(const std::map>& component_configs); @@ -43,7 +43,7 @@ static std::string get_variable_name_for_logging(const DeviceModelVariable& vari InitDeviceModelDb::InitDeviceModelDb(const std::filesystem::path& database_path, const std::filesystem::path& migration_files_path) : common::DatabaseHandlerCommon(std::make_unique(database_path), migration_files_path, - MIGRATION_DEVICE_MODEL_FILE_VERSION_V201), + MIGRATION_DEVICE_MODEL_FILE_VERSION_V2), database_path(database_path), database_exists(std::filesystem::exists(database_path)) { } @@ -1654,4 +1654,4 @@ static std::string get_variable_name_for_logging(const DeviceModelVariable& vari return variable_name; } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/message_dispatcher.cpp b/lib/ocpp/v2/message_dispatcher.cpp similarity index 95% rename from lib/ocpp/v201/message_dispatcher.cpp rename to lib/ocpp/v2/message_dispatcher.cpp index df8be9e44..7b391f718 100644 --- a/lib/ocpp/v201/message_dispatcher.cpp +++ b/lib/ocpp/v2/message_dispatcher.cpp @@ -1,11 +1,11 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright Pionix GmbH and Contributors to EVerest -#include -#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { void MessageDispatcher::dispatch_call(const json& call, bool triggered) { const auto message_type = conversions::string_to_messagetype(call.at(CALL_ACTION)); @@ -55,5 +55,5 @@ void MessageDispatcher::dispatch_call_error(const json& call_error) { this->message_queue.push_call_error(call_error); } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v2/message_queue.cpp b/lib/ocpp/v2/message_queue.cpp new file mode 100644 index 000000000..41bead18a --- /dev/null +++ b/lib/ocpp/v2/message_queue.cpp @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest + +#include + +#include + +namespace ocpp { + +bool is_transaction_message(const ocpp::v2::MessageType message_type) { + return (message_type == v2::MessageType::TransactionEvent) || + (message_type == v2::MessageType::SecurityEventNotification); +} + +bool is_start_transaction_message(const ocpp::v2::MessageType message_type) { + return false; +} + +bool is_boot_notification_message(const ocpp::v2::MessageType message_type) { + return message_type == ocpp::v2::MessageType::BootNotification; +} + +template <> bool ControlMessage::is_transaction_update_message() const { + if (this->messageType == v2::MessageType::TransactionEvent) { + return v2::TransactionEventRequest{this->message.at(CALL_PAYLOAD)}.eventType == + v2::TransactionEventEnum::Updated; + } + return false; +} + +template <> +ControlMessage::ControlMessage(const json& message, const bool stall_until_accepted) : + message(message.get()), + messageType(v2::conversions::string_to_messagetype(message.at(CALL_ACTION))), + message_attempts(0), + initial_unique_id(message[MESSAGE_ID]), + stall_until_accepted(stall_until_accepted) { +} + +template <> v2::MessageType MessageQueue::string_to_messagetype(const std::string& s) { + return v2::conversions::string_to_messagetype(s); +} + +template <> std::string MessageQueue::messagetype_to_string(const v2::MessageType m) { + return v2::conversions::messagetype_to_string(m); +} + +} // namespace ocpp diff --git a/lib/ocpp/v201/messages/Authorize.cpp b/lib/ocpp/v2/messages/Authorize.cpp similarity index 97% rename from lib/ocpp/v201/messages/Authorize.cpp rename to lib/ocpp/v2/messages/Authorize.cpp index adb557b20..af95f1127 100644 --- a/lib/ocpp/v201/messages/Authorize.cpp +++ b/lib/ocpp/v2/messages/Authorize.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string AuthorizeRequest::get_type() const { return "Authorize"; @@ -104,5 +104,5 @@ std::ostream& operator<<(std::ostream& os, const AuthorizeResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/BootNotification.cpp b/lib/ocpp/v2/messages/BootNotification.cpp similarity index 97% rename from lib/ocpp/v201/messages/BootNotification.cpp rename to lib/ocpp/v2/messages/BootNotification.cpp index 82810981d..7350b63da 100644 --- a/lib/ocpp/v201/messages/BootNotification.cpp +++ b/lib/ocpp/v2/messages/BootNotification.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string BootNotificationRequest::get_type() const { return "BootNotification"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const BootNotificationResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/CMakeLists.txt b/lib/ocpp/v2/messages/CMakeLists.txt similarity index 100% rename from lib/ocpp/v201/messages/CMakeLists.txt rename to lib/ocpp/v2/messages/CMakeLists.txt diff --git a/lib/ocpp/v201/messages/CancelReservation.cpp b/lib/ocpp/v2/messages/CancelReservation.cpp similarity index 96% rename from lib/ocpp/v201/messages/CancelReservation.cpp rename to lib/ocpp/v2/messages/CancelReservation.cpp index b4746eaf7..c98c17c43 100644 --- a/lib/ocpp/v201/messages/CancelReservation.cpp +++ b/lib/ocpp/v2/messages/CancelReservation.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string CancelReservationRequest::get_type() const { return "CancelReservation"; @@ -83,5 +83,5 @@ std::ostream& operator<<(std::ostream& os, const CancelReservationResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/CertificateSigned.cpp b/lib/ocpp/v2/messages/CertificateSigned.cpp similarity index 97% rename from lib/ocpp/v201/messages/CertificateSigned.cpp rename to lib/ocpp/v2/messages/CertificateSigned.cpp index e993a4996..bb4001722 100644 --- a/lib/ocpp/v201/messages/CertificateSigned.cpp +++ b/lib/ocpp/v2/messages/CertificateSigned.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string CertificateSignedRequest::get_type() const { return "CertificateSigned"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const CertificateSignedResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ChangeAvailability.cpp b/lib/ocpp/v2/messages/ChangeAvailability.cpp similarity index 96% rename from lib/ocpp/v201/messages/ChangeAvailability.cpp rename to lib/ocpp/v2/messages/ChangeAvailability.cpp index 1f76b5cd0..2549f1bff 100644 --- a/lib/ocpp/v201/messages/ChangeAvailability.cpp +++ b/lib/ocpp/v2/messages/ChangeAvailability.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ChangeAvailabilityRequest::get_type() const { return "ChangeAvailability"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const ChangeAvailabilityResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ClearCache.cpp b/lib/ocpp/v2/messages/ClearCache.cpp similarity index 96% rename from lib/ocpp/v201/messages/ClearCache.cpp rename to lib/ocpp/v2/messages/ClearCache.cpp index f82682f53..e49c4983c 100644 --- a/lib/ocpp/v201/messages/ClearCache.cpp +++ b/lib/ocpp/v2/messages/ClearCache.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ClearCacheRequest::get_type() const { return "ClearCache"; @@ -80,5 +80,5 @@ std::ostream& operator<<(std::ostream& os, const ClearCacheResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ClearChargingProfile.cpp b/lib/ocpp/v2/messages/ClearChargingProfile.cpp similarity index 97% rename from lib/ocpp/v201/messages/ClearChargingProfile.cpp rename to lib/ocpp/v2/messages/ClearChargingProfile.cpp index 77833b8cd..a049d69d2 100644 --- a/lib/ocpp/v201/messages/ClearChargingProfile.cpp +++ b/lib/ocpp/v2/messages/ClearChargingProfile.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ClearChargingProfileRequest::get_type() const { return "ClearChargingProfile"; @@ -92,5 +92,5 @@ std::ostream& operator<<(std::ostream& os, const ClearChargingProfileResponse& k return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ClearDisplayMessage.cpp b/lib/ocpp/v2/messages/ClearDisplayMessage.cpp similarity index 96% rename from lib/ocpp/v201/messages/ClearDisplayMessage.cpp rename to lib/ocpp/v2/messages/ClearDisplayMessage.cpp index 48c6be9c4..548f7bc77 100644 --- a/lib/ocpp/v201/messages/ClearDisplayMessage.cpp +++ b/lib/ocpp/v2/messages/ClearDisplayMessage.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ClearDisplayMessageRequest::get_type() const { return "ClearDisplayMessage"; @@ -83,5 +83,5 @@ std::ostream& operator<<(std::ostream& os, const ClearDisplayMessageResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ClearVariableMonitoring.cpp b/lib/ocpp/v2/messages/ClearVariableMonitoring.cpp similarity index 96% rename from lib/ocpp/v201/messages/ClearVariableMonitoring.cpp rename to lib/ocpp/v2/messages/ClearVariableMonitoring.cpp index bb100ca0c..9b582bde5 100644 --- a/lib/ocpp/v201/messages/ClearVariableMonitoring.cpp +++ b/lib/ocpp/v2/messages/ClearVariableMonitoring.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ClearVariableMonitoringRequest::get_type() const { return "ClearVariableMonitoring"; @@ -81,5 +81,5 @@ std::ostream& operator<<(std::ostream& os, const ClearVariableMonitoringResponse return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ClearedChargingLimit.cpp b/lib/ocpp/v2/messages/ClearedChargingLimit.cpp similarity index 96% rename from lib/ocpp/v201/messages/ClearedChargingLimit.cpp rename to lib/ocpp/v2/messages/ClearedChargingLimit.cpp index 978659942..d2253b1d6 100644 --- a/lib/ocpp/v201/messages/ClearedChargingLimit.cpp +++ b/lib/ocpp/v2/messages/ClearedChargingLimit.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ClearedChargingLimitRequest::get_type() const { return "ClearedChargingLimit"; @@ -80,5 +80,5 @@ std::ostream& operator<<(std::ostream& os, const ClearedChargingLimitResponse& k return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/CostUpdated.cpp b/lib/ocpp/v2/messages/CostUpdated.cpp similarity index 96% rename from lib/ocpp/v201/messages/CostUpdated.cpp rename to lib/ocpp/v2/messages/CostUpdated.cpp index 4d594334a..76be1f224 100644 --- a/lib/ocpp/v201/messages/CostUpdated.cpp +++ b/lib/ocpp/v2/messages/CostUpdated.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string CostUpdatedRequest::get_type() const { return "CostUpdated"; @@ -76,5 +76,5 @@ std::ostream& operator<<(std::ostream& os, const CostUpdatedResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/CustomerInformation.cpp b/lib/ocpp/v2/messages/CustomerInformation.cpp similarity index 97% rename from lib/ocpp/v201/messages/CustomerInformation.cpp rename to lib/ocpp/v2/messages/CustomerInformation.cpp index 00aa46607..01c8695bd 100644 --- a/lib/ocpp/v201/messages/CustomerInformation.cpp +++ b/lib/ocpp/v2/messages/CustomerInformation.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string CustomerInformationRequest::get_type() const { return "CustomerInformation"; @@ -105,5 +105,5 @@ std::ostream& operator<<(std::ostream& os, const CustomerInformationResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/DataTransfer.cpp b/lib/ocpp/v2/messages/DataTransfer.cpp similarity index 97% rename from lib/ocpp/v201/messages/DataTransfer.cpp rename to lib/ocpp/v2/messages/DataTransfer.cpp index 4f7dd3018..a0bb95dd9 100644 --- a/lib/ocpp/v201/messages/DataTransfer.cpp +++ b/lib/ocpp/v2/messages/DataTransfer.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string DataTransferRequest::get_type() const { return "DataTransfer"; @@ -101,5 +101,5 @@ std::ostream& operator<<(std::ostream& os, const DataTransferResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/DeleteCertificate.cpp b/lib/ocpp/v2/messages/DeleteCertificate.cpp similarity index 96% rename from lib/ocpp/v201/messages/DeleteCertificate.cpp rename to lib/ocpp/v2/messages/DeleteCertificate.cpp index 94a2ffa4f..330e8fa68 100644 --- a/lib/ocpp/v201/messages/DeleteCertificate.cpp +++ b/lib/ocpp/v2/messages/DeleteCertificate.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string DeleteCertificateRequest::get_type() const { return "DeleteCertificate"; @@ -83,5 +83,5 @@ std::ostream& operator<<(std::ostream& os, const DeleteCertificateResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/FirmwareStatusNotification.cpp b/lib/ocpp/v2/messages/FirmwareStatusNotification.cpp similarity index 96% rename from lib/ocpp/v201/messages/FirmwareStatusNotification.cpp rename to lib/ocpp/v2/messages/FirmwareStatusNotification.cpp index 4e58a9b3e..abea2eb8d 100644 --- a/lib/ocpp/v201/messages/FirmwareStatusNotification.cpp +++ b/lib/ocpp/v2/messages/FirmwareStatusNotification.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string FirmwareStatusNotificationRequest::get_type() const { return "FirmwareStatusNotification"; @@ -80,5 +80,5 @@ std::ostream& operator<<(std::ostream& os, const FirmwareStatusNotificationRespo return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/Get15118EVCertificate.cpp b/lib/ocpp/v2/messages/Get15118EVCertificate.cpp similarity index 96% rename from lib/ocpp/v201/messages/Get15118EVCertificate.cpp rename to lib/ocpp/v2/messages/Get15118EVCertificate.cpp index 3016904be..924d9d365 100644 --- a/lib/ocpp/v201/messages/Get15118EVCertificate.cpp +++ b/lib/ocpp/v2/messages/Get15118EVCertificate.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string Get15118EVCertificateRequest::get_type() const { return "Get15118EVCertificate"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const Get15118EVCertificateResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetBaseReport.cpp b/lib/ocpp/v2/messages/GetBaseReport.cpp similarity index 96% rename from lib/ocpp/v201/messages/GetBaseReport.cpp rename to lib/ocpp/v2/messages/GetBaseReport.cpp index 94b0fd917..9a93a7ae6 100644 --- a/lib/ocpp/v201/messages/GetBaseReport.cpp +++ b/lib/ocpp/v2/messages/GetBaseReport.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetBaseReportRequest::get_type() const { return "GetBaseReport"; @@ -85,5 +85,5 @@ std::ostream& operator<<(std::ostream& os, const GetBaseReportResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetCertificateStatus.cpp b/lib/ocpp/v2/messages/GetCertificateStatus.cpp similarity index 96% rename from lib/ocpp/v201/messages/GetCertificateStatus.cpp rename to lib/ocpp/v2/messages/GetCertificateStatus.cpp index 53dcf2457..23cb8f4e6 100644 --- a/lib/ocpp/v201/messages/GetCertificateStatus.cpp +++ b/lib/ocpp/v2/messages/GetCertificateStatus.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetCertificateStatusRequest::get_type() const { return "GetCertificateStatus"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const GetCertificateStatusResponse& k return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetChargingProfiles.cpp b/lib/ocpp/v2/messages/GetChargingProfiles.cpp similarity index 96% rename from lib/ocpp/v201/messages/GetChargingProfiles.cpp rename to lib/ocpp/v2/messages/GetChargingProfiles.cpp index 59079d156..e9081ca4e 100644 --- a/lib/ocpp/v201/messages/GetChargingProfiles.cpp +++ b/lib/ocpp/v2/messages/GetChargingProfiles.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetChargingProfilesRequest::get_type() const { return "GetChargingProfiles"; @@ -91,5 +91,5 @@ std::ostream& operator<<(std::ostream& os, const GetChargingProfilesResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetCompositeSchedule.cpp b/lib/ocpp/v2/messages/GetCompositeSchedule.cpp similarity index 97% rename from lib/ocpp/v201/messages/GetCompositeSchedule.cpp rename to lib/ocpp/v2/messages/GetCompositeSchedule.cpp index fff162552..ff2f5bcc7 100644 --- a/lib/ocpp/v201/messages/GetCompositeSchedule.cpp +++ b/lib/ocpp/v2/messages/GetCompositeSchedule.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetCompositeScheduleRequest::get_type() const { return "GetCompositeSchedule"; @@ -97,5 +97,5 @@ std::ostream& operator<<(std::ostream& os, const GetCompositeScheduleResponse& k return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetDisplayMessages.cpp b/lib/ocpp/v2/messages/GetDisplayMessages.cpp similarity index 97% rename from lib/ocpp/v201/messages/GetDisplayMessages.cpp rename to lib/ocpp/v2/messages/GetDisplayMessages.cpp index 9be7344bc..8237836f4 100644 --- a/lib/ocpp/v201/messages/GetDisplayMessages.cpp +++ b/lib/ocpp/v2/messages/GetDisplayMessages.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetDisplayMessagesRequest::get_type() const { return "GetDisplayMessages"; @@ -109,5 +109,5 @@ std::ostream& operator<<(std::ostream& os, const GetDisplayMessagesResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetInstalledCertificateIds.cpp b/lib/ocpp/v2/messages/GetInstalledCertificateIds.cpp similarity index 97% rename from lib/ocpp/v201/messages/GetInstalledCertificateIds.cpp rename to lib/ocpp/v2/messages/GetInstalledCertificateIds.cpp index 5fd921a4b..aae17f033 100644 --- a/lib/ocpp/v201/messages/GetInstalledCertificateIds.cpp +++ b/lib/ocpp/v2/messages/GetInstalledCertificateIds.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetInstalledCertificateIdsRequest::get_type() const { return "GetInstalledCertificateIds"; @@ -112,5 +112,5 @@ std::ostream& operator<<(std::ostream& os, const GetInstalledCertificateIdsRespo return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetLocalListVersion.cpp b/lib/ocpp/v2/messages/GetLocalListVersion.cpp similarity index 96% rename from lib/ocpp/v201/messages/GetLocalListVersion.cpp rename to lib/ocpp/v2/messages/GetLocalListVersion.cpp index 44225c33c..217089b06 100644 --- a/lib/ocpp/v201/messages/GetLocalListVersion.cpp +++ b/lib/ocpp/v2/messages/GetLocalListVersion.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetLocalListVersionRequest::get_type() const { return "GetLocalListVersion"; @@ -74,5 +74,5 @@ std::ostream& operator<<(std::ostream& os, const GetLocalListVersionResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetLog.cpp b/lib/ocpp/v2/messages/GetLog.cpp similarity index 97% rename from lib/ocpp/v201/messages/GetLog.cpp rename to lib/ocpp/v2/messages/GetLog.cpp index 790b8da03..ae76c8094 100644 --- a/lib/ocpp/v201/messages/GetLog.cpp +++ b/lib/ocpp/v2/messages/GetLog.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetLogRequest::get_type() const { return "GetLog"; @@ -105,5 +105,5 @@ std::ostream& operator<<(std::ostream& os, const GetLogResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetMonitoringReport.cpp b/lib/ocpp/v2/messages/GetMonitoringReport.cpp similarity index 97% rename from lib/ocpp/v201/messages/GetMonitoringReport.cpp rename to lib/ocpp/v2/messages/GetMonitoringReport.cpp index fc4d72990..765e4a9ed 100644 --- a/lib/ocpp/v201/messages/GetMonitoringReport.cpp +++ b/lib/ocpp/v2/messages/GetMonitoringReport.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetMonitoringReportRequest::get_type() const { return "GetMonitoringReport"; @@ -111,5 +111,5 @@ std::ostream& operator<<(std::ostream& os, const GetMonitoringReportResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetReport.cpp b/lib/ocpp/v2/messages/GetReport.cpp similarity index 97% rename from lib/ocpp/v201/messages/GetReport.cpp rename to lib/ocpp/v2/messages/GetReport.cpp index 27b53c7d0..63b76060f 100644 --- a/lib/ocpp/v201/messages/GetReport.cpp +++ b/lib/ocpp/v2/messages/GetReport.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetReportRequest::get_type() const { return "GetReport"; @@ -111,5 +111,5 @@ std::ostream& operator<<(std::ostream& os, const GetReportResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetTransactionStatus.cpp b/lib/ocpp/v2/messages/GetTransactionStatus.cpp similarity index 96% rename from lib/ocpp/v201/messages/GetTransactionStatus.cpp rename to lib/ocpp/v2/messages/GetTransactionStatus.cpp index 80257b150..bff4ced7a 100644 --- a/lib/ocpp/v201/messages/GetTransactionStatus.cpp +++ b/lib/ocpp/v2/messages/GetTransactionStatus.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetTransactionStatusRequest::get_type() const { return "GetTransactionStatus"; @@ -86,5 +86,5 @@ std::ostream& operator<<(std::ostream& os, const GetTransactionStatusResponse& k return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/GetVariables.cpp b/lib/ocpp/v2/messages/GetVariables.cpp similarity index 96% rename from lib/ocpp/v201/messages/GetVariables.cpp rename to lib/ocpp/v2/messages/GetVariables.cpp index 306d7f4cc..f574bf538 100644 --- a/lib/ocpp/v201/messages/GetVariables.cpp +++ b/lib/ocpp/v2/messages/GetVariables.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string GetVariablesRequest::get_type() const { return "GetVariables"; @@ -81,5 +81,5 @@ std::ostream& operator<<(std::ostream& os, const GetVariablesResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/Heartbeat.cpp b/lib/ocpp/v2/messages/Heartbeat.cpp similarity index 96% rename from lib/ocpp/v201/messages/Heartbeat.cpp rename to lib/ocpp/v2/messages/Heartbeat.cpp index 8f6a277d4..7b8538e1e 100644 --- a/lib/ocpp/v201/messages/Heartbeat.cpp +++ b/lib/ocpp/v2/messages/Heartbeat.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string HeartbeatRequest::get_type() const { return "Heartbeat"; @@ -74,5 +74,5 @@ std::ostream& operator<<(std::ostream& os, const HeartbeatResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/InstallCertificate.cpp b/lib/ocpp/v2/messages/InstallCertificate.cpp similarity index 96% rename from lib/ocpp/v201/messages/InstallCertificate.cpp rename to lib/ocpp/v2/messages/InstallCertificate.cpp index cd35e8eb0..ac25ebb86 100644 --- a/lib/ocpp/v201/messages/InstallCertificate.cpp +++ b/lib/ocpp/v2/messages/InstallCertificate.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string InstallCertificateRequest::get_type() const { return "InstallCertificate"; @@ -85,5 +85,5 @@ std::ostream& operator<<(std::ostream& os, const InstallCertificateResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/LogStatusNotification.cpp b/lib/ocpp/v2/messages/LogStatusNotification.cpp similarity index 96% rename from lib/ocpp/v201/messages/LogStatusNotification.cpp rename to lib/ocpp/v2/messages/LogStatusNotification.cpp index f1f61783c..917287916 100644 --- a/lib/ocpp/v201/messages/LogStatusNotification.cpp +++ b/lib/ocpp/v2/messages/LogStatusNotification.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string LogStatusNotificationRequest::get_type() const { return "LogStatusNotification"; @@ -80,5 +80,5 @@ std::ostream& operator<<(std::ostream& os, const LogStatusNotificationResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/MeterValues.cpp b/lib/ocpp/v2/messages/MeterValues.cpp similarity index 96% rename from lib/ocpp/v201/messages/MeterValues.cpp rename to lib/ocpp/v2/messages/MeterValues.cpp index c82d39001..5d2fa98d9 100644 --- a/lib/ocpp/v201/messages/MeterValues.cpp +++ b/lib/ocpp/v2/messages/MeterValues.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string MeterValuesRequest::get_type() const { return "MeterValues"; @@ -78,5 +78,5 @@ std::ostream& operator<<(std::ostream& os, const MeterValuesResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyChargingLimit.cpp b/lib/ocpp/v2/messages/NotifyChargingLimit.cpp similarity index 96% rename from lib/ocpp/v201/messages/NotifyChargingLimit.cpp rename to lib/ocpp/v2/messages/NotifyChargingLimit.cpp index 3c6d244bb..32a190e1c 100644 --- a/lib/ocpp/v201/messages/NotifyChargingLimit.cpp +++ b/lib/ocpp/v2/messages/NotifyChargingLimit.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyChargingLimitRequest::get_type() const { return "NotifyChargingLimit"; @@ -94,5 +94,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyChargingLimitResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyCustomerInformation.cpp b/lib/ocpp/v2/messages/NotifyCustomerInformation.cpp similarity index 96% rename from lib/ocpp/v201/messages/NotifyCustomerInformation.cpp rename to lib/ocpp/v2/messages/NotifyCustomerInformation.cpp index 5785ab4d5..0ce13a307 100644 --- a/lib/ocpp/v201/messages/NotifyCustomerInformation.cpp +++ b/lib/ocpp/v2/messages/NotifyCustomerInformation.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyCustomerInformationRequest::get_type() const { return "NotifyCustomerInformation"; @@ -86,5 +86,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyCustomerInformationRespon return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyDisplayMessages.cpp b/lib/ocpp/v2/messages/NotifyDisplayMessages.cpp similarity index 96% rename from lib/ocpp/v201/messages/NotifyDisplayMessages.cpp rename to lib/ocpp/v2/messages/NotifyDisplayMessages.cpp index 72cd531b3..1c474cee0 100644 --- a/lib/ocpp/v201/messages/NotifyDisplayMessages.cpp +++ b/lib/ocpp/v2/messages/NotifyDisplayMessages.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyDisplayMessagesRequest::get_type() const { return "NotifyDisplayMessages"; @@ -94,5 +94,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyDisplayMessagesResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyEVChargingNeeds.cpp b/lib/ocpp/v2/messages/NotifyEVChargingNeeds.cpp similarity index 96% rename from lib/ocpp/v201/messages/NotifyEVChargingNeeds.cpp rename to lib/ocpp/v2/messages/NotifyEVChargingNeeds.cpp index d3982d576..97cbf572a 100644 --- a/lib/ocpp/v201/messages/NotifyEVChargingNeeds.cpp +++ b/lib/ocpp/v2/messages/NotifyEVChargingNeeds.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyEVChargingNeedsRequest::get_type() const { return "NotifyEVChargingNeeds"; @@ -91,5 +91,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyEVChargingNeedsResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyEVChargingSchedule.cpp b/lib/ocpp/v2/messages/NotifyEVChargingSchedule.cpp similarity index 96% rename from lib/ocpp/v201/messages/NotifyEVChargingSchedule.cpp rename to lib/ocpp/v2/messages/NotifyEVChargingSchedule.cpp index 32ed78d5a..993991080 100644 --- a/lib/ocpp/v201/messages/NotifyEVChargingSchedule.cpp +++ b/lib/ocpp/v2/messages/NotifyEVChargingSchedule.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyEVChargingScheduleRequest::get_type() const { return "NotifyEVChargingSchedule"; @@ -87,5 +87,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyEVChargingScheduleRespons return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyEvent.cpp b/lib/ocpp/v2/messages/NotifyEvent.cpp similarity index 96% rename from lib/ocpp/v201/messages/NotifyEvent.cpp rename to lib/ocpp/v2/messages/NotifyEvent.cpp index 0bf69b82d..a8d0d826c 100644 --- a/lib/ocpp/v201/messages/NotifyEvent.cpp +++ b/lib/ocpp/v2/messages/NotifyEvent.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyEventRequest::get_type() const { return "NotifyEvent"; @@ -86,5 +86,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyEventResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyMonitoringReport.cpp b/lib/ocpp/v2/messages/NotifyMonitoringReport.cpp similarity index 96% rename from lib/ocpp/v201/messages/NotifyMonitoringReport.cpp rename to lib/ocpp/v2/messages/NotifyMonitoringReport.cpp index 1c8351a11..26c227799 100644 --- a/lib/ocpp/v201/messages/NotifyMonitoringReport.cpp +++ b/lib/ocpp/v2/messages/NotifyMonitoringReport.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyMonitoringReportRequest::get_type() const { return "NotifyMonitoringReport"; @@ -98,5 +98,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyMonitoringReportResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/NotifyReport.cpp b/lib/ocpp/v2/messages/NotifyReport.cpp similarity index 97% rename from lib/ocpp/v201/messages/NotifyReport.cpp rename to lib/ocpp/v2/messages/NotifyReport.cpp index 5fce1c968..9f97a350e 100644 --- a/lib/ocpp/v201/messages/NotifyReport.cpp +++ b/lib/ocpp/v2/messages/NotifyReport.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string NotifyReportRequest::get_type() const { return "NotifyReport"; @@ -98,5 +98,5 @@ std::ostream& operator<<(std::ostream& os, const NotifyReportResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/PublishFirmware.cpp b/lib/ocpp/v2/messages/PublishFirmware.cpp similarity index 97% rename from lib/ocpp/v201/messages/PublishFirmware.cpp rename to lib/ocpp/v2/messages/PublishFirmware.cpp index b9331a39e..2b9c0c6fe 100644 --- a/lib/ocpp/v201/messages/PublishFirmware.cpp +++ b/lib/ocpp/v2/messages/PublishFirmware.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string PublishFirmwareRequest::get_type() const { return "PublishFirmware"; @@ -99,5 +99,5 @@ std::ostream& operator<<(std::ostream& os, const PublishFirmwareResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/PublishFirmwareStatusNotification.cpp b/lib/ocpp/v2/messages/PublishFirmwareStatusNotification.cpp similarity index 96% rename from lib/ocpp/v201/messages/PublishFirmwareStatusNotification.cpp rename to lib/ocpp/v2/messages/PublishFirmwareStatusNotification.cpp index 914df0a6e..d2fd4839f 100644 --- a/lib/ocpp/v201/messages/PublishFirmwareStatusNotification.cpp +++ b/lib/ocpp/v2/messages/PublishFirmwareStatusNotification.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string PublishFirmwareStatusNotificationRequest::get_type() const { return "PublishFirmwareStatusNotification"; @@ -94,5 +94,5 @@ std::ostream& operator<<(std::ostream& os, const PublishFirmwareStatusNotificati return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ReportChargingProfiles.cpp b/lib/ocpp/v2/messages/ReportChargingProfiles.cpp similarity index 96% rename from lib/ocpp/v201/messages/ReportChargingProfiles.cpp rename to lib/ocpp/v2/messages/ReportChargingProfiles.cpp index 97d84a87c..c21d0199e 100644 --- a/lib/ocpp/v201/messages/ReportChargingProfiles.cpp +++ b/lib/ocpp/v2/messages/ReportChargingProfiles.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ReportChargingProfilesRequest::get_type() const { return "ReportChargingProfiles"; @@ -88,5 +88,5 @@ std::ostream& operator<<(std::ostream& os, const ReportChargingProfilesResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/RequestStartTransaction.cpp b/lib/ocpp/v2/messages/RequestStartTransaction.cpp similarity index 97% rename from lib/ocpp/v201/messages/RequestStartTransaction.cpp rename to lib/ocpp/v2/messages/RequestStartTransaction.cpp index 1ba362016..98bba3422 100644 --- a/lib/ocpp/v201/messages/RequestStartTransaction.cpp +++ b/lib/ocpp/v2/messages/RequestStartTransaction.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string RequestStartTransactionRequest::get_type() const { return "RequestStartTransaction"; @@ -109,5 +109,5 @@ std::ostream& operator<<(std::ostream& os, const RequestStartTransactionResponse return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/RequestStopTransaction.cpp b/lib/ocpp/v2/messages/RequestStopTransaction.cpp similarity index 96% rename from lib/ocpp/v201/messages/RequestStopTransaction.cpp rename to lib/ocpp/v2/messages/RequestStopTransaction.cpp index 32119cc96..402623af6 100644 --- a/lib/ocpp/v201/messages/RequestStopTransaction.cpp +++ b/lib/ocpp/v2/messages/RequestStopTransaction.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string RequestStopTransactionRequest::get_type() const { return "RequestStopTransaction"; @@ -83,5 +83,5 @@ std::ostream& operator<<(std::ostream& os, const RequestStopTransactionResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ReservationStatusUpdate.cpp b/lib/ocpp/v2/messages/ReservationStatusUpdate.cpp similarity index 96% rename from lib/ocpp/v201/messages/ReservationStatusUpdate.cpp rename to lib/ocpp/v2/messages/ReservationStatusUpdate.cpp index 3a2597b0f..d82a96faf 100644 --- a/lib/ocpp/v201/messages/ReservationStatusUpdate.cpp +++ b/lib/ocpp/v2/messages/ReservationStatusUpdate.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ReservationStatusUpdateRequest::get_type() const { return "ReservationStatusUpdate"; @@ -76,5 +76,5 @@ std::ostream& operator<<(std::ostream& os, const ReservationStatusUpdateResponse return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/ReserveNow.cpp b/lib/ocpp/v2/messages/ReserveNow.cpp similarity index 97% rename from lib/ocpp/v201/messages/ReserveNow.cpp rename to lib/ocpp/v2/messages/ReserveNow.cpp index 38a50eef4..dc80b3e2f 100644 --- a/lib/ocpp/v201/messages/ReserveNow.cpp +++ b/lib/ocpp/v2/messages/ReserveNow.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ReserveNowRequest::get_type() const { return "ReserveNow"; @@ -105,5 +105,5 @@ std::ostream& operator<<(std::ostream& os, const ReserveNowResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/Reset.cpp b/lib/ocpp/v2/messages/Reset.cpp similarity index 97% rename from lib/ocpp/v201/messages/Reset.cpp rename to lib/ocpp/v2/messages/Reset.cpp index 08efd6df8..2e955486c 100644 --- a/lib/ocpp/v201/messages/Reset.cpp +++ b/lib/ocpp/v2/messages/Reset.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string ResetRequest::get_type() const { return "Reset"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const ResetResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SecurityEventNotification.cpp b/lib/ocpp/v2/messages/SecurityEventNotification.cpp similarity index 96% rename from lib/ocpp/v201/messages/SecurityEventNotification.cpp rename to lib/ocpp/v2/messages/SecurityEventNotification.cpp index cbb95e4a2..419f2f5ed 100644 --- a/lib/ocpp/v201/messages/SecurityEventNotification.cpp +++ b/lib/ocpp/v2/messages/SecurityEventNotification.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SecurityEventNotificationRequest::get_type() const { return "SecurityEventNotification"; @@ -82,5 +82,5 @@ std::ostream& operator<<(std::ostream& os, const SecurityEventNotificationRespon return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SendLocalList.cpp b/lib/ocpp/v2/messages/SendLocalList.cpp similarity index 97% rename from lib/ocpp/v201/messages/SendLocalList.cpp rename to lib/ocpp/v2/messages/SendLocalList.cpp index 5ead4c62a..00ed7fcbb 100644 --- a/lib/ocpp/v201/messages/SendLocalList.cpp +++ b/lib/ocpp/v2/messages/SendLocalList.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SendLocalListRequest::get_type() const { return "SendLocalList"; @@ -99,5 +99,5 @@ std::ostream& operator<<(std::ostream& os, const SendLocalListResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SetChargingProfile.cpp b/lib/ocpp/v2/messages/SetChargingProfile.cpp similarity index 96% rename from lib/ocpp/v201/messages/SetChargingProfile.cpp rename to lib/ocpp/v2/messages/SetChargingProfile.cpp index 1eeb44dad..9f0f03f16 100644 --- a/lib/ocpp/v201/messages/SetChargingProfile.cpp +++ b/lib/ocpp/v2/messages/SetChargingProfile.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SetChargingProfileRequest::get_type() const { return "SetChargingProfile"; @@ -85,5 +85,5 @@ std::ostream& operator<<(std::ostream& os, const SetChargingProfileResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SetDisplayMessage.cpp b/lib/ocpp/v2/messages/SetDisplayMessage.cpp similarity index 96% rename from lib/ocpp/v201/messages/SetDisplayMessage.cpp rename to lib/ocpp/v2/messages/SetDisplayMessage.cpp index 6a94ade5b..a37713d3a 100644 --- a/lib/ocpp/v201/messages/SetDisplayMessage.cpp +++ b/lib/ocpp/v2/messages/SetDisplayMessage.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SetDisplayMessageRequest::get_type() const { return "SetDisplayMessage"; @@ -83,5 +83,5 @@ std::ostream& operator<<(std::ostream& os, const SetDisplayMessageResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SetMonitoringBase.cpp b/lib/ocpp/v2/messages/SetMonitoringBase.cpp similarity index 96% rename from lib/ocpp/v201/messages/SetMonitoringBase.cpp rename to lib/ocpp/v2/messages/SetMonitoringBase.cpp index 76ba7a18c..f9301d071 100644 --- a/lib/ocpp/v201/messages/SetMonitoringBase.cpp +++ b/lib/ocpp/v2/messages/SetMonitoringBase.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SetMonitoringBaseRequest::get_type() const { return "SetMonitoringBase"; @@ -83,5 +83,5 @@ std::ostream& operator<<(std::ostream& os, const SetMonitoringBaseResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SetMonitoringLevel.cpp b/lib/ocpp/v2/messages/SetMonitoringLevel.cpp similarity index 96% rename from lib/ocpp/v201/messages/SetMonitoringLevel.cpp rename to lib/ocpp/v2/messages/SetMonitoringLevel.cpp index 747a77d35..7633531b1 100644 --- a/lib/ocpp/v201/messages/SetMonitoringLevel.cpp +++ b/lib/ocpp/v2/messages/SetMonitoringLevel.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SetMonitoringLevelRequest::get_type() const { return "SetMonitoringLevel"; @@ -83,5 +83,5 @@ std::ostream& operator<<(std::ostream& os, const SetMonitoringLevelResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SetNetworkProfile.cpp b/lib/ocpp/v2/messages/SetNetworkProfile.cpp similarity index 96% rename from lib/ocpp/v201/messages/SetNetworkProfile.cpp rename to lib/ocpp/v2/messages/SetNetworkProfile.cpp index b610407a3..1cccc2ef4 100644 --- a/lib/ocpp/v201/messages/SetNetworkProfile.cpp +++ b/lib/ocpp/v2/messages/SetNetworkProfile.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SetNetworkProfileRequest::get_type() const { return "SetNetworkProfile"; @@ -85,5 +85,5 @@ std::ostream& operator<<(std::ostream& os, const SetNetworkProfileResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SetVariableMonitoring.cpp b/lib/ocpp/v2/messages/SetVariableMonitoring.cpp similarity index 96% rename from lib/ocpp/v201/messages/SetVariableMonitoring.cpp rename to lib/ocpp/v2/messages/SetVariableMonitoring.cpp index 0d6672c8e..0de0cc67f 100644 --- a/lib/ocpp/v201/messages/SetVariableMonitoring.cpp +++ b/lib/ocpp/v2/messages/SetVariableMonitoring.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SetVariableMonitoringRequest::get_type() const { return "SetVariableMonitoring"; @@ -81,5 +81,5 @@ std::ostream& operator<<(std::ostream& os, const SetVariableMonitoringResponse& return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SetVariables.cpp b/lib/ocpp/v2/messages/SetVariables.cpp similarity index 96% rename from lib/ocpp/v201/messages/SetVariables.cpp rename to lib/ocpp/v2/messages/SetVariables.cpp index f12c957a5..6bf264c95 100644 --- a/lib/ocpp/v201/messages/SetVariables.cpp +++ b/lib/ocpp/v2/messages/SetVariables.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SetVariablesRequest::get_type() const { return "SetVariables"; @@ -81,5 +81,5 @@ std::ostream& operator<<(std::ostream& os, const SetVariablesResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/SignCertificate.cpp b/lib/ocpp/v2/messages/SignCertificate.cpp similarity index 96% rename from lib/ocpp/v201/messages/SignCertificate.cpp rename to lib/ocpp/v2/messages/SignCertificate.cpp index c2e90a330..f8a529976 100644 --- a/lib/ocpp/v201/messages/SignCertificate.cpp +++ b/lib/ocpp/v2/messages/SignCertificate.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string SignCertificateRequest::get_type() const { return "SignCertificate"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const SignCertificateResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/StatusNotification.cpp b/lib/ocpp/v2/messages/StatusNotification.cpp similarity index 96% rename from lib/ocpp/v201/messages/StatusNotification.cpp rename to lib/ocpp/v2/messages/StatusNotification.cpp index e4cdbbc1a..921f2838b 100644 --- a/lib/ocpp/v201/messages/StatusNotification.cpp +++ b/lib/ocpp/v2/messages/StatusNotification.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string StatusNotificationRequest::get_type() const { return "StatusNotification"; @@ -80,5 +80,5 @@ std::ostream& operator<<(std::ostream& os, const StatusNotificationResponse& k) return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/TransactionEvent.cpp b/lib/ocpp/v2/messages/TransactionEvent.cpp similarity index 98% rename from lib/ocpp/v201/messages/TransactionEvent.cpp rename to lib/ocpp/v2/messages/TransactionEvent.cpp index 8f354cdfa..ccf0b4a31 100644 --- a/lib/ocpp/v201/messages/TransactionEvent.cpp +++ b/lib/ocpp/v2/messages/TransactionEvent.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string TransactionEventRequest::get_type() const { return "TransactionEvent"; @@ -156,5 +156,5 @@ std::ostream& operator<<(std::ostream& os, const TransactionEventResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/TriggerMessage.cpp b/lib/ocpp/v2/messages/TriggerMessage.cpp similarity index 96% rename from lib/ocpp/v201/messages/TriggerMessage.cpp rename to lib/ocpp/v2/messages/TriggerMessage.cpp index 5751e1b3c..adb6cfad1 100644 --- a/lib/ocpp/v201/messages/TriggerMessage.cpp +++ b/lib/ocpp/v2/messages/TriggerMessage.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string TriggerMessageRequest::get_type() const { return "TriggerMessage"; @@ -89,5 +89,5 @@ std::ostream& operator<<(std::ostream& os, const TriggerMessageResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/UnlockConnector.cpp b/lib/ocpp/v2/messages/UnlockConnector.cpp similarity index 96% rename from lib/ocpp/v201/messages/UnlockConnector.cpp rename to lib/ocpp/v2/messages/UnlockConnector.cpp index c0ee59b54..238c189c1 100644 --- a/lib/ocpp/v201/messages/UnlockConnector.cpp +++ b/lib/ocpp/v2/messages/UnlockConnector.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string UnlockConnectorRequest::get_type() const { return "UnlockConnector"; @@ -85,5 +85,5 @@ std::ostream& operator<<(std::ostream& os, const UnlockConnectorResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/UnpublishFirmware.cpp b/lib/ocpp/v2/messages/UnpublishFirmware.cpp similarity index 96% rename from lib/ocpp/v201/messages/UnpublishFirmware.cpp rename to lib/ocpp/v2/messages/UnpublishFirmware.cpp index f17747c54..409821872 100644 --- a/lib/ocpp/v201/messages/UnpublishFirmware.cpp +++ b/lib/ocpp/v2/messages/UnpublishFirmware.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string UnpublishFirmwareRequest::get_type() const { return "UnpublishFirmware"; @@ -77,5 +77,5 @@ std::ostream& operator<<(std::ostream& os, const UnpublishFirmwareResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/messages/UpdateFirmware.cpp b/lib/ocpp/v2/messages/UpdateFirmware.cpp similarity index 97% rename from lib/ocpp/v201/messages/UpdateFirmware.cpp rename to lib/ocpp/v2/messages/UpdateFirmware.cpp index 8597c11b9..ee10dd692 100644 --- a/lib/ocpp/v201/messages/UpdateFirmware.cpp +++ b/lib/ocpp/v2/messages/UpdateFirmware.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -11,7 +11,7 @@ using json = nlohmann::json; namespace ocpp { -namespace v201 { +namespace v2 { std::string UpdateFirmwareRequest::get_type() const { return "UpdateFirmware"; @@ -97,5 +97,5 @@ std::ostream& operator<<(std::ostream& os, const UpdateFirmwareResponse& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/monitoring_updater.cpp b/lib/ocpp/v2/monitoring_updater.cpp similarity index 99% rename from lib/ocpp/v201/monitoring_updater.cpp rename to lib/ocpp/v2/monitoring_updater.cpp index b3ed92e28..6508e4e42 100644 --- a/lib/ocpp/v201/monitoring_updater.cpp +++ b/lib/ocpp/v2/monitoring_updater.cpp @@ -1,15 +1,15 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest -#include +#include #include -#include -#include -#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { template bool triggers_monitor(const VariableMonitoringMeta& monitor_meta, const std::string& value_old, @@ -690,4 +690,4 @@ void MonitoringUpdater::get_monitoring_info(bool& out_is_offline, int& out_offli out_active_monitoring_base = conversions::string_to_monitoring_base_enum(active_monitoring_base_string); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/notify_report_requests_splitter.cpp b/lib/ocpp/v2/notify_report_requests_splitter.cpp similarity index 88% rename from lib/ocpp/v201/notify_report_requests_splitter.cpp rename to lib/ocpp/v2/notify_report_requests_splitter.cpp index 9bda1da6d..d34b5203c 100644 --- a/lib/ocpp/v201/notify_report_requests_splitter.cpp +++ b/lib/ocpp/v2/notify_report_requests_splitter.cpp @@ -2,10 +2,10 @@ // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { const std::string NotifyReportRequestsSplitter::MESSAGE_TYPE = conversions::messagetype_to_string(MessageType::NotifyReport); @@ -38,8 +38,8 @@ std::vector NotifyReportRequestsSplitter::create_call_payloads() { } json NotifyReportRequestsSplitter::create_next_report_data_json( - std::vector::const_iterator& report_data_iterator, - const std::vector::const_iterator& report_data_end, const size_t& remaining_size) { + std::vector::const_iterator& report_data_iterator, + const std::vector::const_iterator& report_data_end, const size_t& remaining_size) { if (report_data_iterator == report_data_end) { return json::array(); @@ -69,8 +69,8 @@ json NotifyReportRequestsSplitter::create_next_report_data_json( } json NotifyReportRequestsSplitter::create_next_payload( - const int& seq_no, std::vector::const_iterator& report_data_iterator, - const std::vector::const_iterator& report_data_end, const std::string& message_id) { + const int& seq_no, std::vector::const_iterator& report_data_iterator, + const std::vector::const_iterator& report_data_end, const std::string& message_id) { json call_base{MessageTypeId::CALL, message_id, MESSAGE_TYPE}; @@ -108,5 +108,5 @@ size_t NotifyReportRequestsSplitter::create_request_template_json_and_return_ske std::string{R"(,"reportData":)"}.size(); } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/ocpp_enums.cpp b/lib/ocpp/v2/ocpp_enums.cpp similarity index 99% rename from lib/ocpp/v201/ocpp_enums.cpp rename to lib/ocpp/v2/ocpp_enums.cpp index 56b1a8891..59e584758 100644 --- a/lib/ocpp/v201/ocpp_enums.cpp +++ b/lib/ocpp/v2/ocpp_enums.cpp @@ -2,14 +2,14 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include namespace ocpp { -namespace v201 { +namespace v2 { // from: AuthorizeRequest namespace conversions { @@ -3927,5 +3927,5 @@ std::ostream& operator<<(std::ostream& os, const UpdateFirmwareStatusEnum& updat return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/ocpp_types.cpp b/lib/ocpp/v2/ocpp_types.cpp similarity index 99% rename from lib/ocpp/v201/ocpp_types.cpp rename to lib/ocpp/v2/ocpp_types.cpp index b842115e8..f03fbfea9 100644 --- a/lib/ocpp/v201/ocpp_types.cpp +++ b/lib/ocpp/v2/ocpp_types.cpp @@ -2,7 +2,7 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest // This code is generated using the generator in 'src/code_generator/common`, please do not edit manually -#include +#include #include #include @@ -10,10 +10,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { /// \brief Conversion from a given AdditionalInfo \p k to a given json object \p j void to_json(json& j, const AdditionalInfo& k) { @@ -2544,5 +2544,5 @@ std::ostream& operator<<(std::ostream& os, const Firmware& k) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/ocsp_updater.cpp b/lib/ocpp/v2/ocsp_updater.cpp similarity index 92% rename from lib/ocpp/v201/ocsp_updater.cpp rename to lib/ocpp/v2/ocsp_updater.cpp index 52cf344e9..2b22a0557 100644 --- a/lib/ocpp/v201/ocsp_updater.cpp +++ b/lib/ocpp/v2/ocsp_updater.cpp @@ -7,12 +7,12 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { OcspUpdater::OcspUpdater(std::shared_ptr evse_security, cert_status_func get_cert_status_from_csms, std::chrono::seconds ocsp_cache_update_interval, @@ -105,13 +105,13 @@ void OcspUpdater::execute_ocsp_update() { GetCertificateStatusRequest request; switch (ocsp_request.hashAlgorithm) { case HashAlgorithmEnumType::SHA256: - request.ocspRequestData.hashAlgorithm = ocpp::v201::HashAlgorithmEnum::SHA256; + request.ocspRequestData.hashAlgorithm = ocpp::v2::HashAlgorithmEnum::SHA256; break; case HashAlgorithmEnumType::SHA384: - request.ocspRequestData.hashAlgorithm = ocpp::v201::HashAlgorithmEnum::SHA384; + request.ocspRequestData.hashAlgorithm = ocpp::v2::HashAlgorithmEnum::SHA384; break; case HashAlgorithmEnumType::SHA512: - request.ocspRequestData.hashAlgorithm = ocpp::v201::HashAlgorithmEnum::SHA512; + request.ocspRequestData.hashAlgorithm = ocpp::v2::HashAlgorithmEnum::SHA512; break; } request.ocspRequestData.issuerKeyHash = ocsp_request.issuerKeyHash; @@ -147,4 +147,4 @@ void OcspUpdater::execute_ocsp_update() { EVLOG_info << "libocpp: Done updating OCSP cache"; } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/lib/ocpp/v201/profile.cpp b/lib/ocpp/v2/profile.cpp similarity index 99% rename from lib/ocpp/v201/profile.cpp rename to lib/ocpp/v2/profile.cpp index 9d8aa97d4..fac2d3de5 100644 --- a/lib/ocpp/v201/profile.cpp +++ b/lib/ocpp/v2/profile.cpp @@ -1,16 +1,16 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest -#include "ocpp/v201/profile.hpp" +#include "ocpp/v2/profile.hpp" #include "everest/logging.hpp" #include -#include +#include using std::chrono::duration_cast; using std::chrono::seconds; namespace ocpp { -namespace v201 { +namespace v2 { int32_t elapsed_seconds(const ocpp::DateTime& to, const ocpp::DateTime& from) { return duration_cast(to.to_time_point() - from.to_time_point()).count(); @@ -591,5 +591,5 @@ convert_intermediate_into_schedule(const IntermediateProfile& profile, ChargingR return output; } -} // namespace v201 +} // namespace v2 } // namespace ocpp \ No newline at end of file diff --git a/lib/ocpp/v201/transaction.cpp b/lib/ocpp/v2/transaction.cpp similarity index 93% rename from lib/ocpp/v201/transaction.cpp rename to lib/ocpp/v2/transaction.cpp index d60a2c9d3..9728b217f 100644 --- a/lib/ocpp/v201/transaction.cpp +++ b/lib/ocpp/v2/transaction.cpp @@ -1,14 +1,14 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest -#include -#include +#include +#include using QueryExecutionException = ocpp::common::QueryExecutionException; namespace ocpp { -namespace v201 { +namespace v2 { Transaction EnhancedTransaction::get_transaction() { Transaction transaction = {this->transactionId, std::nullopt, this->chargingState, @@ -50,6 +50,6 @@ void EnhancedTransaction::set_id_token_sent() { } } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/types.cpp b/lib/ocpp/v2/types.cpp similarity index 99% rename from lib/ocpp/v201/types.cpp rename to lib/ocpp/v2/types.cpp index db62f0d78..42933bd9d 100644 --- a/lib/ocpp/v201/types.cpp +++ b/lib/ocpp/v2/types.cpp @@ -3,10 +3,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { namespace conversions { @@ -543,5 +543,5 @@ std::ostream& operator<<(std::ostream& os, const MessageType& message_type) { return os; } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/utils.cpp b/lib/ocpp/v2/utils.cpp similarity index 99% rename from lib/ocpp/v201/utils.cpp rename to lib/ocpp/v2/utils.cpp index 7f6ebaadd..3b57286e3 100644 --- a/lib/ocpp/v201/utils.cpp +++ b/lib/ocpp/v2/utils.cpp @@ -8,10 +8,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { namespace utils { std::vector get_measurands_vec(const std::string& measurands_csv) { @@ -211,5 +211,5 @@ std::vector get_purposes_to_ignore(const std::string } } // namespace utils -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/lib/ocpp/v201/message_queue.cpp b/lib/ocpp/v201/message_queue.cpp deleted file mode 100644 index f7d310af7..000000000 --- a/lib/ocpp/v201/message_queue.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest - -#include - -#include - -namespace ocpp { - -bool is_transaction_message(const ocpp::v201::MessageType message_type) { - return (message_type == v201::MessageType::TransactionEvent) || - (message_type == v201::MessageType::SecurityEventNotification); -} - -bool is_start_transaction_message(const ocpp::v201::MessageType message_type) { - return false; -} - -bool is_boot_notification_message(const ocpp::v201::MessageType message_type) { - return message_type == ocpp::v201::MessageType::BootNotification; -} - -template <> bool ControlMessage::is_transaction_update_message() const { - if (this->messageType == v201::MessageType::TransactionEvent) { - return v201::TransactionEventRequest{this->message.at(CALL_PAYLOAD)}.eventType == - v201::TransactionEventEnum::Updated; - } - return false; -} - -template <> -ControlMessage::ControlMessage(const json& message, const bool stall_until_accepted) : - message(message.get()), - messageType(v201::conversions::string_to_messagetype(message.at(CALL_ACTION))), - message_attempts(0), - initial_unique_id(message[MESSAGE_ID]), - stall_until_accepted(stall_until_accepted) { -} - -template <> v201::MessageType MessageQueue::string_to_messagetype(const std::string& s) { - return v201::conversions::string_to_messagetype(s); -} - -template <> std::string MessageQueue::messagetype_to_string(const v201::MessageType m) { - return v201::conversions::messagetype_to_string(m); -} - -} // namespace ocpp diff --git a/src/code_generator/README.md b/src/code_generator/README.md index f2e0bffb7..007627483 100644 --- a/src/code_generator/README.md +++ b/src/code_generator/README.md @@ -1,8 +1,8 @@ # Libocpp Code Generators In this directory a collection of code generators for various purposes are located. -## C++ Code generator for v16 and v201 -The script [generate_cpp.py](common/generate_cpp.py) can be used to generate datatypes, enums, and messages for v16 and v201. +## C++ Code generator for v16 and v2 +The script [generate_cpp.py](common/generate_cpp.py) can be used to generate datatypes, enums, and messages for v16 and v2. ```bash python3 generate_cpp.py --schemas --out --version @@ -15,5 +15,5 @@ python3 generate_cpp.py --schemas ~/ocpp-schemas/v16/ --out ~/checkout/everest-w ``` ```bash -python3 generate_cpp.py --schemas ~/ocpp-schemas/v201/ --out ~/checkout/everest-workspace/libocpp --version v201 +python3 generate_cpp.py --schemas ~/ocpp-schemas/v2/ --out ~/checkout/everest-workspace/libocpp --version v2 ``` diff --git a/src/code_generator/common/generate_cpp.py b/src/code_generator/common/generate_cpp.py index da2c2bd16..adb0dc368 100644 --- a/src/code_generator/common/generate_cpp.py +++ b/src/code_generator/common/generate_cpp.py @@ -614,7 +614,7 @@ def parse_schemas(version: str, schema_dir: Path = Path('schemas/json/'), if version == '1.6' or version == '16' or version == 'v16': version_path = 'v16' elif version == '2.0.1' or version == '201' or version == 'v201': - version_path = 'v201' + version_path = 'v2' else: raise ValueError(f"Version {version} not a valid ocpp version") diff --git a/src/code_generator/common/templates/ocpp_types.cpp.jinja b/src/code_generator/common/templates/ocpp_types.cpp.jinja index 0b58d230d..3d30a5893 100644 --- a/src/code_generator/common/templates/ocpp_types.cpp.jinja +++ b/src/code_generator/common/templates/ocpp_types.cpp.jinja @@ -18,7 +18,7 @@ namespace {{namespace}} { {% endif %} {%- if parsed_types|length %} {%- for type in parsed_types %} -{% if not type.name.endswith('Request') and not type.name.endswith('Response') and not (type.name == "CustomData" and namespace == "v201") %} +{% if not type.name.endswith('Request') and not type.name.endswith('Response') and not (type.name == "CustomData" and namespace == "v2") %} /// \brief Conversion from a given {{ type.name }} \p k to a given json object \p j void to_json(json& j, const {{ type.name }}& k) { diff --git a/src/code_generator/common/templates/ocpp_types.hpp.jinja b/src/code_generator/common/templates/ocpp_types.hpp.jinja index c544b0d2e..2993fa35f 100644 --- a/src/code_generator/common/templates/ocpp_types.hpp.jinja +++ b/src/code_generator/common/templates/ocpp_types.hpp.jinja @@ -24,7 +24,7 @@ namespace {{namespace}} { {%- for type in parsed_types %} {% if not type.name.endswith('Request') and not type.name.endswith('Response') %} -{% if type.name == "CustomData" and namespace == "v201" %} +{% if type.name == "CustomData" and namespace == "v2" %} using CustomData = nlohmann::json; {% else %} struct {{type.name}} { @@ -36,7 +36,7 @@ struct {{type.name}} { {% endfor %} }; {% endif %} -{% if not (type.name == "CustomData" and namespace == "v201") %} +{% if not (type.name == "CustomData" and namespace == "v2") %} /// \brief Conversion from a given {{ type.name }} \p k to a given json object \p j void to_json(json& j, const {{ type.name }}& k); @@ -52,7 +52,7 @@ struct {{type.name}} { {% endfor %} {%- endif %} {% if last %} -{% if namespace == "v201" %} +{% if namespace == "v2" %} struct RequiredComponentVariable : ComponentVariable {}; {% endif %} } // namespace {{namespace}} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 12d1c1623..cd18a55ab 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,20 +3,20 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/libocpp-unittests.cmake) # For libocpp tests, there is one big executable, which links against the ocpp lib and all other libs. # When it is useful to link only to the tested cpp files, a separate executable can be created for each file. # The source files can be added to this variable, which is a list. For example: -# list(APPEND SEPARATE_UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/v201/functional_blocks/test_security.cpp) +# list(APPEND SEPARATE_UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/v2/functional_blocks/test_security.cpp) # CMake will then create a new test executable based on the filename and adds 'libocpp_' in front of it. In above # example, a test executable 'libocpp_test_security' will be created. In this example, in the CMakeLists of -# `lib/ocpp/v201/functional_blocks`, files to link against can be added to this target / executable. +# `lib/ocpp/v2/functional_blocks`, files to link against can be added to this target / executable. # # For each test in this list, cmake will link agaist some 'default' cpp files (like utils and enums etc), set all # correct flags, add a test, set definitions, etc. See below. set(SEPARATE_UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/common/utils_tests.cpp) -# Add separate tests for V201 only. -if(LIBOCPP_ENABLE_V201) - # Add all v201 tests you don't want to include in the default test executable here. - list(APPEND SEPARATE_UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/v201/functional_blocks/test_authorization.cpp) - list(APPEND SEPARATE_UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/v201/functional_blocks/test_security.cpp) +# Add separate tests for V2 only. +if(LIBOCPP_ENABLE_V2) + # Add all v2 tests you don't want to include in the default test executable here. + list(APPEND SEPARATE_UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/v2/functional_blocks/test_authorization.cpp) + list(APPEND SEPARATE_UNIT_TESTS ${CMAKE_CURRENT_SOURCE_DIR}/lib/ocpp/v2/functional_blocks/test_security.cpp) endif() @@ -51,8 +51,8 @@ if(LIBOCPP_ENABLE_V16) add_subdirectory(lib/ocpp/v16) endif() -if(LIBOCPP_ENABLE_V201) - add_subdirectory(lib/ocpp/v201) +if(LIBOCPP_ENABLE_V2) + add_subdirectory(lib/ocpp/v2) endif() add_custom_command(TARGET libocpp_unit_tests POST_BUILD @@ -64,18 +64,18 @@ add_custom_command(TARGET libocpp_unit_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${OCPP1_6_CONFIG_DIR} ${CONFIG_DIR_V16} COMMAND ${CMAKE_COMMAND} -E remove_directory ${MIGRATION_FILES_LOCATION_V16} COMMAND ${CMAKE_COMMAND} -E copy_directory ${MIGRATION_FILES_SOURCE_DIR_V16} ${MIGRATION_FILES_LOCATION_V16} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MIGRATION_FILES_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${MIGRATION_FILES_SOURCE_DIR_V201} ${MIGRATION_FILES_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${MIGRATION_FILES_DEVICE_MODEL_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${MIGRATION_FILES_DEVICE_MODEL_SOURCE_DIR_V201} ${MIGRATION_FILES_DEVICE_MODEL_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_RESOURCES_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_RESOURCES_DIR} ${DEVICE_MODEL_RESOURCES_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_RESOURCES_CHANGED_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_CHANGED_RESOURCES_DIR} ${DEVICE_MODEL_RESOURCES_CHANGED_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_RESOURCES_WRONG_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_WRONG_RESOURCES_DIR} ${DEVICE_MODEL_RESOURCES_WRONG_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_EXAMPLE_CONFIG_LOCATION_V201} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_EXAMPLE_CONFIG_LOCATION_V201} ${DEVICE_MODEL_EXAMPLE_CONFIG_LOCATION_V201} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MIGRATION_FILES_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${MIGRATION_FILES_SOURCE_DIR_V2} ${MIGRATION_FILES_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${MIGRATION_FILES_DEVICE_MODEL_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${MIGRATION_FILES_DEVICE_MODEL_SOURCE_DIR_V2} ${MIGRATION_FILES_DEVICE_MODEL_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_RESOURCES_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_RESOURCES_DIR} ${DEVICE_MODEL_RESOURCES_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_RESOURCES_CHANGED_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_CHANGED_RESOURCES_DIR} ${DEVICE_MODEL_RESOURCES_CHANGED_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_RESOURCES_WRONG_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_WRONG_RESOURCES_DIR} ${DEVICE_MODEL_RESOURCES_WRONG_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E remove_directory ${DEVICE_MODEL_EXAMPLE_CONFIG_LOCATION_V2} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEVICE_MODEL_CURRENT_EXAMPLE_CONFIG_LOCATION_V2} ${DEVICE_MODEL_EXAMPLE_CONFIG_LOCATION_V2} ) set(GCOVR_ADDITIONAL_ARGS "--gcov-ignore-parse-errors=negative_hits.warn") diff --git a/tests/config/v2/pytest.ini b/tests/config/v2/pytest.ini new file mode 100644 index 000000000..b20584b61 --- /dev/null +++ b/tests/config/v2/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +pythonpath=../../../config/v2 \ No newline at end of file diff --git a/tests/config/v201/resources/component_config/custom/Connector_1_1.json b/tests/config/v2/resources/component_config/custom/Connector_1_1.json similarity index 100% rename from tests/config/v201/resources/component_config/custom/Connector_1_1.json rename to tests/config/v2/resources/component_config/custom/Connector_1_1.json diff --git a/tests/config/v201/resources/component_config/custom/Connector_2_1.json b/tests/config/v2/resources/component_config/custom/Connector_2_1.json similarity index 100% rename from tests/config/v201/resources/component_config/custom/Connector_2_1.json rename to tests/config/v2/resources/component_config/custom/Connector_2_1.json diff --git a/tests/config/v201/resources/component_config/custom/EVSE_1.json b/tests/config/v2/resources/component_config/custom/EVSE_1.json similarity index 100% rename from tests/config/v201/resources/component_config/custom/EVSE_1.json rename to tests/config/v2/resources/component_config/custom/EVSE_1.json diff --git a/tests/config/v201/resources/component_config/custom/EVSE_2.json b/tests/config/v2/resources/component_config/custom/EVSE_2.json similarity index 100% rename from tests/config/v201/resources/component_config/custom/EVSE_2.json rename to tests/config/v2/resources/component_config/custom/EVSE_2.json diff --git a/tests/config/v201/resources/component_config/standardized/UnitTestCtrlr.json b/tests/config/v2/resources/component_config/standardized/UnitTestCtrlr.json similarity index 100% rename from tests/config/v201/resources/component_config/standardized/UnitTestCtrlr.json rename to tests/config/v2/resources/component_config/standardized/UnitTestCtrlr.json diff --git a/tests/config/v201/resources_changed/component_config/custom/Connector_1_1.json b/tests/config/v2/resources_changed/component_config/custom/Connector_1_1.json similarity index 100% rename from tests/config/v201/resources_changed/component_config/custom/Connector_1_1.json rename to tests/config/v2/resources_changed/component_config/custom/Connector_1_1.json diff --git a/tests/config/v201/resources_changed/component_config/custom/Connector_2_2.json b/tests/config/v2/resources_changed/component_config/custom/Connector_2_2.json similarity index 100% rename from tests/config/v201/resources_changed/component_config/custom/Connector_2_2.json rename to tests/config/v2/resources_changed/component_config/custom/Connector_2_2.json diff --git a/tests/config/v201/resources_changed/component_config/custom/EVSE_1.json b/tests/config/v2/resources_changed/component_config/custom/EVSE_1.json similarity index 100% rename from tests/config/v201/resources_changed/component_config/custom/EVSE_1.json rename to tests/config/v2/resources_changed/component_config/custom/EVSE_1.json diff --git a/tests/config/v201/resources_changed/component_config/custom/EVSE_2.json b/tests/config/v2/resources_changed/component_config/custom/EVSE_2.json similarity index 100% rename from tests/config/v201/resources_changed/component_config/custom/EVSE_2.json rename to tests/config/v2/resources_changed/component_config/custom/EVSE_2.json diff --git a/tests/config/v201/resources_changed/component_config/custom/EVSE_3.json b/tests/config/v2/resources_changed/component_config/custom/EVSE_3.json similarity index 100% rename from tests/config/v201/resources_changed/component_config/custom/EVSE_3.json rename to tests/config/v2/resources_changed/component_config/custom/EVSE_3.json diff --git a/tests/config/v201/resources_changed/component_config/standardized/UnitTestCtrlr.json b/tests/config/v2/resources_changed/component_config/standardized/UnitTestCtrlr.json similarity index 100% rename from tests/config/v201/resources_changed/component_config/standardized/UnitTestCtrlr.json rename to tests/config/v2/resources_changed/component_config/standardized/UnitTestCtrlr.json diff --git a/tests/config/v201/resources_wrong/component_config_required_no_value/custom/Connector_1_1.json b/tests/config/v2/resources_wrong/component_config_required_no_value/custom/Connector_1_1.json similarity index 100% rename from tests/config/v201/resources_wrong/component_config_required_no_value/custom/Connector_1_1.json rename to tests/config/v2/resources_wrong/component_config_required_no_value/custom/Connector_1_1.json diff --git a/tests/config/v201/resources_wrong/component_config_required_no_value/custom/EVSE_1.json b/tests/config/v2/resources_wrong/component_config_required_no_value/custom/EVSE_1.json similarity index 100% rename from tests/config/v201/resources_wrong/component_config_required_no_value/custom/EVSE_1.json rename to tests/config/v2/resources_wrong/component_config_required_no_value/custom/EVSE_1.json diff --git a/tests/config/v201/resources_wrong/component_config_required_no_value/standardized/UnitTestCtrlr.json b/tests/config/v2/resources_wrong/component_config_required_no_value/standardized/UnitTestCtrlr.json similarity index 100% rename from tests/config/v201/resources_wrong/component_config_required_no_value/standardized/UnitTestCtrlr.json rename to tests/config/v2/resources_wrong/component_config_required_no_value/standardized/UnitTestCtrlr.json diff --git a/tests/config/v201/resources_wrong/component_config_wrong_value_type/custom/Connector_1_1.json b/tests/config/v2/resources_wrong/component_config_wrong_value_type/custom/Connector_1_1.json similarity index 100% rename from tests/config/v201/resources_wrong/component_config_wrong_value_type/custom/Connector_1_1.json rename to tests/config/v2/resources_wrong/component_config_wrong_value_type/custom/Connector_1_1.json diff --git a/tests/config/v201/resources_wrong/component_config_wrong_value_type/custom/EVSE_1.json b/tests/config/v2/resources_wrong/component_config_wrong_value_type/custom/EVSE_1.json similarity index 100% rename from tests/config/v201/resources_wrong/component_config_wrong_value_type/custom/EVSE_1.json rename to tests/config/v2/resources_wrong/component_config_wrong_value_type/custom/EVSE_1.json diff --git a/tests/config/v201/resources_wrong/component_config_wrong_value_type/standardized/UnitTestCtrlr.json b/tests/config/v2/resources_wrong/component_config_wrong_value_type/standardized/UnitTestCtrlr.json similarity index 100% rename from tests/config/v201/resources_wrong/component_config_wrong_value_type/standardized/UnitTestCtrlr.json rename to tests/config/v2/resources_wrong/component_config_wrong_value_type/standardized/UnitTestCtrlr.json diff --git a/tests/config/v201/pytest.ini b/tests/config/v201/pytest.ini deleted file mode 100644 index 125461b33..000000000 --- a/tests/config/v201/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -pythonpath=../../../config/v201 \ No newline at end of file diff --git a/tests/lib/ocpp/v201/CMakeLists.txt b/tests/lib/ocpp/v2/CMakeLists.txt similarity index 91% rename from tests/lib/ocpp/v201/CMakeLists.txt rename to tests/lib/ocpp/v2/CMakeLists.txt index 0721b8ab9..802cf8a9f 100644 --- a/tests/lib/ocpp/v201/CMakeLists.txt +++ b/tests/lib/ocpp/v2/CMakeLists.txt @@ -21,8 +21,8 @@ target_sources(libocpp_unit_tests PRIVATE ) # Copy the json files used for testing to the destination directory -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/json DESTINATION ${TEST_PROFILES_LOCATION_V201}) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/json DESTINATION ${TEST_PROFILES_LOCATION_V2}) -set(LIBOCPP_TESTS_V201_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(LIBOCPP_TESTS_V2_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(functional_blocks) diff --git a/tests/lib/ocpp/v201/comparators.cpp b/tests/lib/ocpp/v2/comparators.cpp similarity index 85% rename from tests/lib/ocpp/v201/comparators.cpp rename to tests/lib/ocpp/v2/comparators.cpp index 9940bfb62..fb8bbc94e 100644 --- a/tests/lib/ocpp/v201/comparators.cpp +++ b/tests/lib/ocpp/v2/comparators.cpp @@ -9,8 +9,7 @@ bool operator==(const ::ocpp::CertificateHashDataType& a, const ::ocpp::Certific return a.serialNumber == b.serialNumber && a.issuerKeyHash == b.issuerKeyHash && a.issuerNameHash == b.issuerNameHash && a.hashAlgorithm == b.hashAlgorithm; } -bool operator==(const ::ocpp::v201::GetCertificateStatusRequest& a, - const ::ocpp::v201::GetCertificateStatusRequest& b) { +bool operator==(const ::ocpp::v2::GetCertificateStatusRequest& a, const ::ocpp::v2::GetCertificateStatusRequest& b) { return a.ocspRequestData.serialNumber == b.ocspRequestData.serialNumber && a.ocspRequestData.issuerKeyHash == b.ocspRequestData.issuerKeyHash && a.ocspRequestData.issuerNameHash == b.ocspRequestData.issuerNameHash && @@ -20,10 +19,10 @@ bool operator==(const ::ocpp::v201::GetCertificateStatusRequest& a, } // namespace testing::internal -namespace ocpp::v201 { +namespace ocpp::v2 { bool operator==(const ChargingProfile& a, const ChargingProfile& b) { return a.chargingProfileKind == b.chargingProfileKind && a.chargingProfilePurpose == b.chargingProfilePurpose && a.id == b.id && a.stackLevel == b.stackLevel; } -} // namespace ocpp::v201 \ No newline at end of file +} // namespace ocpp::v2 \ No newline at end of file diff --git a/tests/lib/ocpp/v201/comparators.hpp b/tests/lib/ocpp/v2/comparators.hpp similarity index 65% rename from tests/lib/ocpp/v201/comparators.hpp rename to tests/lib/ocpp/v2/comparators.hpp index 50ca639c8..04ab1b7b3 100644 --- a/tests/lib/ocpp/v201/comparators.hpp +++ b/tests/lib/ocpp/v2/comparators.hpp @@ -5,20 +5,20 @@ #define TESTS_OCPP_COMPARATORS_H #include -#include -#include +#include +#include namespace testing::internal { bool operator==(const ::ocpp::CertificateHashDataType& a, const ::ocpp::CertificateHashDataType& b); -bool operator==(const ::ocpp::v201::GetCertificateStatusRequest& a, const ::ocpp::v201::GetCertificateStatusRequest& b); +bool operator==(const ::ocpp::v2::GetCertificateStatusRequest& a, const ::ocpp::v2::GetCertificateStatusRequest& b); } // namespace testing::internal -namespace ocpp::v201 { +namespace ocpp::v2 { bool operator==(const ChargingProfile& a, const ChargingProfile& b); -} // namespace ocpp::v201 +} // namespace ocpp::v2 #endif // TESTS_OCPP_COMPARATORS_H diff --git a/tests/lib/ocpp/v201/device_model_test_helper.cpp b/tests/lib/ocpp/v2/device_model_test_helper.cpp similarity index 98% rename from tests/lib/ocpp/v201/device_model_test_helper.cpp rename to tests/lib/ocpp/v2/device_model_test_helper.cpp index 3e1e39f74..78c9e4406 100644 --- a/tests/lib/ocpp/v201/device_model_test_helper.cpp +++ b/tests/lib/ocpp/v2/device_model_test_helper.cpp @@ -4,10 +4,10 @@ #include "device_model_test_helper.hpp" #include -#include -#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { DeviceModelTestHelper::DeviceModelTestHelper(const std::string& database_path, const std::string& migration_files_path, const std::string& config_path) : database_path(database_path), @@ -222,4 +222,4 @@ std::unique_ptr DeviceModelTestHelper::create_device_model(const bo return dm; } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/device_model_test_helper.hpp b/tests/lib/ocpp/v2/device_model_test_helper.hpp similarity index 94% rename from tests/lib/ocpp/v201/device_model_test_helper.hpp rename to tests/lib/ocpp/v2/device_model_test_helper.hpp index 4af4f1da4..10f760f83 100644 --- a/tests/lib/ocpp/v201/device_model_test_helper.hpp +++ b/tests/lib/ocpp/v2/device_model_test_helper.hpp @@ -3,9 +3,9 @@ /** * @file device_model_test_helper.hpp - * @brief @copybrief ocpp::v201::DeviceModelTestHelper + * @brief @copybrief ocpp::v2::DeviceModelTestHelper * - * @class ocpp::v201::DeviceModelTestHelper + * @class ocpp::v2::DeviceModelTestHelper * @brief Helper for tests where the device model is needed. * * If the device model is stored in memory, a database connection must be kept open at all times to prevent the @@ -16,10 +16,10 @@ #include -#include +#include -const static std::string MIGRATION_FILES_PATH = "./resources/v201/device_model_migration_files"; -const static std::string CONFIG_PATH = "./resources/example_config/v201/component_config"; +const static std::string MIGRATION_FILES_PATH = "./resources/v2/device_model_migration_files"; +const static std::string CONFIG_PATH = "./resources/example_config/v2/component_config"; const static std::string DEVICE_MODEL_DB_IN_MEMORY_PATH = "file::memory:?cache=shared"; namespace ocpp { @@ -27,7 +27,7 @@ namespace common { class DatabaseConnection; } -namespace v201 { +namespace v2 { class DeviceModel; class DeviceModelTestHelper { @@ -122,5 +122,5 @@ class DeviceModelTestHelper { /// std::unique_ptr create_device_model(const bool init = true); }; -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/tests/lib/ocpp/v2/functional_blocks/CMakeLists.txt b/tests/lib/ocpp/v2/functional_blocks/CMakeLists.txt new file mode 100644 index 000000000..390dff5cd --- /dev/null +++ b/tests/lib/ocpp/v2/functional_blocks/CMakeLists.txt @@ -0,0 +1,57 @@ +target_include_directories(libocpp_unit_tests PUBLIC + ../mocks + ${CMAKE_CURRENT_SOURCE_DIR}) + +target_sources(libocpp_unit_tests PRIVATE + test_data_transfer.cpp + test_reservation.cpp + test_smart_charging.cpp) + + + +set(TEST_SECURITY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../device_model_test_helper.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../stubs/timer/timer_stub.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/functional_blocks/security.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/SecurityEventNotification.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/CertificateSigned.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/DeleteCertificate.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/GetInstalledCertificateIds.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/InstallCertificate.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/SignCertificate.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/Get15118EVCertificate.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/Reset.cpp + ${LIBOCPP_TEST_INCLUDE_COMMON_SOURCES} + ${LIBOCPP_TEST_INCLUDE_V2_SOURCES} +) + +target_sources(libocpp_test_security PRIVATE + ${TEST_SECURITY_SOURCES}) + +target_include_directories(libocpp_test_security PUBLIC + ${LIBOCPP_INCLUDE_PATH} + ${LIBOCPP_3RDPARTY_PATH} + ${CMAKE_CURRENT_SOURCE_DIR}/../stubs/timer + ${CMAKE_CURRENT_SOURCE_DIR}/../mocks + ${LIBOCPP_TESTS_V2_ROOT_DIR} +) + + +set(TEST_AUTHORIZATION_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../device_model_test_helper.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/functional_blocks/authorization.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/Authorize.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/ClearCache.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/GetLocalListVersion.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/messages/SendLocalList.cpp + ${LIBOCPP_TEST_INCLUDE_COMMON_SOURCES} + ${LIBOCPP_TEST_INCLUDE_V2_SOURCES} +) + +target_sources(libocpp_test_authorization PRIVATE + ${TEST_AUTHORIZATION_SOURCES}) + +target_include_directories(libocpp_test_authorization PUBLIC + ${LIBOCPP_INCLUDE_PATH} + ${LIBOCPP_3RDPARTY_PATH} + ${CMAKE_CURRENT_SOURCE_DIR}/../mocks + ${LIBOCPP_TESTS_V2_ROOT_DIR} +) diff --git a/tests/lib/ocpp/v201/functional_blocks/test_authorization.cpp b/tests/lib/ocpp/v2/functional_blocks/test_authorization.cpp similarity index 99% rename from tests/lib/ocpp/v201/functional_blocks/test_authorization.cpp rename to tests/lib/ocpp/v2/functional_blocks/test_authorization.cpp index d0c2d4cab..74734e71c 100644 --- a/tests/lib/ocpp/v201/functional_blocks/test_authorization.cpp +++ b/tests/lib/ocpp/v2/functional_blocks/test_authorization.cpp @@ -4,9 +4,9 @@ #include #include -#include +#include -#include +#include #include "connectivity_manager_mock.hpp" #include "device_model_test_helper.hpp" @@ -14,12 +14,12 @@ #include "message_dispatcher_mock.hpp" #include "mocks/database_handler_mock.hpp" -#include -#include -#include -#include +#include +#include +#include +#include -using namespace ocpp::v201; +using namespace ocpp::v2; using ::testing::_; using ::testing::InSequence; using ::testing::Invoke; @@ -33,7 +33,7 @@ class AuthorizationTest : public ::testing::Test { MockMessageDispatcher mock_dispatcher; DeviceModel* device_model; ::testing::NiceMock connectivity_manager; - ::testing::NiceMock database_handler_mock; + ::testing::NiceMock database_handler_mock; ocpp::EvseSecurityMock evse_security; std::unique_ptr authorization; diff --git a/tests/lib/ocpp/v201/functional_blocks/test_data_transfer.cpp b/tests/lib/ocpp/v2/functional_blocks/test_data_transfer.cpp similarity index 98% rename from tests/lib/ocpp/v201/functional_blocks/test_data_transfer.cpp rename to tests/lib/ocpp/v2/functional_blocks/test_data_transfer.cpp index a01f6224b..b97480831 100644 --- a/tests/lib/ocpp/v201/functional_blocks/test_data_transfer.cpp +++ b/tests/lib/ocpp/v2/functional_blocks/test_data_transfer.cpp @@ -6,10 +6,10 @@ #include #include -#include -#include +#include +#include -using namespace ocpp::v201; +using namespace ocpp::v2; using ::testing::_; using ::testing::Invoke; using ::testing::Return; diff --git a/tests/lib/ocpp/v201/functional_blocks/test_reservation.cpp b/tests/lib/ocpp/v2/functional_blocks/test_reservation.cpp similarity index 98% rename from tests/lib/ocpp/v201/functional_blocks/test_reservation.cpp rename to tests/lib/ocpp/v2/functional_blocks/test_reservation.cpp index ef59b5267..9d5aef84b 100644 --- a/tests/lib/ocpp/v201/functional_blocks/test_reservation.cpp +++ b/tests/lib/ocpp/v2/functional_blocks/test_reservation.cpp @@ -7,23 +7,23 @@ #include #include -#include +#include -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -const static std::string MIGRATION_FILES_PATH = "./resources/v201/device_model_migration_files"; -const static std::string CONFIG_PATH = "./resources/example_config/v201/component_config"; +const static std::string MIGRATION_FILES_PATH = "./resources/v2/device_model_migration_files"; +const static std::string CONFIG_PATH = "./resources/example_config/v2/component_config"; const static std::string DEVICE_MODEL_DB_IN_MEMORY_PATH = "file::memory:?cache=shared"; const static uint32_t NR_OF_EVSES = 2; -using namespace ocpp::v201; +using namespace ocpp::v2; using ::testing::_; using ::testing::Invoke; using ::testing::MockFunction; diff --git a/tests/lib/ocpp/v201/functional_blocks/test_security.cpp b/tests/lib/ocpp/v2/functional_blocks/test_security.cpp similarity index 96% rename from tests/lib/ocpp/v201/functional_blocks/test_security.cpp rename to tests/lib/ocpp/v2/functional_blocks/test_security.cpp index 12adf94c3..318a493b2 100644 --- a/tests/lib/ocpp/v201/functional_blocks/test_security.cpp +++ b/tests/lib/ocpp/v2/functional_blocks/test_security.cpp @@ -4,15 +4,15 @@ #include #include -#include +#include #define private public // Make everything in security.hpp public so we can trigger the timer. -#include +#include #undef private -#include -#include -#include -#include +#include +#include +#include +#include #include "connectivity_manager_mock.hpp" #include "device_model_test_helper.hpp" @@ -22,7 +22,7 @@ #include "timer_stub.hpp" using namespace ocpp; -using namespace ocpp::v201; +using namespace ocpp::v2; using ::testing::_; using ::testing::Invoke; using ::testing::MockFunction; @@ -53,7 +53,7 @@ class SecurityTest : public ::testing::Test { ocpp::EnhancedMessage create_example_certificate_signed_request( const std::string& certificate_chain = "", - const std::optional certificate_type = std::nullopt) { + const std::optional certificate_type = std::nullopt) { CertificateSignedRequest request; request.certificateChain = certificate_chain; request.certificateType = certificate_type; @@ -121,7 +121,7 @@ TEST_F(SecurityTest, handle_message_certificate_signed_v2gcertificate) { })); security.handle_message( - create_example_certificate_signed_request("", ocpp::v201::CertificateSigningUseEnum::V2GCertificate)); + create_example_certificate_signed_request("", ocpp::v2::CertificateSigningUseEnum::V2GCertificate)); } TEST_F(SecurityTest, handle_message_certificate_signed_v2gcertificate_symlinks_disabled) { @@ -141,7 +141,7 @@ TEST_F(SecurityTest, handle_message_certificate_signed_v2gcertificate_symlinks_d })); security.handle_message( - create_example_certificate_signed_request("", ocpp::v201::CertificateSigningUseEnum::V2GCertificate)); + create_example_certificate_signed_request("", ocpp::v2::CertificateSigningUseEnum::V2GCertificate)); } TEST_F(SecurityTest, handle_message_certificate_signed_v2gcertificate_update_leaf_not_accepted) { @@ -166,7 +166,7 @@ TEST_F(SecurityTest, handle_message_certificate_signed_v2gcertificate_update_lea ocpp::InstallCertificateResult::Expired)))); security.handle_message( - create_example_certificate_signed_request("", ocpp::v201::CertificateSigningUseEnum::V2GCertificate)); + create_example_certificate_signed_request("", ocpp::v2::CertificateSigningUseEnum::V2GCertificate)); } TEST_F(SecurityTest, handle_message_certificate_signed_chargingstationcertificate_accepted_securityprofile_3) { @@ -192,8 +192,8 @@ TEST_F(SecurityTest, handle_message_certificate_signed_chargingstationcertificat Call(CiString<50>("ReconfigurationOfSecurityParameters"), std::optional>("Changed charging station certificate"))); - security.handle_message(create_example_certificate_signed_request( - "", ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate)); + security.handle_message( + create_example_certificate_signed_request("", ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate)); } TEST_F(SecurityTest, handle_message_certificate_signed_chargingstationcertificate_accepted_securityprofile_1) { @@ -249,7 +249,7 @@ TEST_F(SecurityTest, sign_certificate_request_accepted) { EXPECT_CALL(mock_dispatcher, dispatch_call(_, _)).WillOnce(Invoke([](const json& call, bool triggered) { auto request = call[ocpp::CALL_PAYLOAD].get(); ASSERT_TRUE(request.certificateType.has_value()); - EXPECT_EQ(request.certificateType.value(), ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate); + EXPECT_EQ(request.certificateType.value(), ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate); EXPECT_EQ(request.csr, "csr"); EXPECT_FALSE(triggered); })); @@ -285,7 +285,7 @@ TEST_F(SecurityTest, sign_certificate_request_twice) { EXPECT_CALL(mock_dispatcher, dispatch_call(_, _)).WillOnce(Invoke([](const json& call, bool triggered) { auto request = call[ocpp::CALL_PAYLOAD].get(); ASSERT_TRUE(request.certificateType.has_value()); - EXPECT_EQ(request.certificateType.value(), ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate); + EXPECT_EQ(request.certificateType.value(), ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate); EXPECT_EQ(request.csr, "csr"); EXPECT_FALSE(triggered); })); @@ -482,7 +482,7 @@ TEST_F(SecurityTest, sign_certificate_request_v2g_accepted) { EXPECT_CALL(mock_dispatcher, dispatch_call(_, _)).WillOnce(Invoke([](const json& call, bool triggered) { auto request = call[ocpp::CALL_PAYLOAD].get(); ASSERT_TRUE(request.certificateType.has_value()); - EXPECT_EQ(request.certificateType.value(), ocpp::v201::CertificateSigningUseEnum::V2GCertificate); + EXPECT_EQ(request.certificateType.value(), ocpp::v2::CertificateSigningUseEnum::V2GCertificate); EXPECT_EQ(request.csr, "csr"); EXPECT_TRUE(triggered); })); @@ -519,7 +519,7 @@ TEST_F(SecurityTest, sign_certificate_request_manufacturer_cert_accepted) { EXPECT_CALL(mock_dispatcher, dispatch_call(_, _)).WillOnce(Invoke([](const json& call, bool triggered) { auto request = call[ocpp::CALL_PAYLOAD].get(); ASSERT_TRUE(request.certificateType.has_value()); - EXPECT_EQ(request.certificateType.value(), ocpp::v201::CertificateSigningUseEnum::V2GCertificate); + EXPECT_EQ(request.certificateType.value(), ocpp::v2::CertificateSigningUseEnum::V2GCertificate); EXPECT_EQ(request.csr, "csr"); EXPECT_TRUE(triggered); })); @@ -741,7 +741,7 @@ TEST_F(SecurityTest, handle_sign_certificate_response_successful) { EXPECT_CALL(mock_dispatcher, dispatch_call(_, _)).WillOnce(Invoke([](const json& call, bool triggered) { auto request = call[ocpp::CALL_PAYLOAD].get(); ASSERT_TRUE(request.certificateType.has_value()); - EXPECT_EQ(request.certificateType.value(), ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate); + EXPECT_EQ(request.certificateType.value(), ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate); EXPECT_EQ(request.csr, "csr"); EXPECT_FALSE(triggered); })); @@ -804,7 +804,7 @@ TEST_F(SecurityTest, handle_sign_certificate_response_no_response) { EXPECT_CALL(mock_dispatcher, dispatch_call(_, _)).WillRepeatedly(Invoke([](const json& call, bool triggered) { auto request = call[ocpp::CALL_PAYLOAD].get(); ASSERT_TRUE(request.certificateType.has_value()); - EXPECT_EQ(request.certificateType.value(), ocpp::v201::CertificateSigningUseEnum::ChargingStationCertificate); + EXPECT_EQ(request.certificateType.value(), ocpp::v2::CertificateSigningUseEnum::ChargingStationCertificate); EXPECT_EQ(request.csr, "csr"); EXPECT_FALSE(triggered); })); diff --git a/tests/lib/ocpp/v201/functional_blocks/test_smart_charging.cpp b/tests/lib/ocpp/v2/functional_blocks/test_smart_charging.cpp similarity index 98% rename from tests/lib/ocpp/v201/functional_blocks/test_smart_charging.cpp rename to tests/lib/ocpp/v2/functional_blocks/test_smart_charging.cpp index 9cdc985bd..bc7bdd959 100644 --- a/tests/lib/ocpp/v201/functional_blocks/test_smart_charging.cpp +++ b/tests/lib/ocpp/v2/functional_blocks/test_smart_charging.cpp @@ -7,10 +7,10 @@ #include "lib/ocpp/common/database_testing_utils.hpp" #include "message_dispatcher_mock.hpp" #include "ocpp/common/types.hpp" -#include "ocpp/v201/ctrlr_component_variables.hpp" -#include "ocpp/v201/device_model.hpp" -#include "ocpp/v201/functional_blocks/smart_charging.hpp" -#include "ocpp/v201/ocpp_types.hpp" +#include "ocpp/v2/ctrlr_component_variables.hpp" +#include "ocpp/v2/device_model.hpp" +#include "ocpp/v2/functional_blocks/smart_charging.hpp" +#include "ocpp/v2/ocpp_types.hpp" #include #include #include @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include #include #include "comparators.hpp" @@ -36,10 +36,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include using ::testing::_; using ::testing::ByMove; @@ -48,7 +48,7 @@ using ::testing::MockFunction; using ::testing::Return; using ::testing::ReturnRef; -namespace ocpp::v201 { +namespace ocpp::v2 { static const int NR_OF_EVSES = 2; static const int STATION_WIDE_ID = 0; @@ -57,8 +57,8 @@ static const int DEFAULT_PROFILE_ID = 1; static const int DEFAULT_STACK_LEVEL = 1; static const int DEFAULT_REQUEST_ID = 1; static const std::string DEFAULT_TX_ID = "10c75ff7-74f5-44f5-9d01-f649f3ac7b78"; -const static std::string MIGRATION_FILES_PATH = "./resources/v201/device_model_migration_files"; -const static std::string CONFIG_PATH = "./resources/example_config/v201/component_config"; +const static std::string MIGRATION_FILES_PATH = "./resources/v2/device_model_migration_files"; +const static std::string CONFIG_PATH = "./resources/example_config/v2/component_config"; const static std::string DEVICE_MODEL_DB_IN_MEMORY_PATH = "file::memory:?cache=shared"; class TestSmartCharging : public SmartCharging { @@ -196,7 +196,7 @@ class SmartChargingTest : public DatabaseTestingUtils { } ChargingProfileCriterion create_charging_profile_criteria( - std::optional> sources = std::nullopt, + std::optional> sources = std::nullopt, std::optional> ids = std::nullopt, std::optional purpose = std::nullopt, std::optional stack_level = std::nullopt) { @@ -263,7 +263,7 @@ class SmartChargingTest : public DatabaseTestingUtils { std::unique_ptr database_connection = std::make_unique(fs::path("/tmp/ocpp201") / "cp.db"); database_handler = - std::make_shared(std::move(database_connection), MIGRATION_FILES_LOCATION_V201); + std::make_shared(std::move(database_connection), MIGRATION_FILES_LOCATION_V2); database_handler->open_connection(); device_model = device_model_test_helper.get_device_model(); // Defaults @@ -648,12 +648,12 @@ TEST_F(SmartChargingTest, K01FR28_WhenEvseDoesExistThenAccept) { * and a new profile with the same stack level and different profile ID will be associated with an EVSE. * 2-7 - We return Valid for any other case, such as using the same EVSE or using the same profile ID. */ -class SmartChargingHandlerTestFixtureV201_FR52 +class SmartChargingHandlerTestFixtureV2_FR52 : public SmartChargingTest, public ::testing::WithParamInterface> {}; -INSTANTIATE_TEST_SUITE_P(TxDefaultProfileValidationV201_Param_Test_Instantiate_FR52, - SmartChargingHandlerTestFixtureV201_FR52, +INSTANTIATE_TEST_SUITE_P(TxDefaultProfileValidationV2_Param_Test_Instantiate_FR52, + SmartChargingHandlerTestFixtureV2_FR52, testing::Values(std::make_tuple(DEFAULT_PROFILE_ID + 1, DEFAULT_STACK_LEVEL, ProfileValidationResultEnum::DuplicateTxDefaultProfileFound), std::make_tuple(DEFAULT_PROFILE_ID, DEFAULT_STACK_LEVEL, @@ -661,7 +661,7 @@ INSTANTIATE_TEST_SUITE_P(TxDefaultProfileValidationV201_Param_Test_Instantiate_F std::make_tuple(DEFAULT_PROFILE_ID + 1, DEFAULT_STACK_LEVEL + 1, ProfileValidationResultEnum::Valid))); -TEST_P(SmartChargingHandlerTestFixtureV201_FR52, K01FR52_TxDefaultProfileValidationV201Tests) { +TEST_P(SmartChargingHandlerTestFixtureV2_FR52, K01FR52_TxDefaultProfileValidationV2Tests) { auto [added_profile_id, added_stack_level, expected] = GetParam(); install_profile_on_evse(DEFAULT_EVSE_ID, DEFAULT_PROFILE_ID); @@ -673,12 +673,12 @@ TEST_P(SmartChargingHandlerTestFixtureV201_FR52, K01FR52_TxDefaultProfileValidat EXPECT_THAT(sut, testing::Eq(expected)); } -class SmartChargingHandlerTestFixtureV201_FR53 +class SmartChargingHandlerTestFixtureV2_FR53 : public SmartChargingTest, public ::testing::WithParamInterface> {}; -INSTANTIATE_TEST_SUITE_P(TxDefaultProfileValidationV201_Param_Test_Instantiate_FR53, - SmartChargingHandlerTestFixtureV201_FR53, +INSTANTIATE_TEST_SUITE_P(TxDefaultProfileValidationV2_Param_Test_Instantiate_FR53, + SmartChargingHandlerTestFixtureV2_FR53, testing::Values(std::make_tuple(DEFAULT_PROFILE_ID + 1, DEFAULT_STACK_LEVEL, ProfileValidationResultEnum::DuplicateTxDefaultProfileFound), std::make_tuple(DEFAULT_PROFILE_ID, DEFAULT_STACK_LEVEL, @@ -686,7 +686,7 @@ INSTANTIATE_TEST_SUITE_P(TxDefaultProfileValidationV201_Param_Test_Instantiate_F std::make_tuple(DEFAULT_PROFILE_ID + 1, DEFAULT_STACK_LEVEL + 1, ProfileValidationResultEnum::Valid))); -TEST_P(SmartChargingHandlerTestFixtureV201_FR53, K01FR53_TxDefaultProfileValidationV201Tests) { +TEST_P(SmartChargingHandlerTestFixtureV2_FR53, K01FR53_TxDefaultProfileValidationV2Tests) { auto [added_profile_id, added_stack_level, expected] = GetParam(); install_profile_on_evse(STATION_WIDE_ID, DEFAULT_PROFILE_ID); @@ -1985,4 +1985,4 @@ TEST_F(SmartChargingTest, K01_ValidateTxProfile_EmptyChargingSchedule) { ASSERT_THAT(sut, testing::Eq(ProfileValidationResultEnum::ChargingProfileEmptyChargingSchedules)); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/0/id1-ChargingStationMaxProfile.json b/tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/0/id1-ChargingStationMaxProfile.json similarity index 100% rename from tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/0/id1-ChargingStationMaxProfile.json rename to tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/0/id1-ChargingStationMaxProfile.json diff --git a/tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/1/id2-TxDefaultProfile.json b/tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/1/id2-TxDefaultProfile.json similarity index 100% rename from tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/1/id2-TxDefaultProfile.json rename to tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/1/id2-TxDefaultProfile.json diff --git a/tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/1/id2-TxProfile.json b/tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/1/id2-TxProfile.json similarity index 100% rename from tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/1/id2-TxProfile.json rename to tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/1/id2-TxProfile.json diff --git a/tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/README.md b/tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/OCCT_TC_K_41_CS/README.md rename to tests/lib/ocpp/v2/json/OCCT_TC_K_41_CS/README.md diff --git a/tests/lib/ocpp/v201/json/README.md b/tests/lib/ocpp/v2/json/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/README.md rename to tests/lib/ocpp/v2/json/README.md diff --git a/tests/lib/ocpp/v201/json/baseline/README.md b/tests/lib/ocpp/v2/json/baseline/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/baseline/README.md rename to tests/lib/ocpp/v2/json/baseline/README.md diff --git a/tests/lib/ocpp/v201/json/baseline/TxProfile_1.json b/tests/lib/ocpp/v2/json/baseline/TxProfile_1.json similarity index 100% rename from tests/lib/ocpp/v201/json/baseline/TxProfile_1.json rename to tests/lib/ocpp/v2/json/baseline/TxProfile_1.json diff --git a/tests/lib/ocpp/v201/json/baseline/TxProfile_100.json b/tests/lib/ocpp/v2/json/baseline/TxProfile_100.json similarity index 100% rename from tests/lib/ocpp/v201/json/baseline/TxProfile_100.json rename to tests/lib/ocpp/v2/json/baseline/TxProfile_100.json diff --git a/tests/lib/ocpp/v201/json/case_one/README.md b/tests/lib/ocpp/v2/json/case_one/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/case_one/README.md rename to tests/lib/ocpp/v2/json/case_one/README.md diff --git a/tests/lib/ocpp/v201/json/case_one/TxProfile_1.json b/tests/lib/ocpp/v2/json/case_one/TxProfile_1.json similarity index 100% rename from tests/lib/ocpp/v201/json/case_one/TxProfile_1.json rename to tests/lib/ocpp/v2/json/case_one/TxProfile_1.json diff --git a/tests/lib/ocpp/v201/json/case_one/TxProfile_100.json b/tests/lib/ocpp/v2/json/case_one/TxProfile_100.json similarity index 100% rename from tests/lib/ocpp/v201/json/case_one/TxProfile_100.json rename to tests/lib/ocpp/v2/json/case_one/TxProfile_100.json diff --git a/tests/lib/ocpp/v201/json/external/0/ChargingStationExternalConstraintProfile_grid_hourly.json b/tests/lib/ocpp/v2/json/external/0/ChargingStationExternalConstraintProfile_grid_hourly.json similarity index 100% rename from tests/lib/ocpp/v201/json/external/0/ChargingStationExternalConstraintProfile_grid_hourly.json rename to tests/lib/ocpp/v2/json/external/0/ChargingStationExternalConstraintProfile_grid_hourly.json diff --git a/tests/lib/ocpp/v201/json/external/0/ChargingStationMaxProfile_2000.json b/tests/lib/ocpp/v2/json/external/0/ChargingStationMaxProfile_2000.json similarity index 100% rename from tests/lib/ocpp/v201/json/external/0/ChargingStationMaxProfile_2000.json rename to tests/lib/ocpp/v2/json/external/0/ChargingStationMaxProfile_2000.json diff --git a/tests/lib/ocpp/v201/json/external/1/TXProfile_2001.json b/tests/lib/ocpp/v2/json/external/1/TXProfile_2001.json similarity index 100% rename from tests/lib/ocpp/v201/json/external/1/TXProfile_2001.json rename to tests/lib/ocpp/v2/json/external/1/TXProfile_2001.json diff --git a/tests/lib/ocpp/v201/json/external/README.md b/tests/lib/ocpp/v2/json/external/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/external/README.md rename to tests/lib/ocpp/v2/json/external/README.md diff --git a/tests/lib/ocpp/v201/json/grid/README.md b/tests/lib/ocpp/v2/json/grid/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/grid/README.md rename to tests/lib/ocpp/v2/json/grid/README.md diff --git a/tests/lib/ocpp/v201/json/grid/TxProfile_grid_hourly.json b/tests/lib/ocpp/v2/json/grid/TxProfile_grid_hourly.json similarity index 100% rename from tests/lib/ocpp/v201/json/grid/TxProfile_grid_hourly.json rename to tests/lib/ocpp/v2/json/grid/TxProfile_grid_hourly.json diff --git a/tests/lib/ocpp/v201/json/layered/README.md b/tests/lib/ocpp/v2/json/layered/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/layered/README.md rename to tests/lib/ocpp/v2/json/layered/README.md diff --git a/tests/lib/ocpp/v201/json/layered/TXProfile_single.json b/tests/lib/ocpp/v2/json/layered/TXProfile_single.json similarity index 100% rename from tests/lib/ocpp/v201/json/layered/TXProfile_single.json rename to tests/lib/ocpp/v2/json/layered/TXProfile_single.json diff --git a/tests/lib/ocpp/v201/json/layered/TxProfile_grid_hourly.json b/tests/lib/ocpp/v2/json/layered/TxProfile_grid_hourly.json similarity index 100% rename from tests/lib/ocpp/v201/json/layered/TxProfile_grid_hourly.json rename to tests/lib/ocpp/v2/json/layered/TxProfile_grid_hourly.json diff --git a/tests/lib/ocpp/v201/json/layered_recurring/README.md b/tests/lib/ocpp/v2/json/layered_recurring/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/layered_recurring/README.md rename to tests/lib/ocpp/v2/json/layered_recurring/README.md diff --git a/tests/lib/ocpp/v201/json/layered_recurring/TXProfile_single.json b/tests/lib/ocpp/v2/json/layered_recurring/TXProfile_single.json similarity index 100% rename from tests/lib/ocpp/v201/json/layered_recurring/TXProfile_single.json rename to tests/lib/ocpp/v2/json/layered_recurring/TXProfile_single.json diff --git a/tests/lib/ocpp/v201/json/layered_recurring/TxProfile_grid_hourly.json b/tests/lib/ocpp/v2/json/layered_recurring/TxProfile_grid_hourly.json similarity index 100% rename from tests/lib/ocpp/v201/json/layered_recurring/TxProfile_grid_hourly.json rename to tests/lib/ocpp/v2/json/layered_recurring/TxProfile_grid_hourly.json diff --git a/tests/lib/ocpp/v201/json/max/0/ChargingStationMaxProfile_grid_hourly.json b/tests/lib/ocpp/v2/json/max/0/ChargingStationMaxProfile_grid_hourly.json similarity index 100% rename from tests/lib/ocpp/v201/json/max/0/ChargingStationMaxProfile_grid_hourly.json rename to tests/lib/ocpp/v2/json/max/0/ChargingStationMaxProfile_grid_hourly.json diff --git a/tests/lib/ocpp/v201/json/max/1/TXProfile_2000.json b/tests/lib/ocpp/v2/json/max/1/TXProfile_2000.json similarity index 100% rename from tests/lib/ocpp/v201/json/max/1/TXProfile_2000.json rename to tests/lib/ocpp/v2/json/max/1/TXProfile_2000.json diff --git a/tests/lib/ocpp/v201/json/max/1/TXProfile_2001.json b/tests/lib/ocpp/v2/json/max/1/TXProfile_2001.json similarity index 100% rename from tests/lib/ocpp/v201/json/max/1/TXProfile_2001.json rename to tests/lib/ocpp/v2/json/max/1/TXProfile_2001.json diff --git a/tests/lib/ocpp/v201/json/max/README.md b/tests/lib/ocpp/v2/json/max/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/max/README.md rename to tests/lib/ocpp/v2/json/max/README.md diff --git a/tests/lib/ocpp/v201/json/no_gap/TxDefaultProfile_401.json b/tests/lib/ocpp/v2/json/no_gap/TxDefaultProfile_401.json similarity index 100% rename from tests/lib/ocpp/v201/json/no_gap/TxDefaultProfile_401.json rename to tests/lib/ocpp/v2/json/no_gap/TxDefaultProfile_401.json diff --git a/tests/lib/ocpp/v201/json/no_gap/TxDefaultProfile_402.json b/tests/lib/ocpp/v2/json/no_gap/TxDefaultProfile_402.json similarity index 100% rename from tests/lib/ocpp/v201/json/no_gap/TxDefaultProfile_402.json rename to tests/lib/ocpp/v2/json/no_gap/TxDefaultProfile_402.json diff --git a/tests/lib/ocpp/v201/json/relative/README.md b/tests/lib/ocpp/v2/json/relative/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/relative/README.md rename to tests/lib/ocpp/v2/json/relative/README.md diff --git a/tests/lib/ocpp/v201/json/relative/TxProfile_grid_hourly.json b/tests/lib/ocpp/v2/json/relative/TxProfile_grid_hourly.json similarity index 100% rename from tests/lib/ocpp/v201/json/relative/TxProfile_grid_hourly.json rename to tests/lib/ocpp/v2/json/relative/TxProfile_grid_hourly.json diff --git a/tests/lib/ocpp/v201/json/relative/TxProfile_relative.json b/tests/lib/ocpp/v2/json/relative/TxProfile_relative.json similarity index 100% rename from tests/lib/ocpp/v201/json/relative/TxProfile_relative.json rename to tests/lib/ocpp/v2/json/relative/TxProfile_relative.json diff --git a/tests/lib/ocpp/v201/json/singles/Absolute_301.json b/tests/lib/ocpp/v2/json/singles/Absolute_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Absolute_301.json rename to tests/lib/ocpp/v2/json/singles/Absolute_301.json diff --git a/tests/lib/ocpp/v201/json/singles/Absolute_NoDuration_301.json b/tests/lib/ocpp/v2/json/singles/Absolute_NoDuration_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Absolute_NoDuration_301.json rename to tests/lib/ocpp/v2/json/singles/Absolute_NoDuration_301.json diff --git a/tests/lib/ocpp/v201/json/singles/ChargingStationMaxProfile_24_Ampere.json b/tests/lib/ocpp/v2/json/singles/ChargingStationMaxProfile_24_Ampere.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/ChargingStationMaxProfile_24_Ampere.json rename to tests/lib/ocpp/v2/json/singles/ChargingStationMaxProfile_24_Ampere.json diff --git a/tests/lib/ocpp/v201/json/singles/ChargingStationMaxProfile_401.json b/tests/lib/ocpp/v2/json/singles/ChargingStationMaxProfile_401.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/ChargingStationMaxProfile_401.json rename to tests/lib/ocpp/v2/json/singles/ChargingStationMaxProfile_401.json diff --git a/tests/lib/ocpp/v201/json/singles/ProfileA.json b/tests/lib/ocpp/v2/json/singles/ProfileA.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/ProfileA.json rename to tests/lib/ocpp/v2/json/singles/ProfileA.json diff --git a/tests/lib/ocpp/v201/json/singles/README.md b/tests/lib/ocpp/v2/json/singles/README.md similarity index 100% rename from tests/lib/ocpp/v201/json/singles/README.md rename to tests/lib/ocpp/v2/json/singles/README.md diff --git a/tests/lib/ocpp/v201/json/singles/Recurring_Daily_301.json b/tests/lib/ocpp/v2/json/singles/Recurring_Daily_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Recurring_Daily_301.json rename to tests/lib/ocpp/v2/json/singles/Recurring_Daily_301.json diff --git a/tests/lib/ocpp/v201/json/singles/Recurring_Daily_302_phase_limit.json b/tests/lib/ocpp/v2/json/singles/Recurring_Daily_302_phase_limit.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Recurring_Daily_302_phase_limit.json rename to tests/lib/ocpp/v2/json/singles/Recurring_Daily_302_phase_limit.json diff --git a/tests/lib/ocpp/v201/json/singles/Recurring_Daily_NoDuration_301.json b/tests/lib/ocpp/v2/json/singles/Recurring_Daily_NoDuration_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Recurring_Daily_NoDuration_301.json rename to tests/lib/ocpp/v2/json/singles/Recurring_Daily_NoDuration_301.json diff --git a/tests/lib/ocpp/v201/json/singles/Recurring_Weekly_301.json b/tests/lib/ocpp/v2/json/singles/Recurring_Weekly_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Recurring_Weekly_301.json rename to tests/lib/ocpp/v2/json/singles/Recurring_Weekly_301.json diff --git a/tests/lib/ocpp/v201/json/singles/Recurring_Weekly_NoDuration_301.json b/tests/lib/ocpp/v2/json/singles/Recurring_Weekly_NoDuration_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Recurring_Weekly_NoDuration_301.json rename to tests/lib/ocpp/v2/json/singles/Recurring_Weekly_NoDuration_301.json diff --git a/tests/lib/ocpp/v201/json/singles/Relative_301.json b/tests/lib/ocpp/v2/json/singles/Relative_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Relative_301.json rename to tests/lib/ocpp/v2/json/singles/Relative_301.json diff --git a/tests/lib/ocpp/v201/json/singles/Relative_302_phase_limit.json b/tests/lib/ocpp/v2/json/singles/Relative_302_phase_limit.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Relative_302_phase_limit.json rename to tests/lib/ocpp/v2/json/singles/Relative_302_phase_limit.json diff --git a/tests/lib/ocpp/v201/json/singles/Relative_303.json b/tests/lib/ocpp/v2/json/singles/Relative_303.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Relative_303.json rename to tests/lib/ocpp/v2/json/singles/Relative_303.json diff --git a/tests/lib/ocpp/v201/json/singles/Relative_MultipleChargingSchedules.json b/tests/lib/ocpp/v2/json/singles/Relative_MultipleChargingSchedules.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Relative_MultipleChargingSchedules.json rename to tests/lib/ocpp/v2/json/singles/Relative_MultipleChargingSchedules.json diff --git a/tests/lib/ocpp/v201/json/singles/Relative_NoDuration_301.json b/tests/lib/ocpp/v2/json/singles/Relative_NoDuration_301.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/Relative_NoDuration_301.json rename to tests/lib/ocpp/v2/json/singles/Relative_NoDuration_301.json diff --git a/tests/lib/ocpp/v201/json/singles/TXDefaultProfile_25_Watt.json b/tests/lib/ocpp/v2/json/singles/TXDefaultProfile_25_Watt.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/TXDefaultProfile_25_Watt.json rename to tests/lib/ocpp/v2/json/singles/TXDefaultProfile_25_Watt.json diff --git a/tests/lib/ocpp/v201/json/singles/TXProfile_Absolute_Start18-04.json b/tests/lib/ocpp/v2/json/singles/TXProfile_Absolute_Start18-04.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/TXProfile_Absolute_Start18-04.json rename to tests/lib/ocpp/v2/json/singles/TXProfile_Absolute_Start18-04.json diff --git a/tests/lib/ocpp/v201/json/singles/TxProfile_CONCERNING_overlapping_periods.json b/tests/lib/ocpp/v2/json/singles/TxProfile_CONCERNING_overlapping_periods.json similarity index 100% rename from tests/lib/ocpp/v201/json/singles/TxProfile_CONCERNING_overlapping_periods.json rename to tests/lib/ocpp/v2/json/singles/TxProfile_CONCERNING_overlapping_periods.json diff --git a/tests/lib/ocpp/v201/mocks/component_state_manager_mock.hpp b/tests/lib/ocpp/v2/mocks/component_state_manager_mock.hpp similarity index 96% rename from tests/lib/ocpp/v201/mocks/component_state_manager_mock.hpp rename to tests/lib/ocpp/v2/mocks/component_state_manager_mock.hpp index 4f4a67327..29e246a47 100644 --- a/tests/lib/ocpp/v201/mocks/component_state_manager_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/component_state_manager_mock.hpp @@ -5,9 +5,9 @@ #include -#include "ocpp/v201/component_state_manager.hpp" +#include "ocpp/v2/component_state_manager.hpp" -namespace ocpp::v201 { +namespace ocpp::v2 { class ComponentStateManagerMock : public ComponentStateManagerInterface { MOCK_METHOD(void, set_cs_effective_availability_changed_callback, (const std::function& callback)); @@ -46,4 +46,4 @@ class ComponentStateManagerMock : public ComponentStateManagerInterface { MOCK_METHOD(void, send_status_notification_single_connector, (int32_t evse_id, int32_t connector_id)); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/mocks/connectivity_manager_mock.hpp b/tests/lib/ocpp/v2/mocks/connectivity_manager_mock.hpp similarity index 94% rename from tests/lib/ocpp/v201/mocks/connectivity_manager_mock.hpp rename to tests/lib/ocpp/v2/mocks/connectivity_manager_mock.hpp index 920e56c06..97050ab79 100644 --- a/tests/lib/ocpp/v201/mocks/connectivity_manager_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/connectivity_manager_mock.hpp @@ -5,9 +5,9 @@ #include "gmock/gmock.h" -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class ConnectivityManagerMock : public ConnectivityManagerInterface { public: MOCK_METHOD(void, set_websocket_authorization_key, (const std::string& authorization_key)); @@ -30,4 +30,4 @@ class ConnectivityManagerMock : public ConnectivityManagerInterface { MOCK_METHOD(void, on_charging_station_certificate_changed, ()); MOCK_METHOD(void, confirm_successful_connection, ()); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/mocks/database_handler_fake.hpp b/tests/lib/ocpp/v2/mocks/database_handler_fake.hpp similarity index 89% rename from tests/lib/ocpp/v201/mocks/database_handler_fake.hpp rename to tests/lib/ocpp/v2/mocks/database_handler_fake.hpp index 282b97262..5d862d5a6 100644 --- a/tests/lib/ocpp/v201/mocks/database_handler_fake.hpp +++ b/tests/lib/ocpp/v2/mocks/database_handler_fake.hpp @@ -4,9 +4,9 @@ #pragma once #include "database_handler_mock.hpp" -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DatabaseHandlerFake : public DatabaseHandlerMock { DatabaseHandler handler; @@ -25,4 +25,4 @@ class DatabaseHandlerFake : public DatabaseHandlerMock { this->handler.open_connection(); } }; -} // namespace ocpp::v201 \ No newline at end of file +} // namespace ocpp::v2 \ No newline at end of file diff --git a/tests/lib/ocpp/v201/mocks/database_handler_mock.hpp b/tests/lib/ocpp/v2/mocks/database_handler_mock.hpp similarity index 98% rename from tests/lib/ocpp/v201/mocks/database_handler_mock.hpp rename to tests/lib/ocpp/v2/mocks/database_handler_mock.hpp index 61023e866..0b131334d 100644 --- a/tests/lib/ocpp/v201/mocks/database_handler_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/database_handler_mock.hpp @@ -5,9 +5,9 @@ #include "gmock/gmock.h" -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class DatabaseHandlerMock : public DatabaseHandlerInterface { public: MOCK_METHOD(void, authorization_cache_insert_entry, @@ -72,4 +72,4 @@ class DatabaseHandlerMock : public DatabaseHandlerInterface { MOCK_METHOD(ChargingLimitSourceEnum, get_charging_limit_source_for_profile, (const int profile_id)); MOCK_METHOD(std::unique_ptr, new_statement, (const std::string& sql)); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/mocks/device_model_storage_interface_mock.hpp b/tests/lib/ocpp/v2/mocks/device_model_storage_interface_mock.hpp similarity index 93% rename from tests/lib/ocpp/v201/mocks/device_model_storage_interface_mock.hpp rename to tests/lib/ocpp/v2/mocks/device_model_storage_interface_mock.hpp index 7589dce78..f9125151c 100644 --- a/tests/lib/ocpp/v201/mocks/device_model_storage_interface_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/device_model_storage_interface_mock.hpp @@ -5,9 +5,9 @@ #include -#include "ocpp/v201/device_model_storage_interface.hpp" +#include "ocpp/v2/device_model_storage_interface.hpp" -namespace ocpp::v201 { +namespace ocpp::v2 { class DeviceModelStorageMock : public DeviceModelStorageInterface { public: MOCK_METHOD(DeviceModelMap, get_device_model, ()); @@ -27,4 +27,4 @@ class DeviceModelStorageMock : public DeviceModelStorageInterface { MOCK_METHOD(bool, update_monitoring_reference, (int32_t monitor_id, const std::string& reference_value), (override)); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/mocks/evse_manager_fake.hpp b/tests/lib/ocpp/v2/mocks/evse_manager_fake.hpp similarity index 97% rename from tests/lib/ocpp/v201/mocks/evse_manager_fake.hpp rename to tests/lib/ocpp/v2/mocks/evse_manager_fake.hpp index dcca26a17..eb5783335 100644 --- a/tests/lib/ocpp/v201/mocks/evse_manager_fake.hpp +++ b/tests/lib/ocpp/v2/mocks/evse_manager_fake.hpp @@ -6,9 +6,9 @@ #include #include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class EvseManagerFake : public EvseManagerInterface { private: @@ -115,4 +115,4 @@ class EvseManagerFake : public EvseManagerInterface { } }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/mocks/evse_mock.hpp b/tests/lib/ocpp/v2/mocks/evse_mock.hpp similarity index 97% rename from tests/lib/ocpp/v201/mocks/evse_mock.hpp rename to tests/lib/ocpp/v2/mocks/evse_mock.hpp index 6ffd7476f..57fcbf2f9 100644 --- a/tests/lib/ocpp/v201/mocks/evse_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/evse_mock.hpp @@ -5,9 +5,9 @@ #include "gmock/gmock.h" -#include "ocpp/v201/evse.hpp" +#include "ocpp/v2/evse.hpp" -namespace ocpp::v201 { +namespace ocpp::v2 { class EvseMock : public EvseInterface { public: MOCK_METHOD(int32_t, get_id, (), (const)); @@ -47,4 +47,4 @@ class EvseMock : public EvseInterface { std::function& meter_values)> send_metervalue_function, boost::asio::io_service& io_service)); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/mocks/message_dispatcher_mock.hpp b/tests/lib/ocpp/v2/mocks/message_dispatcher_mock.hpp similarity index 96% rename from tests/lib/ocpp/v201/mocks/message_dispatcher_mock.hpp rename to tests/lib/ocpp/v2/mocks/message_dispatcher_mock.hpp index 463445d96..02b7a98dc 100644 --- a/tests/lib/ocpp/v201/mocks/message_dispatcher_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/message_dispatcher_mock.hpp @@ -7,7 +7,7 @@ #include -using namespace ocpp::v201; +using namespace ocpp::v2; class MockMessageDispatcher : public ocpp::MessageDispatcherInterface { public: diff --git a/tests/lib/ocpp/v201/mocks/ocsp_updater_mock.hpp b/tests/lib/ocpp/v2/mocks/ocsp_updater_mock.hpp similarity index 81% rename from tests/lib/ocpp/v201/mocks/ocsp_updater_mock.hpp rename to tests/lib/ocpp/v2/mocks/ocsp_updater_mock.hpp index a0ef783fe..fa634cc8d 100644 --- a/tests/lib/ocpp/v201/mocks/ocsp_updater_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/ocsp_updater_mock.hpp @@ -5,9 +5,9 @@ #include "gmock/gmock.h" -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class OcspUpdaterMock : public OcspUpdaterInterface { public: virtual ~OcspUpdaterMock() { @@ -16,4 +16,4 @@ class OcspUpdaterMock : public OcspUpdaterInterface { MOCK_METHOD(void, stop, ()); MOCK_METHOD(void, trigger_ocsp_cache_update, ()); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/mocks/smart_charging_mock.hpp b/tests/lib/ocpp/v2/mocks/smart_charging_mock.hpp similarity index 85% rename from tests/lib/ocpp/v201/mocks/smart_charging_mock.hpp rename to tests/lib/ocpp/v2/mocks/smart_charging_mock.hpp index 0433f6047..c42a3686a 100644 --- a/tests/lib/ocpp/v201/mocks/smart_charging_mock.hpp +++ b/tests/lib/ocpp/v2/mocks/smart_charging_mock.hpp @@ -5,10 +5,10 @@ #include "gmock/gmock.h" -#include -#include +#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { class SmartChargingMock : public SmartChargingInterface { public: MOCK_METHOD(void, handle_message, (const ocpp::EnhancedMessage& message)); @@ -21,4 +21,4 @@ class SmartChargingMock : public SmartChargingInterface { MOCK_METHOD(ProfileValidationResultEnum, conform_and_validate_profile, (ChargingProfile & profile, int32_t evse_id, AddChargingProfileSource source_of_request)); }; -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/smart_charging_matchers.hpp b/tests/lib/ocpp/v2/smart_charging_matchers.hpp similarity index 96% rename from tests/lib/ocpp/v201/smart_charging_matchers.hpp rename to tests/lib/ocpp/v2/smart_charging_matchers.hpp index 5c61b6bf6..dab964bd6 100644 --- a/tests/lib/ocpp/v201/smart_charging_matchers.hpp +++ b/tests/lib/ocpp/v2/smart_charging_matchers.hpp @@ -5,7 +5,7 @@ #include -#include +#include MATCHER_P2(PeriodEquals, start, limit, "Period start " + testing::DescribeMatcher(start, negation) + " and limit " + diff --git a/tests/lib/ocpp/v201/smart_charging_test_utils.hpp b/tests/lib/ocpp/v2/smart_charging_test_utils.hpp similarity index 97% rename from tests/lib/ocpp/v201/smart_charging_test_utils.hpp rename to tests/lib/ocpp/v2/smart_charging_test_utils.hpp index 5403b86c3..990ecad66 100644 --- a/tests/lib/ocpp/v201/smart_charging_test_utils.hpp +++ b/tests/lib/ocpp/v2/smart_charging_test_utils.hpp @@ -2,9 +2,9 @@ // Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest #include "everest/logging.hpp" -#include "ocpp/v201/ocpp_types.hpp" -#include "ocpp/v201/profile.hpp" -#include "ocpp/v201/utils.hpp" +#include "ocpp/v2/ocpp_types.hpp" +#include "ocpp/v2/profile.hpp" +#include "ocpp/v2/utils.hpp" #include #include #include @@ -15,9 +15,9 @@ #include #include -namespace ocpp::v201 { +namespace ocpp::v2 { -static const std::string BASE_JSON_PATH = std::string(TEST_PROFILES_LOCATION_V201) + "/json"; +static const std::string BASE_JSON_PATH = std::string(TEST_PROFILES_LOCATION_V2) + "/json"; inline bool operator==(const ChargingSchedulePeriod& a, const ChargingSchedulePeriod& b) { auto diff = std::abs(a.startPeriod - b.startPeriod); @@ -235,4 +235,4 @@ class SmartChargingTestUtils { } }; -} // namespace ocpp::v201 \ No newline at end of file +} // namespace ocpp::v2 \ No newline at end of file diff --git a/tests/lib/ocpp/v201/stubs/timer/everest/timer.hpp b/tests/lib/ocpp/v2/stubs/timer/everest/timer.hpp similarity index 100% rename from tests/lib/ocpp/v201/stubs/timer/everest/timer.hpp rename to tests/lib/ocpp/v2/stubs/timer/everest/timer.hpp diff --git a/tests/lib/ocpp/v201/stubs/timer/timer_stub.cpp b/tests/lib/ocpp/v2/stubs/timer/timer_stub.cpp similarity index 100% rename from tests/lib/ocpp/v201/stubs/timer/timer_stub.cpp rename to tests/lib/ocpp/v2/stubs/timer/timer_stub.cpp diff --git a/tests/lib/ocpp/v201/stubs/timer/timer_stub.hpp b/tests/lib/ocpp/v2/stubs/timer/timer_stub.hpp similarity index 100% rename from tests/lib/ocpp/v201/stubs/timer/timer_stub.hpp rename to tests/lib/ocpp/v2/stubs/timer/timer_stub.hpp diff --git a/tests/lib/ocpp/v201/test_charge_point.cpp b/tests/lib/ocpp/v2/test_charge_point.cpp similarity index 82% rename from tests/lib/ocpp/v201/test_charge_point.cpp rename to tests/lib/ocpp/v2/test_charge_point.cpp index 7d8f196e7..bba10aadb 100644 --- a/tests/lib/ocpp/v201/test_charge_point.cpp +++ b/tests/lib/ocpp/v2/test_charge_point.cpp @@ -8,14 +8,14 @@ #include "mocks/smart_charging_mock.hpp" #include "ocpp/common/call_types.hpp" #include "ocpp/common/message_queue.hpp" -#include "ocpp/v201/charge_point.hpp" -#include "ocpp/v201/ctrlr_component_variables.hpp" -#include "ocpp/v201/device_model_storage_sqlite.hpp" -#include "ocpp/v201/init_device_model_db.hpp" -#include "ocpp/v201/messages/GetCompositeSchedule.hpp" -#include "ocpp/v201/messages/SetChargingProfile.hpp" -#include "ocpp/v201/ocpp_enums.hpp" -#include "ocpp/v201/types.hpp" +#include "ocpp/v2/charge_point.hpp" +#include "ocpp/v2/ctrlr_component_variables.hpp" +#include "ocpp/v2/device_model_storage_sqlite.hpp" +#include "ocpp/v2/init_device_model_db.hpp" +#include "ocpp/v2/messages/GetCompositeSchedule.hpp" +#include "ocpp/v2/messages/SetChargingProfile.hpp" +#include "ocpp/v2/ocpp_enums.hpp" +#include "ocpp/v2/types.hpp" #include "gmock/gmock.h" #include @@ -27,21 +27,21 @@ static const int DEFAULT_EVSE_ID = 1; static const int DEFAULT_PROFILE_ID = 1; static const int DEFAULT_STACK_LEVEL = 1; -static const ocpp::v201::AddChargingProfileSource DEFAULT_REQUEST_TO_ADD_PROFILE_SOURCE = - ocpp::v201::AddChargingProfileSource::SetChargingProfile; +static const ocpp::v2::AddChargingProfileSource DEFAULT_REQUEST_TO_ADD_PROFILE_SOURCE = + ocpp::v2::AddChargingProfileSource::SetChargingProfile; static const std::string TEMP_OUTPUT_PATH = "/tmp/ocpp201"; -const static std::string MIGRATION_FILES_PATH = "./resources/v201/device_model_migration_files"; -const static std::string CONFIG_PATH = "./resources/example_config/v201/component_config"; +const static std::string MIGRATION_FILES_PATH = "./resources/v2/device_model_migration_files"; +const static std::string CONFIG_PATH = "./resources/example_config/v2/component_config"; const static std::string DEVICE_MODEL_DB_IN_MEMORY_PATH = "file::memory:?cache=shared"; static const std::string DEFAULT_TX_ID = "10c75ff7-74f5-44f5-9d01-f649f3ac7b78"; -namespace ocpp::v201 { +namespace ocpp::v2 { -class ChargePointCommonTestFixtureV201 : public DatabaseTestingUtils { +class ChargePointCommonTestFixtureV2 : public DatabaseTestingUtils { public: - ChargePointCommonTestFixtureV201() : device_model(create_device_model()) { + ChargePointCommonTestFixtureV2() : device_model(create_device_model()) { } - ~ChargePointCommonTestFixtureV201() { + ~ChargePointCommonTestFixtureV2() { } std::map create_evse_connector_structure() { @@ -129,15 +129,15 @@ class ChargePointCommonTestFixtureV201 : public DatabaseTestingUtils { std::shared_ptr create_database_handler() { auto database_connection = std::make_unique(fs::path("/tmp/ocpp201") / "cp.db"); - return std::make_shared(std::move(database_connection), MIGRATION_FILES_LOCATION_V201); + return std::make_shared(std::move(database_connection), MIGRATION_FILES_LOCATION_V2); } - std::shared_ptr> + std::shared_ptr> create_message_queue(std::shared_ptr& database_handler) { const auto DEFAULT_MESSAGE_QUEUE_SIZE_THRESHOLD = 2E5; - return std::make_shared>( + return std::make_shared>( [this](json message) -> bool { return false; }, - MessageQueueConfig{ + MessageQueueConfig{ this->device_model->get_value(ControllerComponentVariables::MessageAttempts), this->device_model->get_value(ControllerComponentVariables::MessageAttemptInterval), this->device_model->get_optional_value(ControllerComponentVariables::MessageQueueSizeThreshold) @@ -196,7 +196,7 @@ class ChargePointCommonTestFixtureV201 : public DatabaseTestingUtils { testing::MockFunction reserve_now_callback_mock; testing::MockFunction cancel_reservation_callback_mock; - ocpp::v201::Callbacks callbacks; + ocpp::v2::Callbacks callbacks; }; /* @@ -216,7 +216,7 @@ class ChargePointCommonTestFixtureV201 : public DatabaseTestingUtils { * is provided. */ -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfSetChargingProfilesCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfSetChargingProfilesCallbackExists) { configure_callbacks_with_mocks(); callbacks.set_charging_profiles_callback = nullptr; @@ -228,44 +228,44 @@ TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfSetCha * all_callbacks_valid. */ -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksAreInvalidWhenNotProvided) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksAreInvalidWhenNotProvided) { EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksAreValidWhenAllRequiredCallbacksProvided) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksAreValidWhenAllRequiredCallbacksProvided) { configure_callbacks_with_mocks(); EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfResetIsAllowedCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfResetIsAllowedCallbackExists) { configure_callbacks_with_mocks(); callbacks.is_reset_allowed_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfResetCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfResetCallbackExists) { configure_callbacks_with_mocks(); callbacks.reset_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfStopTransactionCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfStopTransactionCallbackExists) { configure_callbacks_with_mocks(); callbacks.stop_transaction_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfPauseChargingCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfPauseChargingCallbackExists) { configure_callbacks_with_mocks(); callbacks.pause_charging_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfConnectorEffectiveOperativeStatusChangedCallbackExists) { configure_callbacks_with_mocks(); callbacks.connector_effective_operative_status_changed_callback = nullptr; @@ -273,49 +273,49 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfGetLogRequestCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfGetLogRequestCallbackExists) { configure_callbacks_with_mocks(); callbacks.get_log_request_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfUnlockConnectorCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfUnlockConnectorCallbackExists) { configure_callbacks_with_mocks(); callbacks.unlock_connector_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfRemoteStartTransactionCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfRemoteStartTransactionCallbackExists) { configure_callbacks_with_mocks(); callbacks.remote_start_transaction_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfIsReservationForTokenCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfIsReservationForTokenCallbackExists) { configure_callbacks_with_mocks(); callbacks.is_reservation_for_token_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfUpdateFirmwareRequestCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfUpdateFirmwareRequestCallbackExists) { configure_callbacks_with_mocks(); callbacks.update_firmware_request_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfSecurityEventCallbackExists) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfSecurityEventCallbackExists) { configure_callbacks_with_mocks(); callbacks.security_event_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalVariableChangedCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -327,7 +327,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalVariableNetworkProfileCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -341,7 +341,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalConfigureNetworkConnectionProfileCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -354,7 +354,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfOptionalTimeSyncCallbackIsNotSetOrNotNull) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalTimeSyncCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); callbacks.time_sync_callback = nullptr; @@ -365,20 +365,19 @@ TEST_F(ChargePointCommonTestFixtureV201, K01FR02_CallbacksValidityChecksIfOption EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalBootNotificationCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); callbacks.boot_notification_callback = nullptr; EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); - testing::MockFunction boot_notification_callback_mock; + testing::MockFunction boot_notification_callback_mock; callbacks.boot_notification_callback = boot_notification_callback_mock.AsStdFunction(); EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, - K01FR02_CallbacksValidityChecksIfOptionalOCPPMessagesCallbackIsNotSetOrNotNull) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalOCPPMessagesCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); callbacks.ocpp_messages_callback = nullptr; @@ -389,7 +388,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalCSEffectiveOperativeStatusChangedCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -403,7 +402,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalEvseEffectiveOperativeStatusChangedCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -417,7 +416,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalGetCustomerInformationCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -432,7 +431,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalClearCustomerInformationCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -447,7 +446,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalAllConnectorsUnavailableCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -459,8 +458,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, - K01FR02_CallbacksValidityChecksIfOptionalDataTransferCallbackIsNotSetOrNotNull) { +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalDataTransferCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); callbacks.data_transfer_callback = nullptr; @@ -471,7 +469,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalTransactionEventCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -483,7 +481,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, +TEST_F(ChargePointCommonTestFixtureV2, K01FR02_CallbacksValidityChecksIfOptionalTransactionEventResponseCallbackIsNotSetOrNotNull) { configure_callbacks_with_mocks(); @@ -497,7 +495,7 @@ TEST_F(ChargePointCommonTestFixtureV201, EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, ReservationAvailableReserveNowCallbackNotSet) { +TEST_F(ChargePointCommonTestFixtureV2, ReservationAvailableReserveNowCallbackNotSet) { configure_callbacks_with_mocks(); device_model->set_value(ControllerComponentVariables::ReservationCtrlrAvailable.component, ControllerComponentVariables::ReservationCtrlrAvailable.variable.value(), @@ -506,7 +504,7 @@ TEST_F(ChargePointCommonTestFixtureV201, ReservationAvailableReserveNowCallbackN EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, ReservationAvailableCancelReservationCallbackNotSet) { +TEST_F(ChargePointCommonTestFixtureV2, ReservationAvailableCancelReservationCallbackNotSet) { configure_callbacks_with_mocks(); device_model->set_value(ControllerComponentVariables::ReservationCtrlrAvailable.component, ControllerComponentVariables::ReservationCtrlrAvailable.variable.value(), @@ -515,7 +513,7 @@ TEST_F(ChargePointCommonTestFixtureV201, ReservationAvailableCancelReservationCa EXPECT_FALSE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, ReservationNotAvailableReserveNowCallbackNotSet) { +TEST_F(ChargePointCommonTestFixtureV2, ReservationNotAvailableReserveNowCallbackNotSet) { configure_callbacks_with_mocks(); device_model->set_value(ControllerComponentVariables::ReservationCtrlrAvailable.component, ControllerComponentVariables::ReservationCtrlrAvailable.variable.value(), @@ -524,7 +522,7 @@ TEST_F(ChargePointCommonTestFixtureV201, ReservationNotAvailableReserveNowCallba EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -TEST_F(ChargePointCommonTestFixtureV201, ReservationNotAvailableCancelReservationCallbackNotSet) { +TEST_F(ChargePointCommonTestFixtureV2, ReservationNotAvailableCancelReservationCallbackNotSet) { configure_callbacks_with_mocks(); device_model->set_value(ControllerComponentVariables::ReservationCtrlrAvailable.component, ControllerComponentVariables::ReservationCtrlrAvailable.variable.value(), @@ -533,14 +531,14 @@ TEST_F(ChargePointCommonTestFixtureV201, ReservationNotAvailableCancelReservatio EXPECT_TRUE(callbacks.all_callbacks_valid(device_model)); } -class ChargePointConstructorTestFixtureV201 : public ChargePointCommonTestFixtureV201 { +class ChargePointConstructorTestFixtureV2 : public ChargePointCommonTestFixtureV2 { public: - ChargePointConstructorTestFixtureV201() : + ChargePointConstructorTestFixtureV2() : evse_connector_structure(create_evse_connector_structure()), database_handler(create_database_handler()), evse_security(std::make_shared()) { } - ~ChargePointConstructorTestFixtureV201() { + ~ChargePointConstructorTestFixtureV2() { } std::map evse_connector_structure; @@ -548,14 +546,14 @@ class ChargePointConstructorTestFixtureV201 : public ChargePointCommonTestFixtur std::shared_ptr evse_security; }; -TEST_F(ChargePointConstructorTestFixtureV201, CreateChargePoint) { +TEST_F(ChargePointConstructorTestFixtureV2, CreateChargePoint) { configure_callbacks_with_mocks(); - EXPECT_NO_THROW(ocpp::v201::ChargePoint(evse_connector_structure, device_model, database_handler, - create_message_queue(database_handler), "/tmp", evse_security, callbacks)); + EXPECT_NO_THROW(ocpp::v2::ChargePoint(evse_connector_structure, device_model, database_handler, + create_message_queue(database_handler), "/tmp", evse_security, callbacks)); } -TEST_F(ChargePointConstructorTestFixtureV201, CreateChargePoint_InitializeInCorrectOrder) { +TEST_F(ChargePointConstructorTestFixtureV2, CreateChargePoint_InitializeInCorrectOrder) { database_handler->open_connection(); configure_callbacks_with_mocks(); auto message_queue = create_message_queue(database_handler); @@ -570,49 +568,49 @@ TEST_F(ChargePointConstructorTestFixtureV201, CreateChargePoint_InitializeInCorr DEFAULT_TX_ID); database_handler->insert_or_update_charging_profile(DEFAULT_EVSE_ID, profile); - ocpp::v201::ChargePoint charge_point(evse_connector_structure, device_model, database_handler, message_queue, - "/tmp", evse_security, callbacks); + ocpp::v2::ChargePoint charge_point(evse_connector_structure, device_model, database_handler, message_queue, "/tmp", + evse_security, callbacks); EXPECT_NO_FATAL_FAILURE(charge_point.start(BootReasonEnum::PowerUp)); charge_point.stop(); } -TEST_F(ChargePointConstructorTestFixtureV201, +TEST_F(ChargePointConstructorTestFixtureV2, CreateChargePoint_EVSEConnectorStructureDefinedBadly_ThrowsDeviceModelError) { configure_callbacks_with_mocks(); auto evse_connector_structure = std::map(); - EXPECT_THROW(ocpp::v201::ChargePoint(evse_connector_structure, device_model, database_handler, - create_message_queue(database_handler), "/tmp", evse_security, callbacks), + EXPECT_THROW(ocpp::v2::ChargePoint(evse_connector_structure, device_model, database_handler, + create_message_queue(database_handler), "/tmp", evse_security, callbacks), DeviceModelError); } -TEST_F(ChargePointConstructorTestFixtureV201, CreateChargePoint_MissingDeviceModel_ThrowsInvalidArgument) { +TEST_F(ChargePointConstructorTestFixtureV2, CreateChargePoint_MissingDeviceModel_ThrowsInvalidArgument) { configure_callbacks_with_mocks(); - auto message_queue = std::make_shared>( - [this](json message) -> bool { return false; }, MessageQueueConfig{}, database_handler); + auto message_queue = std::make_shared>( + [this](json message) -> bool { return false; }, MessageQueueConfig{}, database_handler); - EXPECT_THROW(ocpp::v201::ChargePoint(evse_connector_structure, nullptr, database_handler, message_queue, "/tmp", - evse_security, callbacks), + EXPECT_THROW(ocpp::v2::ChargePoint(evse_connector_structure, nullptr, database_handler, message_queue, "/tmp", + evse_security, callbacks), std::invalid_argument); } -TEST_F(ChargePointConstructorTestFixtureV201, CreateChargePoint_MissingDatabaseHandler_ThrowsInvalidArgument) { +TEST_F(ChargePointConstructorTestFixtureV2, CreateChargePoint_MissingDatabaseHandler_ThrowsInvalidArgument) { configure_callbacks_with_mocks(); - auto message_queue = std::make_shared>( - [this](json message) -> bool { return false; }, MessageQueueConfig{}, nullptr); + auto message_queue = std::make_shared>( + [this](json message) -> bool { return false; }, MessageQueueConfig{}, nullptr); auto database_handler = nullptr; - EXPECT_THROW(ocpp::v201::ChargePoint(evse_connector_structure, device_model, database_handler, message_queue, - "/tmp", evse_security, callbacks), + EXPECT_THROW(ocpp::v2::ChargePoint(evse_connector_structure, device_model, database_handler, message_queue, "/tmp", + evse_security, callbacks), std::invalid_argument); } -TEST_F(ChargePointConstructorTestFixtureV201, CreateChargePoint_CallbacksNotValid_ThrowsInvalidArgument) { - EXPECT_THROW(ocpp::v201::ChargePoint(evse_connector_structure, device_model, database_handler, - create_message_queue(database_handler), "/tmp", evse_security, callbacks), +TEST_F(ChargePointConstructorTestFixtureV2, CreateChargePoint_CallbacksNotValid_ThrowsInvalidArgument) { + EXPECT_THROW(ocpp::v2::ChargePoint(evse_connector_structure, device_model, database_handler, + create_message_queue(database_handler), "/tmp", evse_security, callbacks), std::invalid_argument); } @@ -622,19 +620,19 @@ class TestChargePoint : public ChargePoint { TestChargePoint(const std::map& evse_connector_structure, std::shared_ptr device_model, std::shared_ptr database_handler, - std::shared_ptr> message_queue, const std::string& message_log_path, + std::shared_ptr> message_queue, const std::string& message_log_path, const std::shared_ptr evse_security, const Callbacks& callbacks) : ChargePoint(evse_connector_structure, device_model, database_handler, message_queue, message_log_path, evse_security, callbacks) { } }; -class ChargePointFunctionalityTestFixtureV201 : public ChargePointCommonTestFixtureV201 { +class ChargePointFunctionalityTestFixtureV2 : public ChargePointCommonTestFixtureV2 { public: - ChargePointFunctionalityTestFixtureV201() : + ChargePointFunctionalityTestFixtureV2() : uuid_generator(boost::uuids::random_generator()), charge_point(create_charge_point()) { } - ~ChargePointFunctionalityTestFixtureV201() { + ~ChargePointFunctionalityTestFixtureV2() { } void SetUp() override { @@ -687,7 +685,7 @@ class ChargePointFunctionalityTestFixtureV201 : public ChargePointCommonTestFixt }; // Test currently disabled because this is not working now. Should be added to the transaction functional block. -TEST_F(ChargePointFunctionalityTestFixtureV201, +TEST_F(ChargePointFunctionalityTestFixtureV2, K05FR05_RequestStartTransactionRequest_SmartChargingCtrlrEnabledTrue_ValidatesTxProfiles) { GTEST_SKIP_("Test currently disabled because this is not working now. Should be added to the transaction " "functional block."); @@ -715,7 +713,7 @@ TEST_F(ChargePointFunctionalityTestFixtureV201, } // Test currently disabled because this is not working now. Should be added to the transaction functional block. -TEST_F(ChargePointFunctionalityTestFixtureV201, +TEST_F(ChargePointFunctionalityTestFixtureV2, K05FR04_RequestStartTransactionRequest_SmartChargingCtrlrEnabledFalse_DoesNotValidateTxProfiles) { GTEST_SKIP_("Test currently disabled because this is not working now. Should be added to the transaction " "functional block."); @@ -743,7 +741,7 @@ TEST_F(ChargePointFunctionalityTestFixtureV201, } // Test currently disabled because this is not working now. Should be added to the transaction functional block. -TEST_F(ChargePointFunctionalityTestFixtureV201, K02FR05_TransactionEnds_WillDeleteTxProfilesWithTransactionID) { +TEST_F(ChargePointFunctionalityTestFixtureV2, K02FR05_TransactionEnds_WillDeleteTxProfilesWithTransactionID) { GTEST_SKIP_("Test currently disabled because this is not working now. Should be added to the transaction " "functional block."); auto database_handler = create_database_handler(); @@ -755,7 +753,7 @@ TEST_F(ChargePointFunctionalityTestFixtureV201, K02FR05_TransactionEnds_WillDele ocpp::DateTime timestamp("2024-01-17T17:00:00"); charge_point->on_transaction_started(DEFAULT_EVSE_ID, connector_id, session_id, timestamp, - ocpp::v201::TriggerReasonEnum::Authorized, MeterValue(), {}, {}, {}, {}, + ocpp::v2::TriggerReasonEnum::Authorized, MeterValue(), {}, {}, {}, {}, ChargingStateEnum::EVConnected); auto transaction = database_handler->transaction_get(DEFAULT_EVSE_ID); ASSERT_THAT(transaction, testing::NotNull()); @@ -764,4 +762,4 @@ TEST_F(ChargePointFunctionalityTestFixtureV201, K02FR05_TransactionEnds_WillDele charge_point->on_transaction_finished(DEFAULT_EVSE_ID, timestamp, MeterValue(), ReasonEnum::StoppedByEV, TriggerReasonEnum::StopAuthorized, {}, {}, ChargingStateEnum::EVConnected); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/test_component_state_manager.cpp b/tests/lib/ocpp/v2/test_component_state_manager.cpp similarity index 99% rename from tests/lib/ocpp/v201/test_component_state_manager.cpp rename to tests/lib/ocpp/v2/test_component_state_manager.cpp index f60f07214..be6e2d0a0 100644 --- a/tests/lib/ocpp/v201/test_component_state_manager.cpp +++ b/tests/lib/ocpp/v2/test_component_state_manager.cpp @@ -5,9 +5,9 @@ #include #include -#include +#include -namespace ocpp::v201 { +namespace ocpp::v2 { namespace { @@ -472,4 +472,4 @@ TEST_F(ComponentStateManagerTest, test_send_status_notification_single_connector state_mgr.send_status_notification_changed_connectors(); } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/test_composite_schedule.cpp b/tests/lib/ocpp/v2/test_composite_schedule.cpp similarity index 94% rename from tests/lib/ocpp/v201/test_composite_schedule.cpp rename to tests/lib/ocpp/v2/test_composite_schedule.cpp index c365d52f5..7db634fbd 100644 --- a/tests/lib/ocpp/v201/test_composite_schedule.cpp +++ b/tests/lib/ocpp/v2/test_composite_schedule.cpp @@ -10,13 +10,13 @@ #include "message_dispatcher_mock.hpp" #include "ocpp/common/constants.hpp" #include "ocpp/common/types.hpp" -#include "ocpp/v201/ctrlr_component_variables.hpp" -#include "ocpp/v201/device_model.hpp" -#include "ocpp/v201/device_model_storage_sqlite.hpp" -#include "ocpp/v201/functional_blocks/smart_charging.hpp" -#include "ocpp/v201/init_device_model_db.hpp" -#include "ocpp/v201/ocpp_types.hpp" -#include "ocpp/v201/utils.hpp" +#include "ocpp/v2/ctrlr_component_variables.hpp" +#include "ocpp/v2/device_model.hpp" +#include "ocpp/v2/device_model_storage_sqlite.hpp" +#include "ocpp/v2/functional_blocks/smart_charging.hpp" +#include "ocpp/v2/init_device_model_db.hpp" +#include "ocpp/v2/ocpp_types.hpp" +#include "ocpp/v2/utils.hpp" #include #include #include @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include @@ -46,7 +46,7 @@ #include #include -namespace ocpp::v201 { +namespace ocpp::v2 { static const int NR_OF_EVSES = 1; static const int STATION_WIDE_ID = 0; static const int DEFAULT_EVSE_ID = 1; @@ -56,8 +56,8 @@ constexpr int32_t DEFAULT_LIMIT_AMPERE = 57; constexpr int32_t DEFAULT_LIMIT_WATT = 55612; constexpr int32_t DEFAULT_NR_PHASES = 3; static const std::string DEFAULT_TX_ID = "f1522902-1170-416f-8e43-9e3bce28fde7"; -static const std::string MIGRATION_FILES_PATH = "./resources/v201/device_model_migration_files"; -static const std::string CONFIG_PATH = "./resources/example_config/v201/component_config"; +static const std::string MIGRATION_FILES_PATH = "./resources/v2/device_model_migration_files"; +static const std::string CONFIG_PATH = "./resources/example_config/v2/component_config"; static const std::string DEVICE_MODEL_DB_IN_MEMORY_PATH = "file::memory:?cache=shared"; using ::testing::MockFunction; @@ -74,7 +74,7 @@ class TestSmartCharging : public SmartCharging { using SmartCharging::SmartCharging; }; -class CompositeScheduleTestFixtureV201 : public DatabaseTestingUtils { +class CompositeScheduleTestFixtureV2 : public DatabaseTestingUtils { protected: void SetUp() override { } @@ -154,7 +154,7 @@ class CompositeScheduleTestFixtureV201 : public DatabaseTestingUtils { ON_CALL(*database_handler, get_charging_profiles_for_evse(evse_id)).WillByDefault(testing::Return(profiles)); } - CompositeScheduleTestFixtureV201() : + CompositeScheduleTestFixtureV2() : evse_manager(std::make_unique(NR_OF_EVSES)), device_model_test_helper(), mock_dispatcher(), @@ -189,7 +189,7 @@ class CompositeScheduleTestFixtureV201 : public DatabaseTestingUtils { std::unique_ptr database_connection = std::make_unique(fs::path("/tmp/ocpp201") / "cp.db"); this->database_handler = - std::make_unique(std::move(database_connection), MIGRATION_FILES_LOCATION_V201); + std::make_unique(std::move(database_connection), MIGRATION_FILES_LOCATION_V2); database_handler->open_connection(); return std::make_unique(*device_model, *this->evse_manager, connectivity_manager, mock_dispatcher, *database_handler, @@ -216,7 +216,7 @@ class CompositeScheduleTestFixtureV201 : public DatabaseTestingUtils { boost::uuids::random_generator uuid_generator = boost::uuids::random_generator(); }; -TEST_F(CompositeScheduleTestFixtureV201, NoSchedulesPresent) { +TEST_F(CompositeScheduleTestFixtureV2, NoSchedulesPresent) { const DateTime start_time = ocpp::DateTime("2024-01-02T00:00:00"); const DateTime end_time = ocpp::DateTime("2024-01-02T01:00:00"); @@ -236,7 +236,7 @@ TEST_F(CompositeScheduleTestFixtureV201, NoSchedulesPresent) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, ExtraSeconds) { +TEST_F(CompositeScheduleTestFixtureV2, ExtraSeconds) { this->load_charging_profiles_for_evse("singles/Absolute_301.json", STATION_WIDE_ID); const DateTime start_time = ocpp::DateTime("2024-01-01T12:01:59"); @@ -262,7 +262,7 @@ TEST_F(CompositeScheduleTestFixtureV201, ExtraSeconds) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, FoundationTest_Grid) { +TEST_F(CompositeScheduleTestFixtureV2, FoundationTest_Grid) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/grid/", DEFAULT_EVSE_ID); evse_manager->open_transaction(DEFAULT_EVSE_ID, DEFAULT_TX_ID); @@ -380,7 +380,7 @@ TEST_F(CompositeScheduleTestFixtureV201, FoundationTest_Grid) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, LayeredTest_SameStartTime) { +TEST_F(CompositeScheduleTestFixtureV2, LayeredTest_SameStartTime) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/layered/", DEFAULT_EVSE_ID); evse_manager->open_transaction(DEFAULT_EVSE_ID, DEFAULT_TX_ID); @@ -465,7 +465,7 @@ TEST_F(CompositeScheduleTestFixtureV201, LayeredTest_SameStartTime) { } } -TEST_F(CompositeScheduleTestFixtureV201, LayeredRecurringTest_FutureStartTime) { +TEST_F(CompositeScheduleTestFixtureV2, LayeredRecurringTest_FutureStartTime) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/layered_recurring/", DEFAULT_EVSE_ID); evse_manager->open_transaction(DEFAULT_EVSE_ID, DEFAULT_TX_ID); @@ -490,7 +490,7 @@ TEST_F(CompositeScheduleTestFixtureV201, LayeredRecurringTest_FutureStartTime) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, LayeredTest_PreviousStartTime) { +TEST_F(CompositeScheduleTestFixtureV2, LayeredTest_PreviousStartTime) { this->load_charging_profiles_for_evse("singles/TXProfile_Absolute_Start18-04.json", DEFAULT_EVSE_ID); evse_manager->open_transaction(DEFAULT_EVSE_ID, DEFAULT_TX_ID); @@ -517,7 +517,7 @@ TEST_F(CompositeScheduleTestFixtureV201, LayeredTest_PreviousStartTime) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, LayeredRecurringTest_PreviousStartTime) { +TEST_F(CompositeScheduleTestFixtureV2, LayeredRecurringTest_PreviousStartTime) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/layered_recurring/", DEFAULT_EVSE_ID); evse_manager->open_transaction(DEFAULT_EVSE_ID, DEFAULT_TX_ID); @@ -556,7 +556,7 @@ TEST_F(CompositeScheduleTestFixtureV201, LayeredRecurringTest_PreviousStartTime) /** * Calculate Composite Schedule */ -TEST_F(CompositeScheduleTestFixtureV201, ValidateBaselineProfileVector) { +TEST_F(CompositeScheduleTestFixtureV2, ValidateBaselineProfileVector) { const DateTime start_time = ocpp::DateTime("2024-01-17T18:01:00"); const DateTime end_time = ocpp::DateTime("2024-01-18T06:00:00"); std::vector profiles = SmartChargingTestUtils::get_baseline_profile_vector(); @@ -591,7 +591,7 @@ TEST_F(CompositeScheduleTestFixtureV201, ValidateBaselineProfileVector) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, RelativeProfile_minutia) { +TEST_F(CompositeScheduleTestFixtureV2, RelativeProfile_minutia) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/relative/", DEFAULT_EVSE_ID); const DateTime start_time = ocpp::DateTime("2024-05-17T05:00:00"); @@ -617,7 +617,7 @@ TEST_F(CompositeScheduleTestFixtureV201, RelativeProfile_minutia) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, RelativeProfile_e2e) { +TEST_F(CompositeScheduleTestFixtureV2, RelativeProfile_e2e) { const DateTime start_time = ocpp::DateTime("2024-05-17T05:00:00"); const DateTime end_time = ocpp::DateTime("2024-05-17T06:01:00"); @@ -647,7 +647,7 @@ TEST_F(CompositeScheduleTestFixtureV201, RelativeProfile_e2e) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, DemoCaseOne_17th) { +TEST_F(CompositeScheduleTestFixtureV2, DemoCaseOne_17th) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/case_one/", DEFAULT_EVSE_ID); evse_manager->open_transaction(DEFAULT_EVSE_ID, DEFAULT_TX_ID); @@ -680,7 +680,7 @@ TEST_F(CompositeScheduleTestFixtureV201, DemoCaseOne_17th) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, DemoCaseOne_19th) { +TEST_F(CompositeScheduleTestFixtureV2, DemoCaseOne_19th) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/case_one/", DEFAULT_EVSE_ID); evse_manager->open_transaction(DEFAULT_EVSE_ID, DEFAULT_TX_ID); @@ -709,7 +709,7 @@ TEST_F(CompositeScheduleTestFixtureV201, DemoCaseOne_19th) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, MaxOverridesHigherLimits) { +TEST_F(CompositeScheduleTestFixtureV2, MaxOverridesHigherLimits) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/max/0/", STATION_WIDE_ID); this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/max/1/", DEFAULT_EVSE_ID); @@ -738,7 +738,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MaxOverridesHigherLimits) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, MaxOverridenByLowerLimits) { +TEST_F(CompositeScheduleTestFixtureV2, MaxOverridenByLowerLimits) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/max/0/", STATION_WIDE_ID); this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/max/1/", DEFAULT_EVSE_ID); @@ -767,7 +767,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MaxOverridenByLowerLimits) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, ExternalOverridesHigherLimits) { +TEST_F(CompositeScheduleTestFixtureV2, ExternalOverridesHigherLimits) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/external/0/", STATION_WIDE_ID); this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/external/1/", DEFAULT_EVSE_ID); @@ -796,7 +796,7 @@ TEST_F(CompositeScheduleTestFixtureV201, ExternalOverridesHigherLimits) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, ExternalOverridenByLowerLimits) { +TEST_F(CompositeScheduleTestFixtureV2, ExternalOverridenByLowerLimits) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/external/0/", STATION_WIDE_ID); this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/external/1/", DEFAULT_EVSE_ID); @@ -825,7 +825,7 @@ TEST_F(CompositeScheduleTestFixtureV201, ExternalOverridenByLowerLimits) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, OCTT_TC_K_41_CS) { +TEST_F(CompositeScheduleTestFixtureV2, OCTT_TC_K_41_CS) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/OCCT_TC_K_41_CS/0/", STATION_WIDE_ID); this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/OCCT_TC_K_41_CS/1/", DEFAULT_EVSE_ID); @@ -871,7 +871,7 @@ TEST_F(CompositeScheduleTestFixtureV201, OCTT_TC_K_41_CS) { ASSERT_EQ(actual, expected); } -TEST_F(CompositeScheduleTestFixtureV201, SingleStationMaxForEvse0) { +TEST_F(CompositeScheduleTestFixtureV2, SingleStationMaxForEvse0) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_401.json", STATION_WIDE_ID); const DateTime start_time = ocpp::DateTime("2024-08-21T08:00:00"); @@ -896,7 +896,7 @@ TEST_F(CompositeScheduleTestFixtureV201, SingleStationMaxForEvse0) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileForEvse0WithSingleEvse) { +TEST_F(CompositeScheduleTestFixtureV2, SingleTxDefaultProfileForEvse0WithSingleEvse) { this->load_charging_profiles_for_evse("singles/Relative_303.json", STATION_WIDE_ID); const DateTime start_time = ocpp::DateTime("2024-01-02T08:00:00"); @@ -920,7 +920,7 @@ TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileForEvse0WithSingl // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileForEvse0WithMultipleEvses_Current) { +TEST_F(CompositeScheduleTestFixtureV2, SingleTxDefaultProfileForEvse0WithMultipleEvses_Current) { this->load_charging_profiles_for_evse("singles/Relative_303.json", STATION_WIDE_ID); const DateTime start_time = ocpp::DateTime("2024-01-02T08:00:00"); @@ -948,7 +948,7 @@ TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileForEvse0WithMulti // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileForEvse0WithMultipleEvses_Power) { +TEST_F(CompositeScheduleTestFixtureV2, SingleTxDefaultProfileForEvse0WithMultipleEvses_Power) { this->load_charging_profiles_for_evse("singles/TXDefaultProfile_25_Watt.json", STATION_WIDE_ID); constexpr int32_t nr_of_evses = 2; @@ -979,7 +979,7 @@ TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileForEvse0WithMulti // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileWithStationMaxForEvse0WithSingleEvse) { +TEST_F(CompositeScheduleTestFixtureV2, SingleTxDefaultProfileWithStationMaxForEvse0WithSingleEvse) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_401.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/Relative_303.json", DEFAULT_EVSE_ID); @@ -1005,7 +1005,7 @@ TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileWithStationMaxFor // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileWithStationMaxForEvse0WithMultipleEvses) { +TEST_F(CompositeScheduleTestFixtureV2, SingleTxDefaultProfileWithStationMaxForEvse0WithMultipleEvses) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_401.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/Relative_303.json", DEFAULT_EVSE_ID); this->load_charging_profiles_for_evse("singles/Relative_303.json", 2); @@ -1037,7 +1037,7 @@ TEST_F(CompositeScheduleTestFixtureV201, SingleTxDefaultProfileWithStationMaxFor // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, TxProfilePerEvseWithMultipleEvses) { +TEST_F(CompositeScheduleTestFixtureV2, TxProfilePerEvseWithMultipleEvses) { this->load_charging_profiles_for_evse("singles/Recurring_Daily_301.json", DEFAULT_EVSE_ID); this->load_charging_profiles_for_evse("singles/Relative_303.json", 2); @@ -1070,7 +1070,7 @@ TEST_F(CompositeScheduleTestFixtureV201, TxProfilePerEvseWithMultipleEvses) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_16A_1P) { +TEST_F(CompositeScheduleTestFixtureV2, MixingCurrentAndPower_16A_1P) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_24_Ampere.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/TXDefaultProfile_25_Watt.json", DEFAULT_EVSE_ID); @@ -1094,7 +1094,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_16A_1P) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_16A_3P) { +TEST_F(CompositeScheduleTestFixtureV2, MixingCurrentAndPower_16A_3P) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_24_Ampere.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/TXDefaultProfile_25_Watt.json", DEFAULT_EVSE_ID); @@ -1121,7 +1121,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_16A_3P) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_1P) { +TEST_F(CompositeScheduleTestFixtureV2, MixingCurrentAndPower_10A_1P) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_24_Ampere.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/TXDefaultProfile_25_Watt.json", DEFAULT_EVSE_ID); @@ -1145,7 +1145,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_1P) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_3P) { +TEST_F(CompositeScheduleTestFixtureV2, MixingCurrentAndPower_10A_3P) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_24_Ampere.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/TXDefaultProfile_25_Watt.json", DEFAULT_EVSE_ID); @@ -1171,7 +1171,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_3P) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_1P_RequestPower) { +TEST_F(CompositeScheduleTestFixtureV2, MixingCurrentAndPower_10A_1P_RequestPower) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_24_Ampere.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/TXDefaultProfile_25_Watt.json", DEFAULT_EVSE_ID); @@ -1195,7 +1195,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_1P_RequestPow // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_3P_RequestPower) { +TEST_F(CompositeScheduleTestFixtureV2, MixingCurrentAndPower_10A_3P_RequestPower) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_24_Ampere.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/TXDefaultProfile_25_Watt.json", DEFAULT_EVSE_ID); @@ -1221,7 +1221,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MixingCurrentAndPower_10A_3P_RequestPow // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, TxProfilePerEvseWithMultipleEvses_DifferentNrOfPhases) { +TEST_F(CompositeScheduleTestFixtureV2, TxProfilePerEvseWithMultipleEvses_DifferentNrOfPhases) { this->load_charging_profiles_for_evse("singles/Recurring_Daily_302_phase_limit.json", DEFAULT_EVSE_ID); this->load_charging_profiles_for_evse("singles/Relative_302_phase_limit.json", 2); @@ -1251,7 +1251,7 @@ TEST_F(CompositeScheduleTestFixtureV201, TxProfilePerEvseWithMultipleEvses_Diffe // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, MixingNumberOfPhasesOnSingleEvse) { +TEST_F(CompositeScheduleTestFixtureV2, MixingNumberOfPhasesOnSingleEvse) { this->load_charging_profiles_for_evse("singles/ChargingStationMaxProfile_24_Ampere.json", STATION_WIDE_ID); this->load_charging_profiles_for_evse("singles/Relative_302_phase_limit.json", DEFAULT_EVSE_ID); @@ -1278,7 +1278,7 @@ TEST_F(CompositeScheduleTestFixtureV201, MixingNumberOfPhasesOnSingleEvse) { // clang-format on } -TEST_F(CompositeScheduleTestFixtureV201, NoGapsWithSequentialProfiles) { +TEST_F(CompositeScheduleTestFixtureV2, NoGapsWithSequentialProfiles) { this->load_charging_profiles_for_evse(BASE_JSON_PATH + "/no_gap/", STATION_WIDE_ID); const DateTime start_time = ocpp::DateTime("2024-01-02T08:00:00"); @@ -1301,4 +1301,4 @@ TEST_F(CompositeScheduleTestFixtureV201, NoGapsWithSequentialProfiles) { )); // clang-format on } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v201/test_database_handler.cpp b/tests/lib/ocpp/v2/test_database_handler.cpp similarity index 99% rename from tests/lib/ocpp/v201/test_database_handler.cpp rename to tests/lib/ocpp/v2/test_database_handler.cpp index 5a0fd8795..f9e437fb7 100644 --- a/tests/lib/ocpp/v201/test_database_handler.cpp +++ b/tests/lib/ocpp/v2/test_database_handler.cpp @@ -3,21 +3,21 @@ #include "comparators.hpp" #include "database_testing_utils.hpp" -#include "ocpp/v201/enums.hpp" -#include "ocpp/v201/messages/GetChargingProfiles.hpp" -#include "ocpp/v201/ocpp_enums.hpp" -#include "ocpp/v201/ocpp_types.hpp" +#include "ocpp/v2/enums.hpp" +#include "ocpp/v2/messages/GetChargingProfiles.hpp" +#include "ocpp/v2/ocpp_enums.hpp" +#include "ocpp/v2/ocpp_types.hpp" #include "gmock/gmock.h" #include "gtest/gtest.h" #include #include #include #include -#include +#include #include using namespace ocpp; -using namespace ocpp::v201; +using namespace ocpp::v2; const int STATION_WIDE_ID = 0; const int DEFAULT_EVSE_ID = 1; @@ -25,7 +25,7 @@ const int DEFAULT_EVSE_ID = 1; class DatabaseHandlerTest : public DatabaseTestingUtils { public: DatabaseHandler database_handler{std::make_unique("file::memory:?cache=shared"), - std::filesystem::path(MIGRATION_FILES_LOCATION_V201)}; + std::filesystem::path(MIGRATION_FILES_LOCATION_V2)}; DatabaseHandlerTest() { this->database_handler.open_connection(); diff --git a/tests/lib/ocpp/v201/test_database_migration_files.cpp b/tests/lib/ocpp/v2/test_database_migration_files.cpp similarity index 84% rename from tests/lib/ocpp/v201/test_database_migration_files.cpp rename to tests/lib/ocpp/v2/test_database_migration_files.cpp index 475e55380..178867ab7 100644 --- a/tests/lib/ocpp/v201/test_database_migration_files.cpp +++ b/tests/lib/ocpp/v2/test_database_migration_files.cpp @@ -3,19 +3,19 @@ #include -// Apply generic test cases to v201 migrations -INSTANTIATE_TEST_SUITE_P(V201, DatabaseMigrationFilesTest, - ::testing::Values(std::make_tuple(std::filesystem::path(MIGRATION_FILES_LOCATION_V201), - MIGRATION_FILE_VERSION_V201))); +// Apply generic test cases to v2 migrations +INSTANTIATE_TEST_SUITE_P(V2, DatabaseMigrationFilesTest, + ::testing::Values(std::make_tuple(std::filesystem::path(MIGRATION_FILES_LOCATION_V2), + MIGRATION_FILE_VERSION_V2))); -// Apply v201 specific test cases to migrations -using DatabaseMigrationFilesTestV201 = DatabaseMigrationFilesTest; +// Apply v2 specific test cases to migrations +using DatabaseMigrationFilesTestV2 = DatabaseMigrationFilesTest; -INSTANTIATE_TEST_SUITE_P(V201, DatabaseMigrationFilesTestV201, - ::testing::Values(std::make_tuple(std::filesystem::path(MIGRATION_FILES_LOCATION_V201), - MIGRATION_FILE_VERSION_V201))); +INSTANTIATE_TEST_SUITE_P(V2, DatabaseMigrationFilesTestV2, + ::testing::Values(std::make_tuple(std::filesystem::path(MIGRATION_FILES_LOCATION_V2), + MIGRATION_FILE_VERSION_V2))); -TEST_P(DatabaseMigrationFilesTestV201, V201_MigrationFile2_AuthCacheManagement) { +TEST_P(DatabaseMigrationFilesTestV2, V2_MigrationFile2_AuthCacheManagement) { DatabaseSchemaUpdater updater{this->database.get()}; EXPECT_TRUE(updater.apply_migration_files(this->migration_files_path, 1)); diff --git a/tests/lib/ocpp/v201/test_device_model.cpp b/tests/lib/ocpp/v2/test_device_model.cpp similarity index 94% rename from tests/lib/ocpp/v201/test_device_model.cpp rename to tests/lib/ocpp/v2/test_device_model.cpp index 2ce6e2823..27b7621eb 100644 --- a/tests/lib/ocpp/v201/test_device_model.cpp +++ b/tests/lib/ocpp/v2/test_device_model.cpp @@ -2,12 +2,12 @@ // Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest #include -#include -#include -#include +#include +#include +#include namespace ocpp { -namespace v201 { +namespace v2 { class DeviceModelTest : public ::testing::Test { protected: @@ -22,7 +22,7 @@ class DeviceModelTest : public ::testing::Test { void TearDown() override { // reset the value to default - dm->set_value(cv.component, cv.variable.value(), ocpp::v201::AttributeEnum::Actual, "10", "test"); + dm->set_value(cv.component, cv.variable.value(), ocpp::v2::AttributeEnum::Actual, "10", "test"); } }; @@ -30,18 +30,18 @@ class DeviceModelTest : public ::testing::Test { /// set to 5 TEST_F(DeviceModelTest, test_allow_zero) { // default value is 10 - auto r = dm->get_value(cv, ocpp::v201::AttributeEnum::Actual); + auto r = dm->get_value(cv, ocpp::v2::AttributeEnum::Actual); ASSERT_EQ(r, 10); // try to set to value of 2, which is not allowed because minLimit of - auto sv_result = dm->set_value(cv.component, cv.variable.value(), ocpp::v201::AttributeEnum::Actual, "2", "test"); + auto sv_result = dm->set_value(cv.component, cv.variable.value(), ocpp::v2::AttributeEnum::Actual, "2", "test"); ASSERT_EQ(sv_result, SetVariableStatusEnum::Rejected); // try to set to 0, which is allowed because 0 is an exception - sv_result = dm->set_value(cv.component, cv.variable.value(), ocpp::v201::AttributeEnum::Actual, "0", "test"); + sv_result = dm->set_value(cv.component, cv.variable.value(), ocpp::v2::AttributeEnum::Actual, "0", "test"); ASSERT_EQ(sv_result, SetVariableStatusEnum::Accepted); - r = dm->get_value(cv, ocpp::v201::AttributeEnum::Actual); + r = dm->get_value(cv, ocpp::v2::AttributeEnum::Actual); ASSERT_EQ(r, 0); } @@ -276,5 +276,5 @@ TEST_F(DeviceModelTest, test_clear_monitors) { dm->clear_monitors(hardwired_monitor_ids, true); } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/tests/lib/ocpp/v201/test_device_model_storage_sqlite.cpp b/tests/lib/ocpp/v2/test_device_model_storage_sqlite.cpp similarity index 91% rename from tests/lib/ocpp/v201/test_device_model_storage_sqlite.cpp rename to tests/lib/ocpp/v2/test_device_model_storage_sqlite.cpp index 28a0da2ba..ba91a3ccd 100644 --- a/tests/lib/ocpp/v201/test_device_model_storage_sqlite.cpp +++ b/tests/lib/ocpp/v2/test_device_model_storage_sqlite.cpp @@ -3,10 +3,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { class DeviceModelStorageSQLiteTest : public ::testing::Test { protected: @@ -28,5 +28,5 @@ TEST_F(DeviceModelStorageSQLiteTest, test_check_integrity_invalid) { EXPECT_THROW(dm_storage.check_integrity(), DeviceModelError); } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/tests/lib/ocpp/v201/test_init_device_model_db.cpp b/tests/lib/ocpp/v2/test_init_device_model_db.cpp similarity index 98% rename from tests/lib/ocpp/v201/test_init_device_model_db.cpp rename to tests/lib/ocpp/v2/test_init_device_model_db.cpp index 74fbbd0cc..7ab997745 100644 --- a/tests/lib/ocpp/v201/test_init_device_model_db.cpp +++ b/tests/lib/ocpp/v2/test_init_device_model_db.cpp @@ -3,27 +3,26 @@ #include -#include +#include #define private public // database_exists must be set with this test, but std::filesystem::exists is hard to stub, so this way we can set it // in the test. -#include +#include #undef private #include -namespace ocpp::v201 { +namespace ocpp::v2 { class InitDeviceModelDbTest : public DatabaseTestingUtils { protected: const std::string DATABASE_PATH = "file::memory:?cache=shared"; - const std::string MIGRATION_FILES_PATH = "./resources/v201/device_model_migration_files"; - const std::string CONFIGS_PATH = "./resources/config/v201/component_config"; - const std::string CONFIGS_PATH_CHANGED = "./resources/config/v201/changed/component_config"; - const std::string CONFIGS_PATH_REQUIRED_NO_VALUE = - "./resources/config/v201/wrong/component_config_required_no_value"; - const std::string CONFIGS_PATH_WRONG_VALUE_TYPE = "./resources/config/v201/wrong/component_config_wrong_value_type"; + const std::string MIGRATION_FILES_PATH = "./resources/v2/device_model_migration_files"; + const std::string CONFIGS_PATH = "./resources/config/v2/component_config"; + const std::string CONFIGS_PATH_CHANGED = "./resources/config/v2/changed/component_config"; + const std::string CONFIGS_PATH_REQUIRED_NO_VALUE = "./resources/config/v2/wrong/component_config_required_no_value"; + const std::string CONFIGS_PATH_WRONG_VALUE_TYPE = "./resources/config/v2/wrong/component_config_wrong_value_type"; public: InitDeviceModelDbTest() { @@ -421,8 +420,8 @@ TEST_F(InitDeviceModelDbTest, wrong_config_path) { TEST_F(InitDeviceModelDbTest, default_device_model_config) { // Test if the default device model config is correct and will create a valid database with valid values. - const static std::string MIGRATION_FILES_PATH_DEFAULT = "./resources/v201/device_model_migration_files"; - const static std::string CONFIG_PATH_DEFAULT = "./resources/example_config/v201/component_config"; + const static std::string MIGRATION_FILES_PATH_DEFAULT = "./resources/v2/device_model_migration_files"; + const static std::string CONFIG_PATH_DEFAULT = "./resources/example_config/v2/component_config"; InitDeviceModelDb db(DATABASE_PATH, MIGRATION_FILES_PATH_DEFAULT); EXPECT_NO_THROW(db.initialize_database(CONFIG_PATH_DEFAULT, true)); } @@ -865,4 +864,4 @@ void InitDeviceModelDbTest::set_attribute_source(const std::string& component_na } } -} // namespace ocpp::v201 +} // namespace ocpp::v2 diff --git a/tests/lib/ocpp/v2/test_message_queue.cpp b/tests/lib/ocpp/v2/test_message_queue.cpp new file mode 100644 index 000000000..09f02f135 --- /dev/null +++ b/tests/lib/ocpp/v2/test_message_queue.cpp @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest + +#include + +#include +#include + +namespace ocpp { + +namespace v2 { + +class ControlMessageV2Test : public ::testing::Test { + +protected: +}; + +TEST_F(ControlMessageV2Test, test_is_transactional) { + + EXPECT_TRUE(is_transaction_message((ControlMessage{ + Call{ + v2::TransactionEventRequest{}}}.messageType))); + + EXPECT_TRUE(!is_transaction_message( + ControlMessage{Call{v2::AuthorizeRequest{}}}.messageType)); +} + +TEST_F(ControlMessageV2Test, test_is_transactional_update) { + + v2::TransactionEventRequest transaction_event_request{}; + transaction_event_request.eventType = v2::TransactionEventEnum::Updated; + + EXPECT_TRUE((ControlMessage{Call{transaction_event_request}} + .is_transaction_update_message())); + + transaction_event_request.eventType = v2::TransactionEventEnum::Started; + EXPECT_TRUE(!(ControlMessage{Call{transaction_event_request}} + .is_transaction_update_message())); + + transaction_event_request.eventType = v2::TransactionEventEnum::Ended; + EXPECT_TRUE(!(ControlMessage{Call{transaction_event_request}} + .is_transaction_update_message())); + + EXPECT_TRUE(!(ControlMessage{Call{v2::AuthorizeRequest{}}} + .is_transaction_update_message())); +} + +} // namespace v2 +} // namespace ocpp diff --git a/tests/lib/ocpp/v201/test_notify_report_requests_splitter.cpp b/tests/lib/ocpp/v2/test_notify_report_requests_splitter.cpp similarity index 98% rename from tests/lib/ocpp/v201/test_notify_report_requests_splitter.cpp rename to tests/lib/ocpp/v2/test_notify_report_requests_splitter.cpp index 5d2ae65c2..7e748380d 100644 --- a/tests/lib/ocpp/v201/test_notify_report_requests_splitter.cpp +++ b/tests/lib/ocpp/v2/test_notify_report_requests_splitter.cpp @@ -4,10 +4,10 @@ #include #include -#include +#include namespace ocpp { -namespace v201 { +namespace v2 { class NotifyReportRequestsSplitterTest : public ::testing::Test { int message_count = 0; @@ -160,5 +160,5 @@ TEST_F(NotifyReportRequestsSplitterTest, test_splits_contains_at_least_one_repor } } -} // namespace v201 +} // namespace v2 } // namespace ocpp diff --git a/tests/lib/ocpp/v201/test_ocsp_updater.cpp b/tests/lib/ocpp/v2/test_ocsp_updater.cpp similarity index 86% rename from tests/lib/ocpp/v201/test_ocsp_updater.cpp rename to tests/lib/ocpp/v2/test_ocsp_updater.cpp index 2c830e081..3f14d740f 100644 --- a/tests/lib/ocpp/v201/test_ocsp_updater.cpp +++ b/tests/lib/ocpp/v2/test_ocsp_updater.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include namespace ocpp { @@ -25,7 +25,7 @@ ACTION_P2(SignalCallsCompleteVoid, semaphore) { class ChargePointMock { public: - MOCK_METHOD(v201::GetCertificateStatusResponse, get_certificate_status, (v201::GetCertificateStatusRequest), ()); + MOCK_METHOD(v2::GetCertificateStatusResponse, get_certificate_status, (v2::GetCertificateStatusRequest), ()); }; class OcspUpdaterTest : public ::testing::Test { @@ -80,22 +80,22 @@ class OcspUpdaterTest : public ::testing::Test { certificate_hash_data3.serialNumber = "serial3"; this->example_hash_data.push_back(certificate_hash_data3); - v201::GetCertificateStatusRequest example_get_cert_status_request_1; - example_get_cert_status_request_1.ocspRequestData.hashAlgorithm = v201::HashAlgorithmEnum::SHA256; + v2::GetCertificateStatusRequest example_get_cert_status_request_1; + example_get_cert_status_request_1.ocspRequestData.hashAlgorithm = v2::HashAlgorithmEnum::SHA256; example_get_cert_status_request_1.ocspRequestData.issuerNameHash = "issuerHash1"; example_get_cert_status_request_1.ocspRequestData.issuerKeyHash = "issuerKey1"; example_get_cert_status_request_1.ocspRequestData.serialNumber = "serial1"; example_get_cert_status_request_1.ocspRequestData.responderURL = "responder1"; this->example_status_requests.push_back(example_get_cert_status_request_1); - v201::GetCertificateStatusRequest example_get_cert_status_request_2; - example_get_cert_status_request_2.ocspRequestData.hashAlgorithm = v201::HashAlgorithmEnum::SHA384; + v2::GetCertificateStatusRequest example_get_cert_status_request_2; + example_get_cert_status_request_2.ocspRequestData.hashAlgorithm = v2::HashAlgorithmEnum::SHA384; example_get_cert_status_request_2.ocspRequestData.issuerNameHash = "issuerHash2"; example_get_cert_status_request_2.ocspRequestData.issuerKeyHash = "issuerKey2"; example_get_cert_status_request_2.ocspRequestData.serialNumber = "serial2"; example_get_cert_status_request_2.ocspRequestData.responderURL = "responder2"; this->example_status_requests.push_back(example_get_cert_status_request_2); - v201::GetCertificateStatusRequest example_get_cert_status_request_3; - example_get_cert_status_request_3.ocspRequestData.hashAlgorithm = v201::HashAlgorithmEnum::SHA512; + v2::GetCertificateStatusRequest example_get_cert_status_request_3; + example_get_cert_status_request_3.ocspRequestData.hashAlgorithm = v2::HashAlgorithmEnum::SHA512; example_get_cert_status_request_3.ocspRequestData.issuerNameHash = "issuerHash3"; example_get_cert_status_request_3.ocspRequestData.issuerKeyHash = "issuerKey3"; example_get_cert_status_request_3.ocspRequestData.serialNumber = "serial3"; @@ -106,12 +106,12 @@ class OcspUpdaterTest : public ::testing::Test { void TearDown() override { } - v201::cert_status_func status_update; + v2::cert_status_func status_update; std::shared_ptr evse_security; std::shared_ptr charge_point; std::vector example_ocsp_data; - std::vector example_status_requests; + std::vector example_status_requests; std::vector example_hash_data; boost::interprocess::interprocess_semaphore calls_complete = boost::interprocess::interprocess_semaphore(0); @@ -119,12 +119,12 @@ class OcspUpdaterTest : public ::testing::Test { /// \brief Tests a successful update for multiple certs on boot TEST_F(OcspUpdaterTest, test_success_boot_many) { - auto ocsp_updater = std::make_unique(this->evse_security, this->status_update); + auto ocsp_updater = std::make_unique(this->evse_security, this->status_update); testing::Sequence seq; - v201::GetCertificateStatusResponse response_success; + v2::GetCertificateStatusResponse response_success; response_success.ocspResult = "EXAMPLE OCSP RESULT"; - response_success.status = v201::GetCertificateStatusEnum::Accepted; + response_success.status = v2::GetCertificateStatusEnum::Accepted; EXPECT_CALL(*this->evse_security, get_v2g_ocsp_request_data()) .Times(1) @@ -163,17 +163,17 @@ TEST_F(OcspUpdaterTest, test_success_boot_many) { /// \brief Tests retry logic on CSMS failure to update, multiple certs TEST_F(OcspUpdaterTest, test_retry_boot_many) { - auto ocsp_updater = std::make_unique(this->evse_security, this->status_update, - std::chrono::hours(167), std::chrono::seconds(0)); + auto ocsp_updater = std::make_unique(this->evse_security, this->status_update, + std::chrono::hours(167), std::chrono::seconds(0)); testing::Sequence seq; - v201::GetCertificateStatusResponse response_success; + v2::GetCertificateStatusResponse response_success; response_success.ocspResult = "EXAMPLE OCSP RESULT"; - response_success.status = v201::GetCertificateStatusEnum::Accepted; - v201::GetCertificateStatusResponse response_fail_status; - response_fail_status.status = v201::GetCertificateStatusEnum::Failed; - v201::GetCertificateStatusResponse response_fail_empty; - response_fail_empty.status = v201::GetCertificateStatusEnum::Accepted; + response_success.status = v2::GetCertificateStatusEnum::Accepted; + v2::GetCertificateStatusResponse response_fail_status; + response_fail_status.status = v2::GetCertificateStatusEnum::Failed; + v2::GetCertificateStatusResponse response_fail_empty; + response_fail_empty.status = v2::GetCertificateStatusEnum::Accepted; EXPECT_CALL(*this->evse_security, get_v2g_ocsp_request_data()) .Times(1) @@ -235,12 +235,12 @@ TEST_F(OcspUpdaterTest, test_retry_boot_many) { /// \brief Tests certificates are re-verified over time TEST_F(OcspUpdaterTest, test_reverify_logic) { auto ocsp_updater = - std::make_unique(this->evse_security, this->status_update, std::chrono::seconds(0)); + std::make_unique(this->evse_security, this->status_update, std::chrono::seconds(0)); testing::Sequence seq; - v201::GetCertificateStatusResponse response_success; + v2::GetCertificateStatusResponse response_success; response_success.ocspResult = "EXAMPLE OCSP RESULT"; - response_success.status = v201::GetCertificateStatusEnum::Accepted; + response_success.status = v2::GetCertificateStatusEnum::Accepted; EXPECT_CALL(*this->evse_security, get_v2g_ocsp_request_data()) .Times(1) @@ -283,12 +283,12 @@ TEST_F(OcspUpdaterTest, test_reverify_logic) { /// \brief Tests triggering an update before the deadline TEST_F(OcspUpdaterTest, test_trigger) { - auto ocsp_updater = std::make_unique(this->evse_security, this->status_update); + auto ocsp_updater = std::make_unique(this->evse_security, this->status_update); testing::Sequence seq; - v201::GetCertificateStatusResponse response_success; + v2::GetCertificateStatusResponse response_success; response_success.ocspResult = "EXAMPLE OCSP RESULT"; - response_success.status = v201::GetCertificateStatusEnum::Accepted; + response_success.status = v2::GetCertificateStatusEnum::Accepted; EXPECT_CALL(*this->evse_security, get_v2g_ocsp_request_data()) .Times(1) @@ -333,7 +333,7 @@ TEST_F(OcspUpdaterTest, test_trigger) { /// \brief Triggering while the updater is not running should throw an exception TEST_F(OcspUpdaterTest, test_exception_trigger_when_not_running) { - auto ocsp_updater = std::make_unique(this->evse_security, this->status_update); + auto ocsp_updater = std::make_unique(this->evse_security, this->status_update); ASSERT_THROW(ocsp_updater->trigger_ocsp_cache_update(), std::logic_error); ocsp_updater->start(); diff --git a/tests/lib/ocpp/v201/test_profile.cpp b/tests/lib/ocpp/v2/test_profile.cpp similarity index 99% rename from tests/lib/ocpp/v201/test_profile.cpp rename to tests/lib/ocpp/v2/test_profile.cpp index 7d885682c..a443c4d44 100644 --- a/tests/lib/ocpp/v201/test_profile.cpp +++ b/tests/lib/ocpp/v2/test_profile.cpp @@ -11,17 +11,17 @@ #include "everest/logging.hpp" #include "ocpp/common/constants.hpp" #include "ocpp/common/types.hpp" -#include "ocpp/v201/ocpp_types.hpp" -#include "ocpp/v201/utils.hpp" +#include "ocpp/v2/ocpp_types.hpp" +#include "ocpp/v2/utils.hpp" #include "smart_charging_test_utils.hpp" constexpr ocpp::CompositeScheduleDefaultLimits DEFAULT_LIMITS = {48, 33120, 3}; namespace { -using namespace ocpp::v201; +using namespace ocpp::v2; using namespace ocpp; -using ocpp::v201::dt; +using ocpp::v2::dt; using std::nullopt; using std::chrono::minutes; using std::chrono::seconds; diff --git a/tests/lib/ocpp/v2/utils_tests.cpp b/tests/lib/ocpp/v2/utils_tests.cpp new file mode 100644 index 000000000..72b5b1615 --- /dev/null +++ b/tests/lib/ocpp/v2/utils_tests.cpp @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest + +#include +#include + +namespace ocpp { +namespace common { + +class V2UtilsTest : public ::testing::Test { +protected: + const std::string empty_input; + const std::string short_input = "hello there"; + const std::string long_input = + "hello there hello there hello there hello there hello there hello there hello there hello there " + "hello there hello there hello there hello there hello there hello there hello there hello there " + "hello there hello there hello there hello there hello there hello there hello there hello there " + "hello there hello there hello there hello there hello there hello there hello there hello there"; + const ocpp::v2::IdToken valid_central_token = {"valid", ocpp::v2::IdTokenEnum::Central}; + void SetUp() override { + } + + void TearDown() override { + } +}; + +TEST_F(V2UtilsTest, test_valid_sha256) { + ASSERT_EQ("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", ocpp::v2::utils::sha256(empty_input)); + ASSERT_EQ("12998c017066eb0d2a70b94e6ed3192985855ce390f321bbdb832022888bd251", ocpp::v2::utils::sha256(short_input)); + ASSERT_EQ("34aa8868354dc8eb0e76fbc8b5f13259094bcdf5688c6a48a2bcb89ed863d441", ocpp::v2::utils::sha256(long_input)); +} + +TEST_F(V2UtilsTest, test_valid_generate_token_hash) { + ocpp::v2::IdToken valid_iso14443_token = {"ABAD1DEA", ocpp::v2::IdTokenEnum::ISO14443}; + ocpp::v2::IdToken valid_iso15693_token = {"ABAD1DEA", ocpp::v2::IdTokenEnum::ISO15693}; + + ASSERT_EQ("63f3202a9c2e08a033a861481c6259e7a70a2b6e243f91233ebf26f33859c113", + ocpp::v2::utils::generate_token_hash(valid_central_token)); + ASSERT_EQ("1cc0ce8b95f44d43273c46a062af3d15a06e3d2170909b1fdebd634027aebef1", + ocpp::v2::utils::generate_token_hash(valid_iso14443_token)); + ASSERT_NE(ocpp::v2::utils::generate_token_hash(valid_central_token), + ocpp::v2::utils::generate_token_hash(valid_iso14443_token)); + ASSERT_NE(ocpp::v2::utils::generate_token_hash(valid_iso14443_token), + ocpp::v2::utils::generate_token_hash(valid_iso15693_token)); +} + +TEST_F(V2UtilsTest, test_is_critical_security_event) { + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::FIRMWARE_UPDATED)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::SETTINGSYSTEMTIME)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::STARTUP_OF_THE_DEVICE)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::RESET_OR_REBOOT)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::SECURITYLOGWASCLEARED)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::MEMORYEXHAUSTION)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::TAMPERDETECTIONACTIVATED)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::INVALIDFIRMWARESIGNATURE)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::INVALIDFIRMWARESIGNINGCERTIFICATE)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::INVALIDCSMSCERTIFICATE)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::INVALIDCHARGINGSTATIONCERTIFICATE)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::INVALIDTLSVERSION)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::INVALIDTLSCIPHERSUITE)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::MAINTENANCELOGINACCEPTED)); + EXPECT_TRUE(ocpp::v2::utils::is_critical(ocpp::security_events::MAINTENANCELOGINFAILED)); + + EXPECT_FALSE(ocpp::v2::utils::is_critical(ocpp::security_events::FAILEDTOAUTHENTICATEATCSMS)); + EXPECT_FALSE(ocpp::v2::utils::is_critical(ocpp::security_events::CSMSFAILEDTOAUTHENTICATE)); + EXPECT_FALSE(ocpp::v2::utils::is_critical(ocpp::security_events::RECONFIGURATIONOFSECURITYPARAMETERS)); + EXPECT_FALSE(ocpp::v2::utils::is_critical(ocpp::security_events::INVALIDMESSAGES)); + EXPECT_FALSE(ocpp::v2::utils::is_critical(ocpp::security_events::ATTEMPTEDREPLAYATTACKS)); +} + +} // namespace common +} // namespace ocpp diff --git a/tests/lib/ocpp/v201/functional_blocks/CMakeLists.txt b/tests/lib/ocpp/v201/functional_blocks/CMakeLists.txt deleted file mode 100644 index 95295ed69..000000000 --- a/tests/lib/ocpp/v201/functional_blocks/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -target_include_directories(libocpp_unit_tests PUBLIC - ../mocks - ${CMAKE_CURRENT_SOURCE_DIR}) - -target_sources(libocpp_unit_tests PRIVATE - test_data_transfer.cpp - test_reservation.cpp - test_smart_charging.cpp) - - - -set(TEST_SECURITY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../device_model_test_helper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/../stubs/timer/timer_stub.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/functional_blocks/security.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/SecurityEventNotification.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/CertificateSigned.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/DeleteCertificate.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/GetInstalledCertificateIds.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/InstallCertificate.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/SignCertificate.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/Get15118EVCertificate.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/Reset.cpp - ${LIBOCPP_TEST_INCLUDE_COMMON_SOURCES} - ${LIBOCPP_TEST_INCLUDE_V201_SOURCES} -) - -target_sources(libocpp_test_security PRIVATE - ${TEST_SECURITY_SOURCES}) - -target_include_directories(libocpp_test_security PUBLIC - ${LIBOCPP_INCLUDE_PATH} - ${LIBOCPP_3RDPARTY_PATH} - ${CMAKE_CURRENT_SOURCE_DIR}/../stubs/timer - ${CMAKE_CURRENT_SOURCE_DIR}/../mocks - ${LIBOCPP_TESTS_V201_ROOT_DIR} -) - - -set(TEST_AUTHORIZATION_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../device_model_test_helper.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/functional_blocks/authorization.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/Authorize.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/ClearCache.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/GetLocalListVersion.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/messages/SendLocalList.cpp - ${LIBOCPP_TEST_INCLUDE_COMMON_SOURCES} - ${LIBOCPP_TEST_INCLUDE_V201_SOURCES} -) - -target_sources(libocpp_test_authorization PRIVATE - ${TEST_AUTHORIZATION_SOURCES}) - -target_include_directories(libocpp_test_authorization PUBLIC - ${LIBOCPP_INCLUDE_PATH} - ${LIBOCPP_3RDPARTY_PATH} - ${CMAKE_CURRENT_SOURCE_DIR}/../mocks - ${LIBOCPP_TESTS_V201_ROOT_DIR} -) diff --git a/tests/lib/ocpp/v201/test_message_queue.cpp b/tests/lib/ocpp/v201/test_message_queue.cpp deleted file mode 100644 index 58759a65b..000000000 --- a/tests/lib/ocpp/v201/test_message_queue.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest - -#include - -#include -#include - -namespace ocpp { - -namespace v201 { - -class ControlMessageV201Test : public ::testing::Test { - -protected: -}; - -TEST_F(ControlMessageV201Test, test_is_transactional) { - - EXPECT_TRUE(is_transaction_message( - (ControlMessage{Call{v201::TransactionEventRequest{}}} - .messageType))); - - EXPECT_TRUE(!is_transaction_message( - ControlMessage{Call{v201::AuthorizeRequest{}}}.messageType)); -} - -TEST_F(ControlMessageV201Test, test_is_transactional_update) { - - v201::TransactionEventRequest transaction_event_request{}; - transaction_event_request.eventType = v201::TransactionEventEnum::Updated; - - EXPECT_TRUE((ControlMessage{Call{transaction_event_request}} - .is_transaction_update_message())); - - transaction_event_request.eventType = v201::TransactionEventEnum::Started; - EXPECT_TRUE(!(ControlMessage{Call{transaction_event_request}} - .is_transaction_update_message())); - - transaction_event_request.eventType = v201::TransactionEventEnum::Ended; - EXPECT_TRUE(!(ControlMessage{Call{transaction_event_request}} - .is_transaction_update_message())); - - EXPECT_TRUE(!(ControlMessage{Call{v201::AuthorizeRequest{}}} - .is_transaction_update_message())); -} - -} // namespace v201 -} // namespace ocpp diff --git a/tests/lib/ocpp/v201/utils_tests.cpp b/tests/lib/ocpp/v201/utils_tests.cpp deleted file mode 100644 index 99b5e7b43..000000000 --- a/tests/lib/ocpp/v201/utils_tests.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest - -#include -#include - -namespace ocpp { -namespace common { - -class V201UtilsTest : public ::testing::Test { -protected: - const std::string empty_input; - const std::string short_input = "hello there"; - const std::string long_input = - "hello there hello there hello there hello there hello there hello there hello there hello there " - "hello there hello there hello there hello there hello there hello there hello there hello there " - "hello there hello there hello there hello there hello there hello there hello there hello there " - "hello there hello there hello there hello there hello there hello there hello there hello there"; - const ocpp::v201::IdToken valid_central_token = {"valid", ocpp::v201::IdTokenEnum::Central}; - void SetUp() override { - } - - void TearDown() override { - } -}; - -TEST_F(V201UtilsTest, test_valid_sha256) { - ASSERT_EQ("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - ocpp::v201::utils::sha256(empty_input)); - ASSERT_EQ("12998c017066eb0d2a70b94e6ed3192985855ce390f321bbdb832022888bd251", - ocpp::v201::utils::sha256(short_input)); - ASSERT_EQ("34aa8868354dc8eb0e76fbc8b5f13259094bcdf5688c6a48a2bcb89ed863d441", - ocpp::v201::utils::sha256(long_input)); -} - -TEST_F(V201UtilsTest, test_valid_generate_token_hash) { - ocpp::v201::IdToken valid_iso14443_token = {"ABAD1DEA", ocpp::v201::IdTokenEnum::ISO14443}; - ocpp::v201::IdToken valid_iso15693_token = {"ABAD1DEA", ocpp::v201::IdTokenEnum::ISO15693}; - - ASSERT_EQ("63f3202a9c2e08a033a861481c6259e7a70a2b6e243f91233ebf26f33859c113", - ocpp::v201::utils::generate_token_hash(valid_central_token)); - ASSERT_EQ("1cc0ce8b95f44d43273c46a062af3d15a06e3d2170909b1fdebd634027aebef1", - ocpp::v201::utils::generate_token_hash(valid_iso14443_token)); - ASSERT_NE(ocpp::v201::utils::generate_token_hash(valid_central_token), - ocpp::v201::utils::generate_token_hash(valid_iso14443_token)); - ASSERT_NE(ocpp::v201::utils::generate_token_hash(valid_iso14443_token), - ocpp::v201::utils::generate_token_hash(valid_iso15693_token)); -} - -TEST_F(V201UtilsTest, test_is_critical_security_event) { - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::FIRMWARE_UPDATED)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::SETTINGSYSTEMTIME)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::STARTUP_OF_THE_DEVICE)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::RESET_OR_REBOOT)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::SECURITYLOGWASCLEARED)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::MEMORYEXHAUSTION)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::TAMPERDETECTIONACTIVATED)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::INVALIDFIRMWARESIGNATURE)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::INVALIDFIRMWARESIGNINGCERTIFICATE)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::INVALIDCSMSCERTIFICATE)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::INVALIDCHARGINGSTATIONCERTIFICATE)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::INVALIDTLSVERSION)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::INVALIDTLSCIPHERSUITE)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::MAINTENANCELOGINACCEPTED)); - EXPECT_TRUE(ocpp::v201::utils::is_critical(ocpp::security_events::MAINTENANCELOGINFAILED)); - - EXPECT_FALSE(ocpp::v201::utils::is_critical(ocpp::security_events::FAILEDTOAUTHENTICATEATCSMS)); - EXPECT_FALSE(ocpp::v201::utils::is_critical(ocpp::security_events::CSMSFAILEDTOAUTHENTICATE)); - EXPECT_FALSE(ocpp::v201::utils::is_critical(ocpp::security_events::RECONFIGURATIONOFSECURITYPARAMETERS)); - EXPECT_FALSE(ocpp::v201::utils::is_critical(ocpp::security_events::INVALIDMESSAGES)); - EXPECT_FALSE(ocpp::v201::utils::is_critical(ocpp::security_events::ATTEMPTEDREPLAYATTACKS)); -} - -} // namespace common -} // namespace ocpp diff --git a/tests/libocpp-unittests.cmake b/tests/libocpp-unittests.cmake index e986ffbf0..b6cecce27 100644 --- a/tests/libocpp-unittests.cmake +++ b/tests/libocpp-unittests.cmake @@ -1,23 +1,23 @@ set(CONFIG_DIR_V16 "${CMAKE_CURRENT_BINARY_DIR}/resources/v16/") set(MIGRATION_FILES_LOCATION_V16 "${CMAKE_CURRENT_BINARY_DIR}/resources/v16/migration_files") -set(MIGRATION_FILES_LOCATION_V201 "${CMAKE_CURRENT_BINARY_DIR}/resources/v201/migration_files") +set(MIGRATION_FILES_LOCATION_V2 "${CMAKE_CURRENT_BINARY_DIR}/resources/v2/migration_files") set(CONFIG_FILE_LOCATION_V16 ${CMAKE_CURRENT_SOURCE_DIR}/config/v16/resources/config.json) set(USER_CONFIG_FILE_LOCATION_V16 ${CMAKE_CURRENT_SOURCE_DIR}/config/v16/resources/user_config.json) set(CONFIG_FILE_RESOURCES_LOCATION_V16 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v16/config.json") set(USER_CONFIG_FILE_RESOURCES_LOCATION_V16 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v16/user_config.json") -set(MIGRATION_FILES_DEVICE_MODEL_LOCATION_V201 "${CMAKE_CURRENT_BINARY_DIR}/resources/v201/device_model_migration_files") -set(DEVICE_MODEL_DB_LOCATION_V201 "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/everest/modules/OCPP201/device_model_storage.db") -set(DEVICE_MODEL_RESOURCES_LOCATION_V201 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v201") -set(DEVICE_MODEL_RESOURCES_CHANGED_LOCATION_V201 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v201/changed") -set(DEVICE_MODEL_RESOURCES_WRONG_LOCATION_V201 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v201/wrong") -set(DEVICE_MODEL_CURRENT_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/config/v201/resources) -set(DEVICE_MODEL_CURRENT_CHANGED_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/config/v201/resources_changed) -set(DEVICE_MODEL_CURRENT_WRONG_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/config/v201/resources_wrong) -set(DEVICE_MODEL_EXAMPLE_CONFIG_LOCATION_V201 "${CMAKE_CURRENT_BINARY_DIR}/resources/example_config/v201/component_config") -set(DEVICE_MODEL_CURRENT_EXAMPLE_CONFIG_LOCATION_V201 "${PROJECT_SOURCE_DIR}/config/v201/component_config") +set(MIGRATION_FILES_DEVICE_MODEL_LOCATION_V2 "${CMAKE_CURRENT_BINARY_DIR}/resources/v2/device_model_migration_files") +set(DEVICE_MODEL_DB_LOCATION_V2 "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/everest/modules/OCPP201/device_model_storage.db") +set(DEVICE_MODEL_RESOURCES_LOCATION_V2 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v2") +set(DEVICE_MODEL_RESOURCES_CHANGED_LOCATION_V2 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v2/changed") +set(DEVICE_MODEL_RESOURCES_WRONG_LOCATION_V2 "${CMAKE_CURRENT_BINARY_DIR}/resources/config/v2/wrong") +set(DEVICE_MODEL_CURRENT_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/config/v2/resources) +set(DEVICE_MODEL_CURRENT_CHANGED_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/config/v2/resources_changed) +set(DEVICE_MODEL_CURRENT_WRONG_RESOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/config/v2/resources_wrong) +set(DEVICE_MODEL_EXAMPLE_CONFIG_LOCATION_V2 "${CMAKE_CURRENT_BINARY_DIR}/resources/example_config/v2/component_config") +set(DEVICE_MODEL_CURRENT_EXAMPLE_CONFIG_LOCATION_V2 "${PROJECT_SOURCE_DIR}/config/v2/component_config") set(TEST_PROFILES_LOCATION_V16 "${CMAKE_CURRENT_BINARY_DIR}/resources/profiles/v16") -set(TEST_PROFILES_LOCATION_V201 "${CMAKE_CURRENT_BINARY_DIR}/resources/profiles/v201") +set(TEST_PROFILES_LOCATION_V2 "${CMAKE_CURRENT_BINARY_DIR}/resources/profiles/v2") # Add variables that can be used for all tests if needed. set(GTEST_LIBRARIES GTest::gmock_main GTest::gtest_main) @@ -27,12 +27,12 @@ set(TEST_COMPILE_DEFINITIONS USER_CONFIG_FILE_LOCATION_V16="${USER_CONFIG_FILE_RESOURCES_LOCATION_V16}" CONFIG_DIR_V16="${CONFIG_DIR_V16}" MIGRATION_FILES_LOCATION_V16="${MIGRATION_FILES_LOCATION_V16}" - MIGRATION_FILES_LOCATION_V201="${MIGRATION_FILES_LOCATION_V201}" + MIGRATION_FILES_LOCATION_V2="${MIGRATION_FILES_LOCATION_V2}" MIGRATION_FILE_VERSION_V16=${MIGRATION_FILE_VERSION_V16} - MIGRATION_FILE_VERSION_V201=${MIGRATION_FILE_VERSION_V201} - DEVICE_MODEL_DB_LOCATION_V201="${DEVICE_MODEL_DB_LOCATION_V201}" + MIGRATION_FILE_VERSION_V2=${MIGRATION_FILE_VERSION_V2} + DEVICE_MODEL_DB_LOCATION_V2="${DEVICE_MODEL_DB_LOCATION_V2}" TEST_PROFILES_LOCATION_V16="${TEST_PROFILES_LOCATION_V16}" - TEST_PROFILES_LOCATION_V201="${TEST_PROFILES_LOCATION_V201}") + TEST_PROFILES_LOCATION_V2="${TEST_PROFILES_LOCATION_V2}") set(TEST_COMPILE_FEATURES cxx_std_17) set(LIBOCPP_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/include) set(LIBOCPP_LIB_PATH ${PROJECT_SOURCE_DIR}/lib) @@ -65,16 +65,16 @@ set(LIBOCPP_TEST_INCLUDE_COMMON_SOURCES ${LIBOCPP_LIB_PATH}/ocpp/common/types.cp # If the test is not linked against the ocpp library, those default sources for ocpp v2.0.1 can be linked against, they # will often be needed to link against. -set(LIBOCPP_TEST_INCLUDE_V201_SOURCES ${LIBOCPP_LIB_PATH}/ocpp/v16/ocpp_enums.cpp # This is currently still needed but might be removed in the future. - ${LIBOCPP_LIB_PATH}/ocpp/v201/ctrlr_component_variables.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/types.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/ocpp_types.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/enums.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/ocpp_enums.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/device_model.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/init_device_model_db.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/device_model_storage_sqlite.cpp - ${LIBOCPP_LIB_PATH}/ocpp/v201/utils.cpp +set(LIBOCPP_TEST_INCLUDE_V2_SOURCES ${LIBOCPP_LIB_PATH}/ocpp/v16/ocpp_enums.cpp # This is currently still needed but might be removed in the future. + ${LIBOCPP_LIB_PATH}/ocpp/v2/ctrlr_component_variables.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/types.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/ocpp_types.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/enums.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/ocpp_enums.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/device_model.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/init_device_model_db.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/device_model_storage_sqlite.cpp + ${LIBOCPP_LIB_PATH}/ocpp/v2/utils.cpp ) function(add_libocpp_unittest) @@ -95,8 +95,8 @@ function(add_libocpp_unittest) PRIVATE ${TEST_COMPILE_DEFINITIONS} MIGRATION_FILE_VERSION_V16=${MIGRATION_FILE_VERSION_V16} - MIGRATION_FILE_VERSION_V201=${MIGRATION_FILE_VERSION_V201} - MIGRATION_DEVICE_MODEL_FILE_VERSION_V201=${MIGRATION_DEVICE_MODEL_FILE_VERSION_V201}) + MIGRATION_FILE_VERSION_V2=${MIGRATION_FILE_VERSION_V2} + MIGRATION_DEVICE_MODEL_FILE_VERSION_V2=${MIGRATION_DEVICE_MODEL_FILE_VERSION_V2}) target_compile_options(${arg_NAME} PRIVATE ${TEST_COMPILE_OPTIONS}) target_compile_features(${arg_NAME} PUBLIC ${TEST_COMPILE_FEATURES}) target_include_directories(${arg_NAME} PRIVATE ${TEST_INCLUDE_DIRECTORIES})