diff --git a/examples/common/DefaultLocalControllerEventsHandler.cpp b/examples/common/DefaultLocalControllerEventsHandler.cpp index 433e3f57..c88236bb 100644 --- a/examples/common/DefaultLocalControllerEventsHandler.cpp +++ b/examples/common/DefaultLocalControllerEventsHandler.cpp @@ -61,7 +61,7 @@ void DefaultLocalControllerEventsHandler::chargePointConnected(std::shared_ptridentifier() << "] - Heartbeat received" << std::endl; // Forward message - std::string error; - ret = chargepoint->centralSystemProxy()->call(request, response, error, error_message); + ret = chargepoint->centralSystemProxy()->call(request, response, error_code, error_message); if (!ret) { std::cout << "[" << chargepoint->identifier() << "] - Unable to forward heartbeat" << std::endl; - error_code = error.c_str(); } } return ret; diff --git a/src/centralsystem/chargepoint/ChargePointHandler.cpp b/src/centralsystem/chargepoint/ChargePointHandler.cpp index 1c4212e4..10e080e0 100644 --- a/src/centralsystem/chargepoint/ChargePointHandler.cpp +++ b/src/centralsystem/chargepoint/ChargePointHandler.cpp @@ -96,12 +96,12 @@ ChargePointHandler::~ChargePointHandler() { } /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::AuthorizeReq& request, ocpp::messages::AuthorizeConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -127,12 +127,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::AuthorizeReq& reque /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::BootNotificationReq& request, ocpp::messages::BootNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -176,12 +176,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::BootNotificationReq /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -214,12 +214,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::DataTransferReq& re /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::DiagnosticsStatusNotificationReq& request, ocpp::messages::DiagnosticsStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -247,12 +247,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::DiagnosticsStatusNo /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::FirmwareStatusNotificationReq& request, ocpp::messages::FirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -280,12 +280,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::FirmwareStatusNotif /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::HeartbeatReq& request, ocpp::messages::HeartbeatConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -304,12 +304,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::HeartbeatReq& reque /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::MeterValuesReq& request, ocpp::messages::MeterValuesConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -338,12 +338,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::MeterValuesReq& req /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::StartTransactionReq& request, ocpp::messages::StartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -375,12 +375,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::StartTransactionReq /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::StatusNotificationReq& request, ocpp::messages::StatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -415,12 +415,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::StatusNotificationR /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::StopTransactionReq& request, ocpp::messages::StopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -457,12 +457,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::StopTransactionReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::LogStatusNotificationReq& request, ocpp::messages::LogStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -491,12 +491,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::LogStatusNotificati /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::SecurityEventNotificationReq& request, ocpp::messages::SecurityEventNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -525,12 +525,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::SecurityEventNotifi /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::SignCertificateReq& request, ocpp::messages::SignCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -568,12 +568,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::SignCertificateReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::SignedFirmwareStatusNotificationReq& request, ocpp::messages::SignedFirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; diff --git a/src/centralsystem/chargepoint/ChargePointHandler.h b/src/centralsystem/chargepoint/ChargePointHandler.h index 5af1146b..f93be5d1 100644 --- a/src/centralsystem/chargepoint/ChargePointHandler.h +++ b/src/centralsystem/chargepoint/ChargePointHandler.h @@ -96,144 +96,144 @@ class ChargePointHandler /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::AuthorizeReq& request, ocpp::messages::AuthorizeConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::BootNotificationReq& request, ocpp::messages::BootNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DiagnosticsStatusNotificationReq& request, ocpp::messages::DiagnosticsStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::FirmwareStatusNotificationReq& request, ocpp::messages::FirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::HeartbeatReq& request, ocpp::messages::HeartbeatConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::MeterValuesReq& request, ocpp::messages::MeterValuesConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::StartTransactionReq& request, ocpp::messages::StartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::StatusNotificationReq& request, ocpp::messages::StatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::StopTransactionReq& request, ocpp::messages::StopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // Security extensions /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::LogStatusNotificationReq& request, ocpp::messages::LogStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SecurityEventNotificationReq& request, ocpp::messages::SecurityEventNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SignCertificateReq& request, ocpp::messages::SignCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SignedFirmwareStatusNotificationReq& request, ocpp::messages::SignedFirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/centralsystem/chargepoint/ChargePointProxy.cpp b/src/centralsystem/chargepoint/ChargePointProxy.cpp index c4be7ffc..d6e37101 100644 --- a/src/centralsystem/chargepoint/ChargePointProxy.cpp +++ b/src/centralsystem/chargepoint/ChargePointProxy.cpp @@ -1059,12 +1059,12 @@ void ChargePointProxy::rpcError() /** @copydoc bool IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool ChargePointProxy::rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return m_msg_dispatcher.dispatchMessage(action, payload, response, error_code, error_message); diff --git a/src/centralsystem/chargepoint/ChargePointProxy.h b/src/centralsystem/chargepoint/ChargePointProxy.h index fc6c2869..103797f2 100644 --- a/src/centralsystem/chargepoint/ChargePointProxy.h +++ b/src/centralsystem/chargepoint/ChargePointProxy.h @@ -266,12 +266,12 @@ class ChargePointProxy : public ICentralSystem::IChargePoint, public ocpp::rpc:: /** @copydoc bool IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // IRpc::ISpy interface diff --git a/src/chargepoint/ChargePoint.cpp b/src/chargepoint/ChargePoint.cpp index adefece9..15e92e00 100644 --- a/src/chargepoint/ChargePoint.cpp +++ b/src/chargepoint/ChargePoint.cpp @@ -825,12 +825,12 @@ void ChargePoint::rpcError() /** @copydoc void IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool ChargePoint::rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return m_msg_dispatcher->dispatchMessage(action, payload, response, error_code, error_message); diff --git a/src/chargepoint/ChargePoint.h b/src/chargepoint/ChargePoint.h index 68085c6b..80ae506b 100644 --- a/src/chargepoint/ChargePoint.h +++ b/src/chargepoint/ChargePoint.h @@ -194,12 +194,12 @@ class ChargePoint : public IChargePoint, /** @copydoc void IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /// IRpc::ISpy interface diff --git a/src/chargepoint/authent/AuthentCache.cpp b/src/chargepoint/authent/AuthentCache.cpp index 2c5c747b..f7d301f9 100644 --- a/src/chargepoint/authent/AuthentCache.cpp +++ b/src/chargepoint/authent/AuthentCache.cpp @@ -57,12 +57,12 @@ AuthentCache::~AuthentCache() { } /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool AuthentCache::handleMessage(const ocpp::messages::ClearCacheReq& request, ocpp::messages::ClearCacheConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)request; diff --git a/src/chargepoint/authent/AuthentCache.h b/src/chargepoint/authent/AuthentCache.h index eff3ff2b..15a4cf57 100644 --- a/src/chargepoint/authent/AuthentCache.h +++ b/src/chargepoint/authent/AuthentCache.h @@ -61,12 +61,12 @@ class AuthentCache : public ocpp::messages::GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ClearCacheReq& request, ocpp::messages::ClearCacheConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // AuthentCache interface diff --git a/src/chargepoint/authent/AuthentLocalList.cpp b/src/chargepoint/authent/AuthentLocalList.cpp index 636de8c3..7a5d91db 100644 --- a/src/chargepoint/authent/AuthentLocalList.cpp +++ b/src/chargepoint/authent/AuthentLocalList.cpp @@ -76,12 +76,12 @@ AuthentLocalList::~AuthentLocalList() { } /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool AuthentLocalList::handleMessage(const ocpp::messages::GetLocalListVersionReq& request, ocpp::messages::GetLocalListVersionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)request; @@ -105,12 +105,12 @@ bool AuthentLocalList::handleMessage(const ocpp::messages::GetLocalListVersionRe /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool AuthentLocalList::handleMessage(const ocpp::messages::SendLocalListReq& request, ocpp::messages::SendLocalListConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)request; diff --git a/src/chargepoint/authent/AuthentLocalList.h b/src/chargepoint/authent/AuthentLocalList.h index f2366890..08f3365d 100644 --- a/src/chargepoint/authent/AuthentLocalList.h +++ b/src/chargepoint/authent/AuthentLocalList.h @@ -63,22 +63,22 @@ class AuthentLocalList /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetLocalListVersionReq& request, ocpp::messages::GetLocalListVersionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SendLocalListReq& request, ocpp::messages::SendLocalListConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // AuthentLocalList interface diff --git a/src/chargepoint/config/ConfigManager.cpp b/src/chargepoint/config/ConfigManager.cpp index a4e7b979..4baeb66f 100644 --- a/src/chargepoint/config/ConfigManager.cpp +++ b/src/chargepoint/config/ConfigManager.cpp @@ -60,12 +60,12 @@ void ConfigManager::registerConfigChangedListener(const std::string& key, IConfi /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ConfigManager::handleMessage(const ocpp::messages::GetConfigurationReq& request, ocpp::messages::GetConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -78,12 +78,12 @@ bool ConfigManager::handleMessage(const ocpp::messages::GetConfigurationReq& req /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ConfigManager::handleMessage(const ocpp::messages::ChangeConfigurationReq& request, ocpp::messages::ChangeConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; diff --git a/src/chargepoint/config/ConfigManager.h b/src/chargepoint/config/ConfigManager.h index 0a114e8e..6cc96ac4 100644 --- a/src/chargepoint/config/ConfigManager.h +++ b/src/chargepoint/config/ConfigManager.h @@ -66,22 +66,22 @@ class ConfigManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetConfigurationReq& request, ocpp::messages::GetConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ChangeConfigurationReq& request, ocpp::messages::ChangeConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/datatransfer/DataTransferManager.cpp b/src/chargepoint/datatransfer/DataTransferManager.cpp index ce2aaaa0..d80d0403 100644 --- a/src/chargepoint/datatransfer/DataTransferManager.cpp +++ b/src/chargepoint/datatransfer/DataTransferManager.cpp @@ -79,12 +79,12 @@ bool DataTransferManager::dataTransfer(const std::string& vendor_i /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool DataTransferManager::handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; diff --git a/src/chargepoint/datatransfer/DataTransferManager.h b/src/chargepoint/datatransfer/DataTransferManager.h index 79056e4f..58cbdb61 100644 --- a/src/chargepoint/datatransfer/DataTransferManager.h +++ b/src/chargepoint/datatransfer/DataTransferManager.h @@ -71,12 +71,12 @@ class DataTransferManager : public ocpp::messages::GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/maintenance/MaintenanceManager.cpp b/src/chargepoint/maintenance/MaintenanceManager.cpp index ba5a6788..a11163b5 100644 --- a/src/chargepoint/maintenance/MaintenanceManager.cpp +++ b/src/chargepoint/maintenance/MaintenanceManager.cpp @@ -247,12 +247,12 @@ bool MaintenanceManager::onTriggerMessage(ocpp::types::MessageTriggerEnumType /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool MaintenanceManager::handleMessage(const ocpp::messages::ResetReq& request, ocpp::messages::ResetConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -277,12 +277,12 @@ bool MaintenanceManager::handleMessage(const ocpp::messages::ResetReq& request, /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool MaintenanceManager::handleMessage(const ocpp::messages::UnlockConnectorReq& request, ocpp::messages::UnlockConnectorConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -309,12 +309,12 @@ bool MaintenanceManager::handleMessage(const ocpp::messages::UnlockConnectorReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool MaintenanceManager::handleMessage(const ocpp::messages::GetDiagnosticsReq& request, ocpp::messages::GetDiagnosticsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -355,12 +355,12 @@ bool MaintenanceManager::handleMessage(const ocpp::messages::GetDiagnosticsReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool MaintenanceManager::handleMessage(const ocpp::messages::UpdateFirmwareReq& request, ocpp::messages::UpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -393,12 +393,12 @@ bool MaintenanceManager::handleMessage(const ocpp::messages::UpdateFirmwareReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool MaintenanceManager::handleMessage(const ocpp::messages::GetLogReq& request, ocpp::messages::GetLogConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -463,12 +463,12 @@ bool MaintenanceManager::handleMessage(const ocpp::messages::GetLogReq& request, /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool MaintenanceManager::handleMessage(const ocpp::messages::SignedUpdateFirmwareReq& request, ocpp::messages::SignedUpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; diff --git a/src/chargepoint/maintenance/MaintenanceManager.h b/src/chargepoint/maintenance/MaintenanceManager.h index e136b3aa..0e8ceadd 100644 --- a/src/chargepoint/maintenance/MaintenanceManager.h +++ b/src/chargepoint/maintenance/MaintenanceManager.h @@ -117,64 +117,64 @@ class MaintenanceManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ResetReq& request, ocpp::messages::ResetConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::UnlockConnectorReq& request, ocpp::messages::UnlockConnectorConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetDiagnosticsReq& request, ocpp::messages::GetDiagnosticsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::UpdateFirmwareReq& request, ocpp::messages::UpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // Security extensions /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetLogReq& request, ocpp::messages::GetLogConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SignedUpdateFirmwareReq& request, ocpp::messages::SignedUpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/metervalues/MeterValuesManager.cpp b/src/chargepoint/metervalues/MeterValuesManager.cpp index 57472a41..f0c663d3 100644 --- a/src/chargepoint/metervalues/MeterValuesManager.cpp +++ b/src/chargepoint/metervalues/MeterValuesManager.cpp @@ -576,7 +576,7 @@ std::string MeterValuesManager::serialize(const ocpp::types::MeterValue& meter_v /** @brief Deserialize a meter value from a string */ bool MeterValuesManager::deserialize(const std::string& meter_value_str, ocpp::types::MeterValue& meter_value) { - const char* error_code = nullptr; + std::string error_code; std::string error_message; rapidjson::Document meter_value_json; meter_value_json.Parse(meter_value_str.c_str()); diff --git a/src/chargepoint/requestfifo/RequestFifoManager.cpp b/src/chargepoint/requestfifo/RequestFifoManager.cpp index 593d5fcd..7d5ddbb1 100644 --- a/src/chargepoint/requestfifo/RequestFifoManager.cpp +++ b/src/chargepoint/requestfifo/RequestFifoManager.cpp @@ -129,7 +129,7 @@ void RequestFifoManager::processFifoRequest() StartTransactionReq request; StartTransactionReqConverter req_converter; std::string error_message; - const char* error_code = nullptr; + std::string error_code; req_converter.fromJson(payload, request, error_code, error_message); // Update id tag information diff --git a/src/chargepoint/reservation/ReservationManager.cpp b/src/chargepoint/reservation/ReservationManager.cpp index 0dd06372..31138780 100644 --- a/src/chargepoint/reservation/ReservationManager.cpp +++ b/src/chargepoint/reservation/ReservationManager.cpp @@ -162,12 +162,12 @@ ocpp::types::AuthorizationStatus ReservationManager::isTransactionAllowed(unsign /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ReservationManager::handleMessage(const ocpp::messages::ReserveNowReq& request, ocpp::messages::ReserveNowConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -270,12 +270,12 @@ bool ReservationManager::handleMessage(const ocpp::messages::ReserveNowReq& requ /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ReservationManager::handleMessage(const ocpp::messages::CancelReservationReq& request, ocpp::messages::CancelReservationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; diff --git a/src/chargepoint/reservation/ReservationManager.h b/src/chargepoint/reservation/ReservationManager.h index 26f6cf01..2acba000 100644 --- a/src/chargepoint/reservation/ReservationManager.h +++ b/src/chargepoint/reservation/ReservationManager.h @@ -89,22 +89,22 @@ class ReservationManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ReserveNowReq& request, ocpp::messages::ReserveNowConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::CancelReservationReq& request, ocpp::messages::CancelReservationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/security/SecurityManager.cpp b/src/chargepoint/security/SecurityManager.cpp index a44ef1ce..5f3cf67c 100644 --- a/src/chargepoint/security/SecurityManager.cpp +++ b/src/chargepoint/security/SecurityManager.cpp @@ -411,12 +411,12 @@ bool SecurityManager::onTriggerMessage(ocpp::types::MessageTriggerEnumType messa /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool SecurityManager::handleMessage(const ocpp::messages::CertificateSignedReq& request, ocpp::messages::CertificateSignedConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; @@ -495,12 +495,12 @@ bool SecurityManager::handleMessage(const ocpp::messages::CertificateSignedReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool SecurityManager::handleMessage(const ocpp::messages::DeleteCertificateReq& request, ocpp::messages::DeleteCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; @@ -535,12 +535,12 @@ bool SecurityManager::handleMessage(const ocpp::messages::DeleteCertificateReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool SecurityManager::handleMessage(const ocpp::messages::GetInstalledCertificateIdsReq& request, ocpp::messages::GetInstalledCertificateIdsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; @@ -595,12 +595,12 @@ bool SecurityManager::handleMessage(const ocpp::messages::GetInstalledCertificat /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool SecurityManager::handleMessage(const ocpp::messages::InstallCertificateReq& request, ocpp::messages::InstallCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; diff --git a/src/chargepoint/security/SecurityManager.h b/src/chargepoint/security/SecurityManager.h index 235636cd..31163d2b 100644 --- a/src/chargepoint/security/SecurityManager.h +++ b/src/chargepoint/security/SecurityManager.h @@ -140,42 +140,42 @@ class SecurityManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::CertificateSignedReq& request, ocpp::messages::CertificateSignedConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DeleteCertificateReq& request, ocpp::messages::DeleteCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetInstalledCertificateIdsReq& request, ocpp::messages::GetInstalledCertificateIdsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::InstallCertificateReq& request, ocpp::messages::InstallCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/smartcharging/ProfileDatabase.cpp b/src/chargepoint/smartcharging/ProfileDatabase.cpp index 4856ada3..255d17d2 100644 --- a/src/chargepoint/smartcharging/ProfileDatabase.cpp +++ b/src/chargepoint/smartcharging/ProfileDatabase.cpp @@ -353,7 +353,7 @@ std::string ProfileDatabase::serialize(const ocpp::types::ChargingProfile& profi /** @brief Deserialize a profile from a string */ bool ProfileDatabase::deserialize(const std::string& profile_str, ocpp::types::ChargingProfile& profile) { - const char* error_code = nullptr; + std::string error_code; std::string error_message; rapidjson::Document profile_json; profile_json.Parse(profile_str.c_str()); diff --git a/src/chargepoint/smartcharging/SmartChargingManager.cpp b/src/chargepoint/smartcharging/SmartChargingManager.cpp index 40a96849..f6799161 100644 --- a/src/chargepoint/smartcharging/SmartChargingManager.cpp +++ b/src/chargepoint/smartcharging/SmartChargingManager.cpp @@ -175,12 +175,12 @@ void SmartChargingManager::clearTxProfiles(unsigned int connector_id) /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool SmartChargingManager::handleMessage(const ocpp::messages::ClearChargingProfileReq& request, ocpp::messages::ClearChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -213,12 +213,12 @@ bool SmartChargingManager::handleMessage(const ocpp::messages::ClearChargingProf /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool SmartChargingManager::handleMessage(const ocpp::messages::SetChargingProfileReq& request, ocpp::messages::SetChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -343,12 +343,12 @@ bool SmartChargingManager::handleMessage(const ocpp::messages::SetChargingProfil /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool SmartChargingManager::handleMessage(const ocpp::messages::GetCompositeScheduleReq& request, ocpp::messages::GetCompositeScheduleConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)request; diff --git a/src/chargepoint/smartcharging/SmartChargingManager.h b/src/chargepoint/smartcharging/SmartChargingManager.h index d2ad4d1f..b06dd8b7 100644 --- a/src/chargepoint/smartcharging/SmartChargingManager.h +++ b/src/chargepoint/smartcharging/SmartChargingManager.h @@ -101,32 +101,32 @@ class SmartChargingManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ClearChargingProfileReq& request, ocpp::messages::ClearChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SetChargingProfileReq& request, ocpp::messages::SetChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetCompositeScheduleReq& request, ocpp::messages::GetCompositeScheduleConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/status/StatusManager.cpp b/src/chargepoint/status/StatusManager.cpp index cc8a9fd2..da49cffa 100644 --- a/src/chargepoint/status/StatusManager.cpp +++ b/src/chargepoint/status/StatusManager.cpp @@ -347,12 +347,12 @@ bool StatusManager::onTriggerMessage(ocpp::types::MessageTriggerEnumType message /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool StatusManager::handleMessage(const ocpp::messages::ChangeAvailabilityReq& request, ocpp::messages::ChangeAvailabilityConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; diff --git a/src/chargepoint/status/StatusManager.h b/src/chargepoint/status/StatusManager.h index 966fb0e1..1cbc9727 100644 --- a/src/chargepoint/status/StatusManager.h +++ b/src/chargepoint/status/StatusManager.h @@ -114,12 +114,12 @@ class StatusManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ChangeAvailabilityReq& request, ocpp::messages::ChangeAvailabilityConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/transaction/TransactionManager.cpp b/src/chargepoint/transaction/TransactionManager.cpp index 08c88445..d7acce6d 100644 --- a/src/chargepoint/transaction/TransactionManager.cpp +++ b/src/chargepoint/transaction/TransactionManager.cpp @@ -260,12 +260,12 @@ bool TransactionManager::stopTransaction(unsigned int connector_id, const std::s /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool TransactionManager::handleMessage(const ocpp::messages::RemoteStartTransactionReq& request, ocpp::messages::RemoteStartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -314,12 +314,12 @@ bool TransactionManager::handleMessage(const ocpp::messages::RemoteStartTransact /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool TransactionManager::handleMessage(const ocpp::messages::RemoteStopTransactionReq& request, ocpp::messages::RemoteStopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; diff --git a/src/chargepoint/transaction/TransactionManager.h b/src/chargepoint/transaction/TransactionManager.h index 92e969e6..767c06de 100644 --- a/src/chargepoint/transaction/TransactionManager.h +++ b/src/chargepoint/transaction/TransactionManager.h @@ -93,22 +93,22 @@ class TransactionManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::RemoteStartTransactionReq& request, ocpp::messages::RemoteStartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::RemoteStopTransactionReq& request, ocpp::messages::RemoteStopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/chargepoint/trigger/TriggerMessageManager.cpp b/src/chargepoint/trigger/TriggerMessageManager.cpp index 14272403..3f6c9bcd 100644 --- a/src/chargepoint/trigger/TriggerMessageManager.cpp +++ b/src/chargepoint/trigger/TriggerMessageManager.cpp @@ -61,12 +61,12 @@ void TriggerMessageManager::registerHandler(ocpp::types::MessageTriggerEnumType /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool TriggerMessageManager::handleMessage(const ocpp::messages::TriggerMessageReq& request, ocpp::messages::TriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; @@ -112,12 +112,12 @@ bool TriggerMessageManager::handleMessage(const ocpp::messages::TriggerMessageRe /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool TriggerMessageManager::handleMessage(const ocpp::messages::ExtendedTriggerMessageReq& request, ocpp::messages::ExtendedTriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; diff --git a/src/chargepoint/trigger/TriggerMessageManager.h b/src/chargepoint/trigger/TriggerMessageManager.h index f881f2c8..44fb27e0 100644 --- a/src/chargepoint/trigger/TriggerMessageManager.h +++ b/src/chargepoint/trigger/TriggerMessageManager.h @@ -67,24 +67,24 @@ class TriggerMessageManager /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::TriggerMessageReq& request, ocpp::messages::TriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // Security extensions /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ExtendedTriggerMessageReq& request, ocpp::messages::ExtendedTriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/localcontroller/UserMessageHandler.h b/src/localcontroller/UserMessageHandler.h index 92411855..8357237e 100644 --- a/src/localcontroller/UserMessageHandler.h +++ b/src/localcontroller/UserMessageHandler.h @@ -34,7 +34,7 @@ class UserMessageHandler : public ocpp::messages::GenericMessageHandler HandlerFunc; + typedef std::function HandlerFunc; /** @brief Constructor */ UserMessageHandler(const std::string& action, @@ -51,11 +51,11 @@ class UserMessageHandler : public ocpp::messages::GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::CancelReservationReq& request, ocpp::messages::CancelReservationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(CANCEL_RESERVATION_ACTION, request, response, error_code, error_message); @@ -137,12 +137,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::CancelReservation /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::ChangeAvailabilityReq& request, ocpp::messages::ChangeAvailabilityConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(CHANGE_AVAILABILITY_ACTION, request, response, error_code, error_message); @@ -150,12 +150,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::ChangeAvailabilit /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::ChangeConfigurationReq& request, ocpp::messages::ChangeConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(CHANGE_CONFIGURATION_ACTION, request, response, error_code, error_message); @@ -163,12 +163,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::ChangeConfigurati /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::ClearCacheReq& request, ocpp::messages::ClearCacheConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(CLEAR_CACHE_ACTION, request, response, error_code, error_message); @@ -176,12 +176,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::ClearCacheReq& re /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::ClearChargingProfileReq& request, ocpp::messages::ClearChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(CLEAR_CHARGING_PROFILE_ACTION, request, response, error_code, error_message); @@ -189,12 +189,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::ClearChargingProf /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(DATA_TRANSFER_ACTION, request, response, error_code, error_message); @@ -202,12 +202,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::DataTransferReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetCompositeScheduleReq& request, ocpp::messages::GetCompositeScheduleConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(GET_COMPOSITE_SCHEDULE_ACTION, request, response, error_code, error_message); @@ -215,12 +215,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetCompositeSched /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetConfigurationReq& request, ocpp::messages::GetConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(GET_CONFIGURATION_ACTION, request, response, error_code, error_message); @@ -228,12 +228,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetConfigurationR /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetDiagnosticsReq& request, ocpp::messages::GetDiagnosticsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(GET_DIAGNOSTICS_ACTION, request, response, error_code, error_message); @@ -241,12 +241,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetDiagnosticsReq /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetLocalListVersionReq& request, ocpp::messages::GetLocalListVersionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(GET_LOCAL_LIST_VERSION_ACTION, request, response, error_code, error_message); @@ -254,12 +254,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetLocalListVersi /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::RemoteStartTransactionReq& request, ocpp::messages::RemoteStartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(REMOTE_START_TRANSACTION_ACTION, request, response, error_code, error_message); @@ -267,12 +267,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::RemoteStartTransa /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::RemoteStopTransactionReq& request, ocpp::messages::RemoteStopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(REMOTE_STOP_TRANSACTION_ACTION, request, response, error_code, error_message); @@ -280,12 +280,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::RemoteStopTransac /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::ReserveNowReq& request, ocpp::messages::ReserveNowConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(RESERVE_NOW_ACTION, request, response, error_code, error_message); @@ -293,12 +293,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::ReserveNowReq& re /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::ResetReq& request, ocpp::messages::ResetConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(RESET_ACTION, request, response, error_code, error_message); @@ -306,12 +306,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::ResetReq& request /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::SendLocalListReq& request, ocpp::messages::SendLocalListConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(SEND_LOCAL_LIST_ACTION, request, response, error_code, error_message); @@ -319,12 +319,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::SendLocalListReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::SetChargingProfileReq& request, ocpp::messages::SetChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(SET_CHARGING_PROFILE_ACTION, request, response, error_code, error_message); @@ -332,12 +332,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::SetChargingProfil /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::TriggerMessageReq& request, ocpp::messages::TriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(TRIGGER_MESSAGE_ACTION, request, response, error_code, error_message); @@ -345,12 +345,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::TriggerMessageReq /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::UnlockConnectorReq& request, ocpp::messages::UnlockConnectorConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(UNLOCK_CONNECTOR_ACTION, request, response, error_code, error_message); @@ -358,12 +358,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::UnlockConnectorRe /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::UpdateFirmwareReq& request, ocpp::messages::UpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(UPDATE_FIRMWARE_ACTION, request, response, error_code, error_message); @@ -373,12 +373,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::UpdateFirmwareReq /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::CertificateSignedReq& request, ocpp::messages::CertificateSignedConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(CERTIFICATE_SIGNED_ACTION, request, response, error_code, error_message); @@ -386,12 +386,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::CertificateSigned /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::DeleteCertificateReq& request, ocpp::messages::DeleteCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(DELETE_CERTIFICATE_ACTION, request, response, error_code, error_message); @@ -399,12 +399,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::DeleteCertificate /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::ExtendedTriggerMessageReq& request, ocpp::messages::ExtendedTriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(EXTENDED_TRIGGER_MESSAGE_ACTION, request, response, error_code, error_message); @@ -412,12 +412,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::ExtendedTriggerMe /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetInstalledCertificateIdsReq& request, ocpp::messages::GetInstalledCertificateIdsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(GET_INSTALLED_CERTIFICATE_IDS_ACTION, request, response, error_code, error_message); @@ -425,12 +425,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetInstalledCerti /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetLogReq& request, ocpp::messages::GetLogConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(GET_LOG_ACTION, request, response, error_code, error_message); @@ -438,12 +438,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::GetLogReq& reques /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::InstallCertificateReq& request, ocpp::messages::InstallCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(INSTALL_CERTIFICATE_ACTION, request, response, error_code, error_message); @@ -451,12 +451,12 @@ bool CentralSystemHandler::handleMessage(const ocpp::messages::InstallCertificat /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool CentralSystemHandler::handleMessage(const ocpp::messages::SignedUpdateFirmwareReq& request, ocpp::messages::SignedUpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(SIGNED_UPDATE_FIRMWARE_ACTION, request, response, error_code, error_message); diff --git a/src/localcontroller/centralsystem/CentralSystemHandler.h b/src/localcontroller/centralsystem/CentralSystemHandler.h index 65d6f41b..13d496d3 100644 --- a/src/localcontroller/centralsystem/CentralSystemHandler.h +++ b/src/localcontroller/centralsystem/CentralSystemHandler.h @@ -121,264 +121,264 @@ class CentralSystemHandler /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::CancelReservationReq& request, ocpp::messages::CancelReservationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ChangeAvailabilityReq& request, ocpp::messages::ChangeAvailabilityConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ChangeConfigurationReq& request, ocpp::messages::ChangeConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ClearCacheReq& request, ocpp::messages::ClearCacheConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ClearChargingProfileReq& request, ocpp::messages::ClearChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetCompositeScheduleReq& request, ocpp::messages::GetCompositeScheduleConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetConfigurationReq& request, ocpp::messages::GetConfigurationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetDiagnosticsReq& request, ocpp::messages::GetDiagnosticsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetLocalListVersionReq& request, ocpp::messages::GetLocalListVersionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::RemoteStartTransactionReq& request, ocpp::messages::RemoteStartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::RemoteStopTransactionReq& request, ocpp::messages::RemoteStopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ReserveNowReq& request, ocpp::messages::ReserveNowConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ResetReq& request, ocpp::messages::ResetConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SendLocalListReq& request, ocpp::messages::SendLocalListConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SetChargingProfileReq& request, ocpp::messages::SetChargingProfileConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::TriggerMessageReq& request, ocpp::messages::TriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::UnlockConnectorReq& request, ocpp::messages::UnlockConnectorConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::UpdateFirmwareReq& request, ocpp::messages::UpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // Security extensions /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::CertificateSignedReq& request, ocpp::messages::CertificateSignedConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DeleteCertificateReq& request, ocpp::messages::DeleteCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::ExtendedTriggerMessageReq& request, ocpp::messages::ExtendedTriggerMessageConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetInstalledCertificateIdsReq& request, ocpp::messages::GetInstalledCertificateIdsConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::GetLogReq& request, ocpp::messages::GetLogConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::InstallCertificateReq& request, ocpp::messages::InstallCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SignedUpdateFirmwareReq& request, ocpp::messages::SignedUpdateFirmwareConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: @@ -392,12 +392,12 @@ class CentralSystemHandler * @param action RPC action for the request * @param request Request payload * @param response Response payload - * @param error Error code to return to the Charge Point, set to nullptr if no error + * @param error Error code to return to the Charge Point, empty if no error * @param message Error message to return to the Charge Point, empty if no error * @return true if the request has been sent and a response has been received, false otherwise */ template - bool forward(const std::string& action, const RequestType& request, ResponseType& response, const char*& error, std::string& message) + bool forward(const std::string& action, const RequestType& request, ResponseType& response, std::string& error, std::string& message) { bool ret = false; diff --git a/src/localcontroller/centralsystem/CentralSystemProxy.cpp b/src/localcontroller/centralsystem/CentralSystemProxy.cpp index fda5a721..1a029190 100644 --- a/src/localcontroller/centralsystem/CentralSystemProxy.cpp +++ b/src/localcontroller/centralsystem/CentralSystemProxy.cpp @@ -270,239 +270,239 @@ bool CentralSystemProxy::call(const ocpp::messages::SignedFirmwareStatusNotifica } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(CANCEL_RESERVATION_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(CHANGE_AVAILABILITY_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(CHANGE_CONFIGURATION_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(CLEAR_CACHE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( std::function handler) + const ocpp::messages::ClearChargingProfileReq&, ocpp::messages::ClearChargingProfileConf&, std::string&, std::string&)> handler) { return registerHandler(CLEAR_CHARGING_PROFILE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(DATA_TRANSFER_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( std::function handler) + const ocpp::messages::GetCompositeScheduleReq&, ocpp::messages::GetCompositeScheduleConf&, std::string&, std::string&)> handler) { return registerHandler(GET_COMPOSITE_SCHEDULE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(GET_CONFIGURATION_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(GET_DIAGNOSTICS_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(GET_LOCAL_LIST_VERSION_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( std::function handler) + const ocpp::messages::RemoteStartTransactionReq&, ocpp::messages::RemoteStartTransactionConf&, std::string&, std::string&)> handler) { return registerHandler(REMOTE_START_TRANSACTION_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( std::function handler) + const ocpp::messages::RemoteStopTransactionReq&, ocpp::messages::RemoteStopTransactionConf&, std::string&, std::string&)> handler) { return registerHandler(REMOTE_STOP_TRANSACTION_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(RESERVE_NOW_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(RESET_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(SEND_LOCAL_LIST_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(SET_CHARGING_PROFILE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(TRIGGER_MESSAGE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(UNLOCK_CONNECTOR_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(UPDATE_FIRMWARE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(CERTIFICATE_SIGNED_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(DELETE_CERTIFICATE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( std::function handler) + const ocpp::messages::ExtendedTriggerMessageReq&, ocpp::messages::ExtendedTriggerMessageConf&, std::string&, std::string&)> handler) { return registerHandler(EXTENDED_TRIGGER_MESSAGE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( std::function + const ocpp::messages::GetInstalledCertificateIdsReq&, ocpp::messages::GetInstalledCertificateIdsConf&, std::string&, std::string&)> handler) { return registerHandler(GET_INSTALLED_CERTIFICATE_IDS_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(GET_LOG_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( - std::function + std::function handler) { return registerHandler(INSTALL_CERTIFICATE_ACTION, handler); } /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool CentralSystemProxy::registerHandler( std::function handler) + const ocpp::messages::SignedUpdateFirmwareReq&, ocpp::messages::SignedUpdateFirmwareConf&, std::string&, std::string&)> handler) { return registerHandler(SIGNED_UPDATE_FIRMWARE_ACTION, handler); @@ -541,12 +541,12 @@ void CentralSystemProxy::rpcError() /** @copydoc bool IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool CentralSystemProxy::rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return m_msg_dispatcher.dispatchMessage(action, payload, response, error_code, error_message); diff --git a/src/localcontroller/centralsystem/CentralSystemProxy.h b/src/localcontroller/centralsystem/CentralSystemProxy.h index 088755cb..452ddef9 100644 --- a/src/localcontroller/centralsystem/CentralSystemProxy.h +++ b/src/localcontroller/centralsystem/CentralSystemProxy.h @@ -221,169 +221,169 @@ class CentralSystemProxy : public ICentralSystemProxy, std::string& message) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::ChangeAvailabilityReq&, ocpp::messages::ChangeAvailabilityConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::ChangeConfigurationReq&, ocpp::messages::ChangeConfigurationConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::ClearChargingProfileReq&, ocpp::messages::ClearChargingProfileConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::GetCompositeScheduleReq&, ocpp::messages::GetCompositeScheduleConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::GetLocalListVersionReq&, ocpp::messages::GetLocalListVersionConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function< - bool(const ocpp::messages::RemoteStartTransactionReq&, ocpp::messages::RemoteStartTransactionConf&, const char*&, std::string&)> + bool(const ocpp::messages::RemoteStartTransactionReq&, ocpp::messages::RemoteStartTransactionConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function< - bool(const ocpp::messages::RemoteStopTransactionReq&, ocpp::messages::RemoteStopTransactionConf&, const char*&, std::string&)> + bool(const ocpp::messages::RemoteStopTransactionReq&, ocpp::messages::RemoteStopTransactionConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) override; + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::SetChargingProfileReq&, ocpp::messages::SetChargingProfileConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function< - bool(const ocpp::messages::ExtendedTriggerMessageReq&, ocpp::messages::ExtendedTriggerMessageConf&, const char*&, std::string&)> + bool(const ocpp::messages::ExtendedTriggerMessageReq&, ocpp::messages::ExtendedTriggerMessageConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler(std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) override; + std::function handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::InstallCertificateReq&, ocpp::messages::InstallCertificateConf&, std::string&, std::string&)> handler) override; /** @copydoc bool ICentralSystemProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::SignedUpdateFirmwareReq&, ocpp::messages::SignedUpdateFirmwareConf&, std::string&, std::string&)> handler) override; // IRpc::IListener interface @@ -397,12 +397,12 @@ class CentralSystemProxy : public ICentralSystemProxy, /** @copydoc bool IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // IRpc::ISpy interface @@ -480,7 +480,7 @@ class CentralSystemProxy : public ICentralSystemProxy, */ template bool registerHandler(const std::string& action, - std::function handler) + std::function handler) { UserMessageHandler* msg_handler = new UserMessageHandler(action, m_messages_converter, handler); diff --git a/src/localcontroller/chargepoint/ChargePointHandler.cpp b/src/localcontroller/chargepoint/ChargePointHandler.cpp index 0bd34486..cd251669 100644 --- a/src/localcontroller/chargepoint/ChargePointHandler.cpp +++ b/src/localcontroller/chargepoint/ChargePointHandler.cpp @@ -93,12 +93,12 @@ ChargePointHandler::~ChargePointHandler() { } /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::AuthorizeReq& request, ocpp::messages::AuthorizeConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(AUTHORIZE_ACTION, request, response, error_code, error_message); @@ -106,12 +106,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::AuthorizeReq& reque /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::BootNotificationReq& request, ocpp::messages::BootNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(BOOT_NOTIFICATION_ACTION, request, response, error_code, error_message); @@ -119,12 +119,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::BootNotificationReq /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(DATA_TRANSFER_ACTION, request, response, error_code, error_message); @@ -132,12 +132,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::DataTransferReq& re /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::DiagnosticsStatusNotificationReq& request, ocpp::messages::DiagnosticsStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(DIAGNOSTIC_STATUS_NOTIFICATION_ACTION, request, response, error_code, error_message); @@ -145,12 +145,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::DiagnosticsStatusNo /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::FirmwareStatusNotificationReq& request, ocpp::messages::FirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(FIRMWARE_STATUS_NOTIFICATION_ACTION, request, response, error_code, error_message); @@ -158,12 +158,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::FirmwareStatusNotif /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::HeartbeatReq& request, ocpp::messages::HeartbeatConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(HEARTBEAT_ACTION, request, response, error_code, error_message); @@ -171,12 +171,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::HeartbeatReq& reque /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::MeterValuesReq& request, ocpp::messages::MeterValuesConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(METER_VALUES_ACTION, request, response, error_code, error_message); @@ -184,12 +184,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::MeterValuesReq& req /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::StartTransactionReq& request, ocpp::messages::StartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(START_TRANSACTION_ACTION, request, response, error_code, error_message); @@ -197,12 +197,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::StartTransactionReq /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::StatusNotificationReq& request, ocpp::messages::StatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(STATUS_NOTIFICATION_ACTION, request, response, error_code, error_message); @@ -210,12 +210,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::StatusNotificationR /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::StopTransactionReq& request, ocpp::messages::StopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(STOP_TRANSACTION_ACTION, request, response, error_code, error_message); @@ -225,12 +225,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::StopTransactionReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::LogStatusNotificationReq& request, ocpp::messages::LogStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(LOG_STATUS_NOTIFICATION_ACTION, request, response, error_code, error_message); @@ -238,12 +238,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::LogStatusNotificati /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::SecurityEventNotificationReq& request, ocpp::messages::SecurityEventNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(SECURITY_EVENT_NOTIFICATION_ACTION, request, response, error_code, error_message); @@ -251,12 +251,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::SecurityEventNotifi /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::SignCertificateReq& request, ocpp::messages::SignCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(SIGN_CERTIFICATE_ACTION, request, response, error_code, error_message); @@ -264,12 +264,12 @@ bool ChargePointHandler::handleMessage(const ocpp::messages::SignCertificateReq& /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool ChargePointHandler::handleMessage(const ocpp::messages::SignedFirmwareStatusNotificationReq& request, ocpp::messages::SignedFirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return forward(SIGNED_FIRMWARE_STATUS_NOTIFICATION_ACTION, request, response, error_code, error_message); diff --git a/src/localcontroller/chargepoint/ChargePointHandler.h b/src/localcontroller/chargepoint/ChargePointHandler.h index 4fbabfe1..572b9ae2 100644 --- a/src/localcontroller/chargepoint/ChargePointHandler.h +++ b/src/localcontroller/chargepoint/ChargePointHandler.h @@ -95,144 +95,144 @@ class ChargePointHandler /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::AuthorizeReq& request, ocpp::messages::AuthorizeConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::BootNotificationReq& request, ocpp::messages::BootNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DataTransferReq& request, ocpp::messages::DataTransferConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::DiagnosticsStatusNotificationReq& request, ocpp::messages::DiagnosticsStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::FirmwareStatusNotificationReq& request, ocpp::messages::FirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::HeartbeatReq& request, ocpp::messages::HeartbeatConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::MeterValuesReq& request, ocpp::messages::MeterValuesConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::StartTransactionReq& request, ocpp::messages::StartTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::StatusNotificationReq& request, ocpp::messages::StatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::StopTransactionReq& request, ocpp::messages::StopTransactionConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // Security extensions /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::LogStatusNotificationReq& request, ocpp::messages::LogStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SecurityEventNotificationReq& request, ocpp::messages::SecurityEventNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SignCertificateReq& request, ocpp::messages::SignCertificateConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool GenericMessageHandler::handleMessage(const RequestType& request, * ResponseType& response, - * const char*& error_code, + * std::string& error_code, * std::string& error_message) */ bool handleMessage(const ocpp::messages::SignedFirmwareStatusNotificationReq& request, ocpp::messages::SignedFirmwareStatusNotificationConf& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: @@ -247,12 +247,12 @@ class ChargePointHandler * @param action RPC action for the request * @param request Request payload * @param response Response payload - * @param error Error code to return to the Charge Point, set to nullptr if no error + * @param error Error code to return to the Charge Point, empty if no error * @param message Error message to return to the Charge Point, empty if no error * @return true if the request has been sent and a response has been received, false otherwise */ template - bool forward(const std::string& action, const RequestType& request, ResponseType& response, const char*& error, std::string& message) + bool forward(const std::string& action, const RequestType& request, ResponseType& response, std::string& error, std::string& message) { bool ret = false; diff --git a/src/localcontroller/chargepoint/ChargePointProxy.cpp b/src/localcontroller/chargepoint/ChargePointProxy.cpp index 43911ad2..de15a027 100644 --- a/src/localcontroller/chargepoint/ChargePointProxy.cpp +++ b/src/localcontroller/chargepoint/ChargePointProxy.cpp @@ -403,26 +403,26 @@ bool ChargePointProxy::call(const ocpp::messages::SignedUpdateFirmwareReq& reque } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(AUTHORIZE_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function + std::function handler) { return registerHandler(BOOT_NOTIFICATION_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(DATA_TRANSFER_ACTION, handler); @@ -430,10 +430,10 @@ bool ChargePointProxy::registerHandler( /** @copydoc bool IChargePointProxy::registerHandler( std::function) */ + ocpp::messages::DiagnosticsStatusNotificationConf&, std::string&, std::string&)>) */ bool ChargePointProxy::registerHandler(std::function handler) { return registerHandler(DIAGNOSTIC_STATUS_NOTIFICATION_ACTION, handler); @@ -441,63 +441,63 @@ bool ChargePointProxy::registerHandler(std::function) */ + ocpp::messages::FirmwareStatusNotificationConf&, std::string&, std::string&)>) */ bool ChargePointProxy::registerHandler( std::function + const ocpp::messages::FirmwareStatusNotificationReq&, ocpp::messages::FirmwareStatusNotificationConf&, std::string&, std::string&)> handler) { return registerHandler(FIRMWARE_STATUS_NOTIFICATION_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(HEARTBEAT_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function handler) + std::function handler) { return registerHandler(METER_VALUES_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function + std::function handler) { return registerHandler(START_TRANSACTION_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function + std::function handler) { return registerHandler(STATUS_NOTIFICATION_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function + std::function handler) { return registerHandler(STOP_TRANSACTION_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( std::function handler) + const ocpp::messages::LogStatusNotificationReq&, ocpp::messages::LogStatusNotificationConf&, std::string&, std::string&)> handler) { return registerHandler(LOG_STATUS_NOTIFICATION_ACTION, handler); @@ -505,19 +505,19 @@ bool ChargePointProxy::registerHandler( /** @copydoc bool IChargePointProxy::registerHandler( std::function) */ + ocpp::messages::SecurityEventNotificationConf&, std::string&, std::string&)>) */ bool ChargePointProxy::registerHandler( std::function + const ocpp::messages::SecurityEventNotificationReq&, ocpp::messages::SecurityEventNotificationConf&, std::string&, std::string&)> handler) { return registerHandler(SECURITY_EVENT_NOTIFICATION_ACTION, handler); } /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool ChargePointProxy::registerHandler( - std::function + std::function handler) { return registerHandler(SIGN_CERTIFICATE_ACTION, handler); @@ -525,10 +525,10 @@ bool ChargePointProxy::registerHandler( /** @copydoc bool IChargePointProxy::registerHandler( std::function) */ + ocpp::messages::SignedFirmwareStatusNotificationConf&, std::string&, std::string&)>) */ bool ChargePointProxy::registerHandler(std::function handler) { return registerHandler(SIGNED_FIRMWARE_STATUS_NOTIFICATION_ACTION, handler); @@ -560,12 +560,12 @@ void ChargePointProxy::rpcError() /** @copydoc bool IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool ChargePointProxy::rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { return m_msg_dispatcher.dispatchMessage(action, payload, response, error_code, error_message); diff --git a/src/localcontroller/chargepoint/ChargePointProxy.h b/src/localcontroller/chargepoint/ChargePointProxy.h index 5c004acc..2466b248 100644 --- a/src/localcontroller/chargepoint/ChargePointProxy.h +++ b/src/localcontroller/chargepoint/ChargePointProxy.h @@ -322,97 +322,97 @@ class ChargePointProxy : public IChargePointProxy, public ocpp::rpc::IRpc::IList std::string& message) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( std::function) */ + ocpp::messages::DiagnosticsStatusNotificationConf&, std::string&, std::string&)>) */ bool registerHandler(std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( std::function) */ + ocpp::messages::FirmwareStatusNotificationConf&, std::string&, std::string&)>) */ bool registerHandler(std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function handler) + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function handler) + const ocpp::messages::StatusNotificationReq&, ocpp::messages::StatusNotificationConf&, std::string&, std::string&)> handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( std::function< - bool(const ocpp::messages::LogStatusNotificationReq&, ocpp::messages::LogStatusNotificationConf&, const char*&, std::string&)> + bool(const ocpp::messages::LogStatusNotificationReq&, ocpp::messages::LogStatusNotificationConf&, std::string&, std::string&)> handler) override; /** @copydoc bool IChargePointProxy::registerHandler( std::function) */ + ocpp::messages::SecurityEventNotificationConf&, std::string&, std::string&)>) */ bool registerHandler(std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( - std::function) */ + std::function) */ bool registerHandler( - std::function + std::function handler) override; /** @copydoc bool IChargePointProxy::registerHandler( std::function) */ + ocpp::messages::SignedFirmwareStatusNotificationConf&, std::string&, std::string&)>) */ bool registerHandler(std::function handler) override; // IRpc::IListener interface @@ -426,12 +426,12 @@ class ChargePointProxy : public IChargePointProxy, public ocpp::rpc::IRpc::IList /** @copydoc bool IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; // IRpc::ISpy interface @@ -497,7 +497,7 @@ class ChargePointProxy : public IChargePointProxy, public ocpp::rpc::IRpc::IList */ template bool registerHandler(const std::string& action, - std::function handler) + std::function handler) { UserMessageHandler* msg_handler = new UserMessageHandler(action, m_messages_converter, handler); diff --git a/src/localcontroller/interface/ICentralSystemProxy.h b/src/localcontroller/interface/ICentralSystemProxy.h index 0f94c4f3..1a7f0047 100644 --- a/src/localcontroller/interface/ICentralSystemProxy.h +++ b/src/localcontroller/interface/ICentralSystemProxy.h @@ -301,7 +301,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -311,7 +311,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::ChangeAvailabilityReq&, ocpp::messages::ChangeAvailabilityConf&, const char*&, std::string&)> + bool(const ocpp::messages::ChangeAvailabilityReq&, ocpp::messages::ChangeAvailabilityConf&, std::string&, std::string&)> handler) = 0; /** @@ -321,7 +321,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::ChangeConfigurationReq&, ocpp::messages::ChangeConfigurationConf&, const char*&, std::string&)> + bool(const ocpp::messages::ChangeConfigurationReq&, ocpp::messages::ChangeConfigurationConf&, std::string&, std::string&)> handler) = 0; /** @@ -330,7 +330,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function handler) = 0; + std::function handler) = 0; /** * @brief Register a handler for the ClearChargingProfile request @@ -339,7 +339,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::ClearChargingProfileReq&, ocpp::messages::ClearChargingProfileConf&, const char*&, std::string&)> + bool(const ocpp::messages::ClearChargingProfileReq&, ocpp::messages::ClearChargingProfileConf&, std::string&, std::string&)> handler) = 0; /** @@ -348,7 +348,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -358,7 +358,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::GetCompositeScheduleReq&, ocpp::messages::GetCompositeScheduleConf&, const char*&, std::string&)> + bool(const ocpp::messages::GetCompositeScheduleReq&, ocpp::messages::GetCompositeScheduleConf&, std::string&, std::string&)> handler) = 0; /** @@ -367,7 +367,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -376,7 +376,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -386,7 +386,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::GetLocalListVersionReq&, ocpp::messages::GetLocalListVersionConf&, const char*&, std::string&)> + bool(const ocpp::messages::GetLocalListVersionReq&, ocpp::messages::GetLocalListVersionConf&, std::string&, std::string&)> handler) = 0; /** @@ -396,7 +396,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::RemoteStartTransactionReq&, ocpp::messages::RemoteStartTransactionConf&, const char*&, std::string&)> + bool(const ocpp::messages::RemoteStartTransactionReq&, ocpp::messages::RemoteStartTransactionConf&, std::string&, std::string&)> handler) = 0; /** @@ -406,7 +406,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::RemoteStopTransactionReq&, ocpp::messages::RemoteStopTransactionConf&, const char*&, std::string&)> + bool(const ocpp::messages::RemoteStopTransactionReq&, ocpp::messages::RemoteStopTransactionConf&, std::string&, std::string&)> handler) = 0; /** @@ -415,7 +415,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function handler) = 0; + std::function handler) = 0; /** * @brief Register a handler for the Reset request @@ -423,7 +423,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function handler) = 0; + std::function handler) = 0; /** * @brief Register a handler for the SendLocalList request @@ -431,7 +431,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -441,7 +441,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::SetChargingProfileReq&, ocpp::messages::SetChargingProfileConf&, const char*&, std::string&)> + bool(const ocpp::messages::SetChargingProfileReq&, ocpp::messages::SetChargingProfileConf&, std::string&, std::string&)> handler) = 0; /** @@ -450,7 +450,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -459,7 +459,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -468,7 +468,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -477,7 +477,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -486,7 +486,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -496,7 +496,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::ExtendedTriggerMessageReq&, ocpp::messages::ExtendedTriggerMessageConf&, const char*&, std::string&)> + bool(const ocpp::messages::ExtendedTriggerMessageReq&, ocpp::messages::ExtendedTriggerMessageConf&, std::string&, std::string&)> handler) = 0; /** @@ -506,7 +506,7 @@ class ICentralSystemProxy */ virtual bool registerHandler(std::function handler) = 0; /** @@ -515,7 +515,7 @@ class ICentralSystemProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function handler) = 0; + std::function handler) = 0; /** * @brief Register a handler for the InstallCertificate request @@ -524,7 +524,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::InstallCertificateReq&, ocpp::messages::InstallCertificateConf&, const char*&, std::string&)> + bool(const ocpp::messages::InstallCertificateReq&, ocpp::messages::InstallCertificateConf&, std::string&, std::string&)> handler) = 0; /** @@ -534,7 +534,7 @@ class ICentralSystemProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::SignedUpdateFirmwareReq&, ocpp::messages::SignedUpdateFirmwareConf&, const char*&, std::string&)> + bool(const ocpp::messages::SignedUpdateFirmwareReq&, ocpp::messages::SignedUpdateFirmwareConf&, std::string&, std::string&)> handler) = 0; }; diff --git a/src/localcontroller/interface/IChargePointProxy.h b/src/localcontroller/interface/IChargePointProxy.h index f317837d..f8b8b1a4 100644 --- a/src/localcontroller/interface/IChargePointProxy.h +++ b/src/localcontroller/interface/IChargePointProxy.h @@ -443,7 +443,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function handler) = 0; + std::function handler) = 0; /** * @brief Register a handler for the BootNotification request @@ -451,7 +451,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -460,7 +460,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -470,7 +470,7 @@ class IChargePointProxy */ virtual bool registerHandler(std::function handler) = 0; /** @@ -480,7 +480,7 @@ class IChargePointProxy */ virtual bool registerHandler(std::function handler) = 0; /** @@ -489,7 +489,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function handler) = 0; + std::function handler) = 0; /** * @brief Register a handler for the MeterValues request @@ -497,7 +497,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -506,7 +506,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -516,7 +516,7 @@ class IChargePointProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::StatusNotificationReq&, ocpp::messages::StatusNotificationConf&, const char*&, std::string&)> + bool(const ocpp::messages::StatusNotificationReq&, ocpp::messages::StatusNotificationConf&, std::string&, std::string&)> handler) = 0; /** @@ -525,7 +525,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -535,7 +535,7 @@ class IChargePointProxy */ virtual bool registerHandler( std::function< - bool(const ocpp::messages::LogStatusNotificationReq&, ocpp::messages::LogStatusNotificationConf&, const char*&, std::string&)> + bool(const ocpp::messages::LogStatusNotificationReq&, ocpp::messages::LogStatusNotificationConf&, std::string&, std::string&)> handler) = 0; /** @@ -545,7 +545,7 @@ class IChargePointProxy */ virtual bool registerHandler(std::function handler) = 0; /** @@ -554,7 +554,7 @@ class IChargePointProxy * @return true if the handler has been registered, false otherwise */ virtual bool registerHandler( - std::function + std::function handler) = 0; /** @@ -564,7 +564,7 @@ class IChargePointProxy */ virtual bool registerHandler(std::function handler) = 0; }; diff --git a/src/messages/Authorize.cpp b/src/messages/Authorize.cpp index a80e4897..9149afbe 100644 --- a/src/messages/Authorize.cpp +++ b/src/messages/Authorize.cpp @@ -36,8 +36,8 @@ const EnumToStringFromString AuthorizationStatusHelper = {{ namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ -bool AuthorizeReqConverter::fromJson(const rapidjson::Value& json, AuthorizeReq& data, const char*& error_code, std::string& error_message) +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ +bool AuthorizeReqConverter::fromJson(const rapidjson::Value& json, AuthorizeReq& data, std::string& error_code, std::string& error_message) { (void)error_code; (void)error_message; @@ -45,17 +45,17 @@ bool AuthorizeReqConverter::fromJson(const rapidjson::Value& json, AuthorizeReq& return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool AuthorizeReqConverter::toJson(const AuthorizeReq& data, rapidjson::Document& json) { fill(json, "idTag", data.idTag); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool AuthorizeConfConverter::fromJson(const rapidjson::Value& json, AuthorizeConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { IdTagInfoConverter id_tag_info_converter; @@ -63,7 +63,7 @@ bool AuthorizeConfConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool AuthorizeConfConverter::toJson(const AuthorizeConf& data, rapidjson::Document& json) { IdTagInfoConverter id_tag_info_converter; diff --git a/src/messages/BootNotification.cpp b/src/messages/BootNotification.cpp index 8a53f61f..6ac194bb 100644 --- a/src/messages/BootNotification.cpp +++ b/src/messages/BootNotification.cpp @@ -32,10 +32,10 @@ const EnumToStringFromString RegistrationStatusHelper = { namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool BootNotificationReqConverter::fromJson(const rapidjson::Value& json, BootNotificationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -53,7 +53,7 @@ bool BootNotificationReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool BootNotificationReqConverter::toJson(const BootNotificationReq& data, rapidjson::Document& json) { fill(json, "chargeBoxSerialNumber", data.chargeBoxSerialNumber); @@ -69,10 +69,10 @@ bool BootNotificationReqConverter::toJson(const BootNotificationReq& data, rapid return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool BootNotificationConfConverter::fromJson(const rapidjson::Value& json, BootNotificationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -87,7 +87,7 @@ bool BootNotificationConfConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool BootNotificationConfConverter::toJson(const BootNotificationConf& data, rapidjson::Document& json) { fill(json, "currentTime", data.currentTime.str()); diff --git a/src/messages/CancelReservation.cpp b/src/messages/CancelReservation.cpp index 079d4df7..66ffbb0d 100644 --- a/src/messages/CancelReservation.cpp +++ b/src/messages/CancelReservation.cpp @@ -33,10 +33,10 @@ const EnumToStringFromString CancelReservationStatusHel namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool CancelReservationReqConverter::fromJson(const rapidjson::Value& json, CancelReservationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -45,17 +45,17 @@ bool CancelReservationReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool CancelReservationReqConverter::toJson(const CancelReservationReq& data, rapidjson::Document& json) { fill(json, "reservationId", data.reservationId); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool CancelReservationConfConverter::fromJson(const rapidjson::Value& json, CancelReservationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -64,7 +64,7 @@ bool CancelReservationConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool CancelReservationConfConverter::toJson(const CancelReservationConf& data, rapidjson::Document& json) { fill(json, "status", CancelReservationStatusHelper.toString(data.status)); diff --git a/src/messages/CertificateSigned.cpp b/src/messages/CertificateSigned.cpp index 7e7317eb..0dc49a31 100644 --- a/src/messages/CertificateSigned.cpp +++ b/src/messages/CertificateSigned.cpp @@ -33,10 +33,10 @@ const EnumToStringFromString CertificateSignedS namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool CertificateSignedReqConverter::fromJson(const rapidjson::Value& json, CertificateSignedReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -45,17 +45,17 @@ bool CertificateSignedReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool CertificateSignedReqConverter::toJson(const CertificateSignedReq& data, rapidjson::Document& json) { fill(json, "certificateChain", data.certificateChain); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool CertificateSignedConfConverter::fromJson(const rapidjson::Value& json, CertificateSignedConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -64,7 +64,7 @@ bool CertificateSignedConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool CertificateSignedConfConverter::toJson(const CertificateSignedConf& data, rapidjson::Document& json) { fill(json, "status", CertificateSignedStatusEnumTypeHelper.toString(data.status)); diff --git a/src/messages/ChangeAvailability.cpp b/src/messages/ChangeAvailability.cpp index 341b5ec1..b4357fe3 100644 --- a/src/messages/ChangeAvailability.cpp +++ b/src/messages/ChangeAvailability.cpp @@ -37,10 +37,10 @@ const EnumToStringFromString AvailabilityStatusHelper = { namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ChangeAvailabilityReqConverter::fromJson(const rapidjson::Value& json, ChangeAvailabilityReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -53,7 +53,7 @@ bool ChangeAvailabilityReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ChangeAvailabilityReqConverter::toJson(const ChangeAvailabilityReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); @@ -61,10 +61,10 @@ bool ChangeAvailabilityReqConverter::toJson(const ChangeAvailabilityReq& data, r return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ChangeAvailabilityConfConverter::fromJson(const rapidjson::Value& json, ChangeAvailabilityConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -73,7 +73,7 @@ bool ChangeAvailabilityConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ChangeAvailabilityConfConverter::toJson(const ChangeAvailabilityConf& data, rapidjson::Document& json) { fill(json, "status", AvailabilityStatusHelper.toString(data.status)); diff --git a/src/messages/ChangeConfiguration.cpp b/src/messages/ChangeConfiguration.cpp index 68febf6d..c9bb51ee 100644 --- a/src/messages/ChangeConfiguration.cpp +++ b/src/messages/ChangeConfiguration.cpp @@ -35,10 +35,10 @@ const EnumToStringFromString ConfigurationStatusHelper = {{ namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ChangeConfigurationReqConverter::fromJson(const rapidjson::Value& json, ChangeConfigurationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -48,7 +48,7 @@ bool ChangeConfigurationReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ChangeConfigurationReqConverter::toJson(const ChangeConfigurationReq& data, rapidjson::Document& json) { fill(json, "key", data.key); @@ -56,10 +56,10 @@ bool ChangeConfigurationReqConverter::toJson(const ChangeConfigurationReq& data, return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ChangeConfigurationConfConverter::fromJson(const rapidjson::Value& json, ChangeConfigurationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -68,7 +68,7 @@ bool ChangeConfigurationConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ChangeConfigurationConfConverter::toJson(const ChangeConfigurationConf& data, rapidjson::Document& json) { fill(json, "status", ConfigurationStatusHelper.toString(data.status)); diff --git a/src/messages/ClearCache.cpp b/src/messages/ClearCache.cpp index 0ec4195d..14024adf 100644 --- a/src/messages/ClearCache.cpp +++ b/src/messages/ClearCache.cpp @@ -34,10 +34,10 @@ const EnumToStringFromString ClearCacheStatusHelper = {{ClearC namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ClearCacheReqConverter::fromJson(const rapidjson::Value& json, ClearCacheReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -47,7 +47,7 @@ bool ClearCacheReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ClearCacheReqConverter::toJson(const ClearCacheReq& data, rapidjson::Document& json) { (void)data; @@ -55,10 +55,10 @@ bool ClearCacheReqConverter::toJson(const ClearCacheReq& data, rapidjson::Docume return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ClearCacheConfConverter::fromJson(const rapidjson::Value& json, ClearCacheConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -67,7 +67,7 @@ bool ClearCacheConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ClearCacheConfConverter::toJson(const ClearCacheConf& data, rapidjson::Document& json) { fill(json, "status", ClearCacheStatusHelper.toString(data.status)); diff --git a/src/messages/ClearChargingProfile.cpp b/src/messages/ClearChargingProfile.cpp index 44e66639..04684f59 100644 --- a/src/messages/ClearChargingProfile.cpp +++ b/src/messages/ClearChargingProfile.cpp @@ -40,10 +40,10 @@ const EnumToStringFromString ClearChargingProfileSta namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ClearChargingProfileReqConverter::fromJson(const rapidjson::Value& json, ClearChargingProfileReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { extract(json, "id", data.id); @@ -60,7 +60,7 @@ bool ClearChargingProfileReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ClearChargingProfileReqConverter::toJson(const ClearChargingProfileReq& data, rapidjson::Document& json) { fill(json, "id", data.id); @@ -73,10 +73,10 @@ bool ClearChargingProfileReqConverter::toJson(const ClearChargingProfileReq& dat return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ClearChargingProfileConfConverter::fromJson(const rapidjson::Value& json, ClearChargingProfileConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -85,7 +85,7 @@ bool ClearChargingProfileConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ClearChargingProfileConfConverter::toJson(const ClearChargingProfileConf& data, rapidjson::Document& json) { fill(json, "status", ClearChargingProfileStatusHelper.toString(data.status)); diff --git a/src/messages/DataTransfer.cpp b/src/messages/DataTransfer.cpp index 3ab69fe0..889cb74e 100644 --- a/src/messages/DataTransfer.cpp +++ b/src/messages/DataTransfer.cpp @@ -35,10 +35,10 @@ const EnumToStringFromString DataTransferStatusHelper = {{Da namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool DataTransferReqConverter::fromJson(const rapidjson::Value& json, DataTransferReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -49,7 +49,7 @@ bool DataTransferReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool DataTransferReqConverter::toJson(const DataTransferReq& data, rapidjson::Document& json) { fill(json, "vendorId", data.vendorId); @@ -58,10 +58,10 @@ bool DataTransferReqConverter::toJson(const DataTransferReq& data, rapidjson::Do return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool DataTransferConfConverter::fromJson(const rapidjson::Value& json, DataTransferConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -71,7 +71,7 @@ bool DataTransferConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool DataTransferConfConverter::toJson(const DataTransferConf& data, rapidjson::Document& json) { fill(json, "status", DataTransferStatusHelper.toString(data.status)); diff --git a/src/messages/DeleteCertificate.cpp b/src/messages/DeleteCertificate.cpp index 4228065c..ecdb035e 100644 --- a/src/messages/DeleteCertificate.cpp +++ b/src/messages/DeleteCertificate.cpp @@ -36,17 +36,17 @@ const EnumToStringFromString DeleteCertificateS namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool DeleteCertificateReqConverter::fromJson(const rapidjson::Value& json, DeleteCertificateReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { CertificateHashDataTypeConverter certificate_hash_converter; return certificate_hash_converter.fromJson(json["certificateHashData"], data.certificateHashData, error_code, error_message); } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool DeleteCertificateReqConverter::toJson(const DeleteCertificateReq& data, rapidjson::Document& json) { CertificateHashDataTypeConverter certificate_hash_converter; @@ -58,10 +58,10 @@ bool DeleteCertificateReqConverter::toJson(const DeleteCertificateReq& data, rap return ret; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool DeleteCertificateConfConverter::fromJson(const rapidjson::Value& json, DeleteCertificateConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -70,7 +70,7 @@ bool DeleteCertificateConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool DeleteCertificateConfConverter::toJson(const DeleteCertificateConf& data, rapidjson::Document& json) { fill(json, "status", DeleteCertificateStatusEnumTypeHelper.toString(data.status)); diff --git a/src/messages/DiagnosticsStatusNotification.cpp b/src/messages/DiagnosticsStatusNotification.cpp index c64610eb..38a781b0 100644 --- a/src/messages/DiagnosticsStatusNotification.cpp +++ b/src/messages/DiagnosticsStatusNotification.cpp @@ -36,10 +36,10 @@ const EnumToStringFromString DiagnosticsStatusHelper = {{Diag namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool DiagnosticsStatusNotificationReqConverter::fromJson(const rapidjson::Value& json, DiagnosticsStatusNotificationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -48,17 +48,17 @@ bool DiagnosticsStatusNotificationReqConverter::fromJson(const rapidjson::Value& return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool DiagnosticsStatusNotificationReqConverter::toJson(const DiagnosticsStatusNotificationReq& data, rapidjson::Document& json) { fill(json, "status", DiagnosticsStatusHelper.toString(data.status)); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool DiagnosticsStatusNotificationConfConverter::fromJson(const rapidjson::Value& json, DiagnosticsStatusNotificationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -68,7 +68,7 @@ bool DiagnosticsStatusNotificationConfConverter::fromJson(const rapidjson::Value return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool DiagnosticsStatusNotificationConfConverter::toJson(const DiagnosticsStatusNotificationConf& data, rapidjson::Document& json) { (void)json; diff --git a/src/messages/ExtendedTriggerMessage.cpp b/src/messages/ExtendedTriggerMessage.cpp index a5f5cbf1..2922bd7f 100644 --- a/src/messages/ExtendedTriggerMessage.cpp +++ b/src/messages/ExtendedTriggerMessage.cpp @@ -45,10 +45,10 @@ const EnumToStringFromString TriggerMessageStatusE namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ExtendedTriggerMessageReqConverter::fromJson(const rapidjson::Value& json, ExtendedTriggerMessageReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -62,7 +62,7 @@ bool ExtendedTriggerMessageReqConverter::fromJson(const rapidjson::Value& jso return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ExtendedTriggerMessageReqConverter::toJson(const ExtendedTriggerMessageReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); @@ -70,10 +70,10 @@ bool ExtendedTriggerMessageReqConverter::toJson(const ExtendedTriggerMessageReq& return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ExtendedTriggerMessageConfConverter::fromJson(const rapidjson::Value& json, ExtendedTriggerMessageConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -82,7 +82,7 @@ bool ExtendedTriggerMessageConfConverter::fromJson(const rapidjson::Value& j return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ExtendedTriggerMessageConfConverter::toJson(const ExtendedTriggerMessageConf& data, rapidjson::Document& json) { fill(json, "status", TriggerMessageStatusEnumTypeHelper.toString(data.status)); diff --git a/src/messages/FirmwareStatusNotification.cpp b/src/messages/FirmwareStatusNotification.cpp index d5755e65..716b31f1 100644 --- a/src/messages/FirmwareStatusNotification.cpp +++ b/src/messages/FirmwareStatusNotification.cpp @@ -40,10 +40,10 @@ const EnumToStringFromString FirmwareStatusHelper = {{FirmwareSt namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool FirmwareStatusNotificationReqConverter::fromJson(const rapidjson::Value& json, FirmwareStatusNotificationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -52,17 +52,17 @@ bool FirmwareStatusNotificationReqConverter::fromJson(const rapidjson::Value& return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool FirmwareStatusNotificationReqConverter::toJson(const FirmwareStatusNotificationReq& data, rapidjson::Document& json) { fill(json, "status", FirmwareStatusHelper.toString(data.status)); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool FirmwareStatusNotificationConfConverter::fromJson(const rapidjson::Value& json, FirmwareStatusNotificationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -72,7 +72,7 @@ bool FirmwareStatusNotificationConfConverter::fromJson(const rapidjson::Value& return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool FirmwareStatusNotificationConfConverter::toJson(const FirmwareStatusNotificationConf& data, rapidjson::Document& json) { (void)json; diff --git a/src/messages/GenericMessageHandler.h b/src/messages/GenericMessageHandler.h index 92d8af60..4ee4ce34 100644 --- a/src/messages/GenericMessageHandler.h +++ b/src/messages/GenericMessageHandler.h @@ -46,12 +46,12 @@ class GenericMessageHandler : public IMessageDispatcher::IMessageHandler /** @copydoc bool IMessageHandler::handle(const std::string& const rapidjson::Value& rapidjson::Document& - const char*& + std::string& std::string&) */ bool handle(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override { bool ret = false; @@ -79,11 +79,11 @@ class GenericMessageHandler : public IMessageDispatcher::IMessageHandler * @brief Handle an incoming call request * @param request Payload of the request * @param response Payload of the response - * @param error_code Standard error code, set to nullptr if no error + * @param error_code Standard error code, empty if no error * @param error_msg Additionnal error message, empty if no error * @return true if the call is accepted, false otherwise */ - virtual bool handleMessage(const RequestType& request, ResponseType& response, const char*& error_code, std::string& error_message) = 0; + virtual bool handleMessage(const RequestType& request, ResponseType& response, std::string& error_code, std::string& error_message) = 0; private: IMessageConverter& m_request_converter; diff --git a/src/messages/GenericMessageSender.h b/src/messages/GenericMessageSender.h index c8727211..d18e380c 100644 --- a/src/messages/GenericMessageSender.h +++ b/src/messages/GenericMessageSender.h @@ -155,7 +155,7 @@ class GenericMessageSender if (validator && validator->isValid(resp)) { // Convert response - const char* error_code = nullptr; + std::string error_code; std::string error_message; resp_converter->setAllocator(&rpc_frame.GetAllocator()); if (resp_converter->fromJson(resp, response, error_code, error_message)) @@ -222,7 +222,7 @@ class GenericMessageSender if (validator && validator->isValid(resp)) { // Convert response - const char* error_code = nullptr; + std::string error_code; std::string error_message; resp_converter->setAllocator(&rpc_frame.GetAllocator()); if (resp_converter->fromJson(resp, response, error_code, error_message)) diff --git a/src/messages/GetCompositeSchedule.cpp b/src/messages/GetCompositeSchedule.cpp index a9e8e48e..7f053ab2 100644 --- a/src/messages/GetCompositeSchedule.cpp +++ b/src/messages/GetCompositeSchedule.cpp @@ -35,10 +35,10 @@ const EnumToStringFromString GetCompositeScheduleSta namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetCompositeScheduleReqConverter::fromJson(const rapidjson::Value& json, GetCompositeScheduleReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "connectorId", data.connectorId, error_message); @@ -54,7 +54,7 @@ bool GetCompositeScheduleReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetCompositeScheduleReqConverter::toJson(const GetCompositeScheduleReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); @@ -66,10 +66,10 @@ bool GetCompositeScheduleReqConverter::toJson(const GetCompositeScheduleReq& dat return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetCompositeScheduleConfConverter::fromJson(const rapidjson::Value& json, GetCompositeScheduleConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { data.status = GetCompositeScheduleStatusHelper.fromString(json["status"].GetString()); @@ -80,14 +80,14 @@ bool GetCompositeScheduleConfConverter::fromJson(const rapidjson::Value& json, ChargingScheduleConverter charging_schedule_converter; ret = charging_schedule_converter.fromJson(json[""], data.chargingSchedule.value(), error_code, error_message); } - if (!ret && !error_code) + if (!ret && error_code.empty()) { error_code = ocpp::rpc::IRpc::RPC_ERROR_TYPE_CONSTRAINT_VIOLATION; } return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetCompositeScheduleConfConverter::toJson(const GetCompositeScheduleConf& data, rapidjson::Document& json) { bool ret = true; diff --git a/src/messages/GetConfiguration.cpp b/src/messages/GetConfiguration.cpp index 2ce70a02..a023d508 100644 --- a/src/messages/GetConfiguration.cpp +++ b/src/messages/GetConfiguration.cpp @@ -26,10 +26,10 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetConfigurationReqConverter::fromJson(const rapidjson::Value& json, GetConfigurationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { if (json.HasMember("key")) @@ -48,7 +48,7 @@ bool GetConfigurationReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetConfigurationReqConverter::toJson(const GetConfigurationReq& data, rapidjson::Document& json) { if (data.key.isSet()) @@ -64,10 +64,10 @@ bool GetConfigurationReqConverter::toJson(const GetConfigurationReq& data, rapid return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetConfigurationConfConverter::fromJson(const rapidjson::Value& json, GetConfigurationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -99,7 +99,7 @@ bool GetConfigurationConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetConfigurationConfConverter::toJson(const GetConfigurationConf& data, rapidjson::Document& json) { if (data.configurationKey.isSet()) diff --git a/src/messages/GetDiagnostics.cpp b/src/messages/GetDiagnostics.cpp index 024dada4..3b0018f6 100644 --- a/src/messages/GetDiagnostics.cpp +++ b/src/messages/GetDiagnostics.cpp @@ -27,10 +27,10 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetDiagnosticsReqConverter::fromJson(const rapidjson::Value& json, GetDiagnosticsReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -48,7 +48,7 @@ bool GetDiagnosticsReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetDiagnosticsReqConverter::toJson(const GetDiagnosticsReq& data, rapidjson::Document& json) { fill(json, "location", data.location); @@ -59,10 +59,10 @@ bool GetDiagnosticsReqConverter::toJson(const GetDiagnosticsReq& data, rapidjson return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetDiagnosticsConfConverter::fromJson(const rapidjson::Value& json, GetDiagnosticsConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -71,7 +71,7 @@ bool GetDiagnosticsConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetDiagnosticsConfConverter::toJson(const GetDiagnosticsConf& data, rapidjson::Document& json) { fill(json, "fileName", data.fileName); diff --git a/src/messages/GetInstalledCertificateIds.cpp b/src/messages/GetInstalledCertificateIds.cpp index bd695314..2ed29398 100644 --- a/src/messages/GetInstalledCertificateIds.cpp +++ b/src/messages/GetInstalledCertificateIds.cpp @@ -39,10 +39,10 @@ const EnumToStringFromString GetInstalled namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetInstalledCertificateIdsReqConverter::fromJson(const rapidjson::Value& json, GetInstalledCertificateIdsReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -51,17 +51,17 @@ bool GetInstalledCertificateIdsReqConverter::fromJson(const rapidjson::Value& return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetInstalledCertificateIdsReqConverter::toJson(const GetInstalledCertificateIdsReq& data, rapidjson::Document& json) { fill(json, "certificateType", CertificateUseEnumTypeHelper.toString(data.certificateType)); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetInstalledCertificateIdsConfConverter::fromJson(const rapidjson::Value& json, GetInstalledCertificateIdsConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; @@ -80,7 +80,7 @@ bool GetInstalledCertificateIdsConfConverter::fromJson(const rapidjson::Value& return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetInstalledCertificateIdsConfConverter::toJson(const GetInstalledCertificateIdsConf& data, rapidjson::Document& json) { bool ret = true; diff --git a/src/messages/GetLocalListVersion.cpp b/src/messages/GetLocalListVersion.cpp index 672ed660..9e6c5220 100644 --- a/src/messages/GetLocalListVersion.cpp +++ b/src/messages/GetLocalListVersion.cpp @@ -26,10 +26,10 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetLocalListVersionReqConverter::fromJson(const rapidjson::Value& json, GetLocalListVersionReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -39,7 +39,7 @@ bool GetLocalListVersionReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetLocalListVersionReqConverter::toJson(const GetLocalListVersionReq& data, rapidjson::Document& json) { (void)data; @@ -47,10 +47,10 @@ bool GetLocalListVersionReqConverter::toJson(const GetLocalListVersionReq& data, return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool GetLocalListVersionConfConverter::fromJson(const rapidjson::Value& json, GetLocalListVersionConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -59,7 +59,7 @@ bool GetLocalListVersionConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetLocalListVersionConfConverter::toJson(const GetLocalListVersionConf& data, rapidjson::Document& json) { fill(json, "listVersion", data.listVersion); diff --git a/src/messages/GetLog.cpp b/src/messages/GetLog.cpp index 4fb3eddf..1eba41b3 100644 --- a/src/messages/GetLog.cpp +++ b/src/messages/GetLog.cpp @@ -39,8 +39,8 @@ const EnumToStringFromString LogStatusEnumTypeHelper = {{LogS namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ -bool GetLogReqConverter::fromJson(const rapidjson::Value& json, GetLogReq& data, const char*& error_code, std::string& error_message) +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ +bool GetLogReqConverter::fromJson(const rapidjson::Value& json, GetLogReq& data, std::string& error_code, std::string& error_message) { bool ret; data.logType = LogEnumTypeHelper.fromString(json["logType"].GetString()); @@ -61,7 +61,7 @@ bool GetLogReqConverter::fromJson(const rapidjson::Value& json, GetLogReq& data, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetLogReqConverter::toJson(const GetLogReq& data, rapidjson::Document& json) { fill(json, "logType", LogEnumTypeHelper.toString(data.logType)); @@ -78,8 +78,8 @@ bool GetLogReqConverter::toJson(const GetLogReq& data, rapidjson::Document& json return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ -bool GetLogConfConverter::fromJson(const rapidjson::Value& json, GetLogConf& data, const char*& error_code, std::string& error_message) +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ +bool GetLogConfConverter::fromJson(const rapidjson::Value& json, GetLogConf& data, std::string& error_code, std::string& error_message) { (void)error_code; (void)error_message; @@ -88,7 +88,7 @@ bool GetLogConfConverter::fromJson(const rapidjson::Value& json, GetLogConf& dat return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool GetLogConfConverter::toJson(const GetLogConf& data, rapidjson::Document& json) { fill(json, "status", LogStatusEnumTypeHelper.toString(data.status)); diff --git a/src/messages/Heartbeat.cpp b/src/messages/Heartbeat.cpp index 1d105457..a612af28 100644 --- a/src/messages/Heartbeat.cpp +++ b/src/messages/Heartbeat.cpp @@ -26,8 +26,8 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ -bool HeartbeatReqConverter::fromJson(const rapidjson::Value& json, HeartbeatReq& data, const char*& error_code, std::string& error_message) +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ +bool HeartbeatReqConverter::fromJson(const rapidjson::Value& json, HeartbeatReq& data, std::string& error_code, std::string& error_message) { (void)json; (void)data; @@ -36,7 +36,7 @@ bool HeartbeatReqConverter::fromJson(const rapidjson::Value& json, HeartbeatReq& return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool HeartbeatReqConverter::toJson(const HeartbeatReq& data, rapidjson::Document& json) { (void)data; @@ -44,10 +44,10 @@ bool HeartbeatReqConverter::toJson(const HeartbeatReq& data, rapidjson::Document return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool HeartbeatConfConverter::fromJson(const rapidjson::Value& json, HeartbeatConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "currentTime", data.currentTime, error_message); @@ -58,7 +58,7 @@ bool HeartbeatConfConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool HeartbeatConfConverter::toJson(const HeartbeatConf& data, rapidjson::Document& json) { fill(json, "currentTime", data.currentTime.str()); diff --git a/src/messages/IMessageConverter.h b/src/messages/IMessageConverter.h index 60cc9538..d7d1bf05 100644 --- a/src/messages/IMessageConverter.h +++ b/src/messages/IMessageConverter.h @@ -45,7 +45,7 @@ class IMessageConverter * @param error_message Error message in case of invalid input * @return true the object has been converted, false otherwise */ - virtual bool fromJson(const rapidjson::Value& json, DataType& data, const char*& error_code, std::string& error_message) = 0; + virtual bool fromJson(const rapidjson::Value& json, DataType& data, std::string& error_code, std::string& error_message) = 0; /** * @brief Convert a C++ data type to a JSON object @@ -273,7 +273,7 @@ class IMessageConverter class MessageType##ReqConverter : public IMessageConverter \ { \ public: \ - bool fromJson(const rapidjson::Value& json, MessageType##Req& data, const char*& error_code, std::string& error_message) override; \ + bool fromJson(const rapidjson::Value& json, MessageType##Req& data, std::string& error_code, std::string& error_message) override; \ bool toJson(const MessageType##Req& data, rapidjson::Document& json) override; \ }; \ class MessageType##ConfConverter : public IMessageConverter \ @@ -281,7 +281,7 @@ class IMessageConverter public: \ bool fromJson(const rapidjson::Value& json, \ MessageType##Conf& data, \ - const char*& error_code, \ + std::string& error_code, \ std::string& error_message) override; \ bool toJson(const MessageType##Conf& data, rapidjson::Document& json) override; \ }; diff --git a/src/messages/IMessageDispatcher.h b/src/messages/IMessageDispatcher.h index 4620b788..adf89a6b 100644 --- a/src/messages/IMessageDispatcher.h +++ b/src/messages/IMessageDispatcher.h @@ -52,14 +52,14 @@ class IMessageDispatcher * @param action Action * @param payload JSON payload for the action * @param response JSON response to send - * @param error_code Standard error code, set to nullptr if no error + * @param error_code Standard error code, empty if no error * @param error_msg Additionnal error message, empty if no error * @return true if the call is accepted, false otherwise */ virtual bool dispatchMessage(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) = 0; /** @brief Interface for messages handlers implementations */ @@ -74,14 +74,14 @@ class IMessageDispatcher * @param action Action * @param payload JSON payload for the action * @param response JSON response to send - * @param error_code Standard error code, set to nullptr if no error + * @param error_code Standard error code, empty if no error * @param error_msg Additionnal error message, empty if no error * @return true if the call is accepted, false otherwise */ virtual bool handle(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) = 0; }; }; diff --git a/src/messages/InstallCertificate.cpp b/src/messages/InstallCertificate.cpp index 0bc6f2d3..cfcb5ec8 100644 --- a/src/messages/InstallCertificate.cpp +++ b/src/messages/InstallCertificate.cpp @@ -36,10 +36,10 @@ const EnumToStringFromString CertificateStatusEnumTyp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool InstallCertificateReqConverter::fromJson(const rapidjson::Value& json, InstallCertificateReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -49,7 +49,7 @@ bool InstallCertificateReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool InstallCertificateReqConverter::toJson(const InstallCertificateReq& data, rapidjson::Document& json) { fill(json, "certificateType", CertificateUseEnumTypeHelper.toString(data.certificateType)); @@ -57,10 +57,10 @@ bool InstallCertificateReqConverter::toJson(const InstallCertificateReq& data, r return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool InstallCertificateConfConverter::fromJson(const rapidjson::Value& json, InstallCertificateConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -69,7 +69,7 @@ bool InstallCertificateConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool InstallCertificateConfConverter::toJson(const InstallCertificateConf& data, rapidjson::Document& json) { fill(json, "status", CertificateStatusEnumTypeHelper.toString(data.status)); diff --git a/src/messages/LogStatusNotification.cpp b/src/messages/LogStatusNotification.cpp index c4381a83..e16ba034 100644 --- a/src/messages/LogStatusNotification.cpp +++ b/src/messages/LogStatusNotification.cpp @@ -40,10 +40,10 @@ const EnumToStringFromString UploadLogStatusEnumTypeHel namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool LogStatusNotificationReqConverter::fromJson(const rapidjson::Value& json, LogStatusNotificationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -53,7 +53,7 @@ bool LogStatusNotificationReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool LogStatusNotificationReqConverter::toJson(const LogStatusNotificationReq& data, rapidjson::Document& json) { fill(json, "status", UploadLogStatusEnumTypeHelper.toString(data.status)); @@ -61,10 +61,10 @@ bool LogStatusNotificationReqConverter::toJson(const LogStatusNotificationReq& d return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool LogStatusNotificationConfConverter::fromJson(const rapidjson::Value& json, LogStatusNotificationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -74,7 +74,7 @@ bool LogStatusNotificationConfConverter::fromJson(const rapidjson::Value& jso return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool LogStatusNotificationConfConverter::toJson(const LogStatusNotificationConf& data, rapidjson::Document& json) { (void)json; diff --git a/src/messages/MessageDispatcher.cpp b/src/messages/MessageDispatcher.cpp index fddf1779..a98a3641 100644 --- a/src/messages/MessageDispatcher.cpp +++ b/src/messages/MessageDispatcher.cpp @@ -69,12 +69,12 @@ bool MessageDispatcher::registerHandler(const std::string& action, IMessageHandl /** @copydoc bool IMessageDispatcher::dispatchMessage(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool MessageDispatcher::dispatchMessage(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; @@ -84,8 +84,8 @@ bool MessageDispatcher::dispatchMessage(const std::string& action, if (it != m_handlers.end()) { // Check payload - auto& handler_data = it->second; - ocpp::json::JsonValidator* validator = handler_data.first; + auto& handler_data = it->second; + ocpp::json::JsonValidator* validator = handler_data.first; if (validator && validator->isValid(payload)) { // Call handler diff --git a/src/messages/MessageDispatcher.h b/src/messages/MessageDispatcher.h index ec5f105a..950a3359 100644 --- a/src/messages/MessageDispatcher.h +++ b/src/messages/MessageDispatcher.h @@ -53,12 +53,12 @@ class MessageDispatcher : public IMessageDispatcher /** @copydoc bool IMessageDispatcher::dispatchMessage(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool dispatchMessage(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; private: diff --git a/src/messages/MeterValues.cpp b/src/messages/MeterValues.cpp index 43044143..0fdd4fbb 100644 --- a/src/messages/MeterValues.cpp +++ b/src/messages/MeterValues.cpp @@ -96,10 +96,10 @@ const EnumToStringFromString UnitOfMeasureHelper = {{UnitOfMeasur namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool MeterValuesReqConverter::fromJson(const rapidjson::Value& json, MeterValuesReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "connectorId", data.connectorId, error_message); @@ -116,7 +116,7 @@ bool MeterValuesReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool MeterValuesReqConverter::toJson(const MeterValuesReq& data, rapidjson::Document& json) { bool ret = true; @@ -139,10 +139,10 @@ bool MeterValuesReqConverter::toJson(const MeterValuesReq& data, rapidjson::Docu return ret; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool MeterValuesConfConverter::fromJson(const rapidjson::Value& json, MeterValuesConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -152,7 +152,7 @@ bool MeterValuesConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool MeterValuesConfConverter::toJson(const MeterValuesConf& data, rapidjson::Document& json) { (void)data; diff --git a/src/messages/RemoteStartTransaction.cpp b/src/messages/RemoteStartTransaction.cpp index cce92f27..c02f55ac 100644 --- a/src/messages/RemoteStartTransaction.cpp +++ b/src/messages/RemoteStartTransaction.cpp @@ -35,10 +35,10 @@ const EnumToStringFromString RemoteStartStopStatusHelper namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool RemoteStartTransactionReqConverter::fromJson(const rapidjson::Value& json, RemoteStartTransactionReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "connectorId", data.connectorId, error_message); @@ -59,7 +59,7 @@ bool RemoteStartTransactionReqConverter::fromJson(const rapidjson::Value& jso return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool RemoteStartTransactionReqConverter::toJson(const RemoteStartTransactionReq& data, rapidjson::Document& json) { bool ret = true; @@ -80,10 +80,10 @@ bool RemoteStartTransactionReqConverter::toJson(const RemoteStartTransactionReq& return ret; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool RemoteStartTransactionConfConverter::fromJson(const rapidjson::Value& json, RemoteStartTransactionConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -92,7 +92,7 @@ bool RemoteStartTransactionConfConverter::fromJson(const rapidjson::Value& j return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool RemoteStartTransactionConfConverter::toJson(const RemoteStartTransactionConf& data, rapidjson::Document& json) { fill(json, "status", RemoteStartStopStatusHelper.toString(data.status)); diff --git a/src/messages/RemoteStopTransaction.cpp b/src/messages/RemoteStopTransaction.cpp index e3a6131a..81367829 100644 --- a/src/messages/RemoteStopTransaction.cpp +++ b/src/messages/RemoteStopTransaction.cpp @@ -26,10 +26,10 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool RemoteStopTransactionReqConverter::fromJson(const rapidjson::Value& json, RemoteStopTransactionReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -38,17 +38,17 @@ bool RemoteStopTransactionReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool RemoteStopTransactionReqConverter::toJson(const RemoteStopTransactionReq& data, rapidjson::Document& json) { fill(json, "transactionId", data.transactionId); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool RemoteStopTransactionConfConverter::fromJson(const rapidjson::Value& json, RemoteStopTransactionConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -57,7 +57,7 @@ bool RemoteStopTransactionConfConverter::fromJson(const rapidjson::Value& jso return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool RemoteStopTransactionConfConverter::toJson(const RemoteStopTransactionConf& data, rapidjson::Document& json) { fill(json, "status", RemoteStartStopStatusHelper.toString(data.status)); diff --git a/src/messages/ReserveNow.cpp b/src/messages/ReserveNow.cpp index 695e6fa2..ba4e61b7 100644 --- a/src/messages/ReserveNow.cpp +++ b/src/messages/ReserveNow.cpp @@ -36,10 +36,10 @@ const EnumToStringFromString ReservationStatusHelper = {{Rese namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ReserveNowReqConverter::fromJson(const rapidjson::Value& json, ReserveNowReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -55,7 +55,7 @@ bool ReserveNowReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ReserveNowReqConverter::toJson(const ReserveNowReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); @@ -66,10 +66,10 @@ bool ReserveNowReqConverter::toJson(const ReserveNowReq& data, rapidjson::Docume return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool ReserveNowConfConverter::fromJson(const rapidjson::Value& json, ReserveNowConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -78,7 +78,7 @@ bool ReserveNowConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ReserveNowConfConverter::toJson(const ReserveNowConf& data, rapidjson::Document& json) { fill(json, "status", ReservationStatusHelper.toString(data.status)); diff --git a/src/messages/Reset.cpp b/src/messages/Reset.cpp index eeb0fa70..5f2b7bc6 100644 --- a/src/messages/Reset.cpp +++ b/src/messages/Reset.cpp @@ -35,8 +35,8 @@ const EnumToStringFromString ResetStatusHelper = {{ResetStatus::Acc namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ -bool ResetReqConverter::fromJson(const rapidjson::Value& json, ResetReq& data, const char*& error_code, std::string& error_message) +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ +bool ResetReqConverter::fromJson(const rapidjson::Value& json, ResetReq& data, std::string& error_code, std::string& error_message) { (void)error_code; (void)error_message; @@ -44,15 +44,15 @@ bool ResetReqConverter::fromJson(const rapidjson::Value& json, ResetReq& data, c return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ResetReqConverter::toJson(const ResetReq& data, rapidjson::Document& json) { fill(json, "type", ResetTypeHelper.toString(data.type)); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ -bool ResetConfConverter::fromJson(const rapidjson::Value& json, ResetConf& data, const char*& error_code, std::string& error_message) +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ +bool ResetConfConverter::fromJson(const rapidjson::Value& json, ResetConf& data, std::string& error_code, std::string& error_message) { (void)error_code; (void)error_message; @@ -60,7 +60,7 @@ bool ResetConfConverter::fromJson(const rapidjson::Value& json, ResetConf& data, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool ResetConfConverter::toJson(const ResetConf& data, rapidjson::Document& json) { fill(json, "status", ResetStatusHelper.toString(data.status)); diff --git a/src/messages/SecurityEventNotification.cpp b/src/messages/SecurityEventNotification.cpp index a2ec3b76..71963050 100644 --- a/src/messages/SecurityEventNotification.cpp +++ b/src/messages/SecurityEventNotification.cpp @@ -26,10 +26,10 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SecurityEventNotificationReqConverter::fromJson(const rapidjson::Value& json, SecurityEventNotificationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { extract(json, "type", data.type); @@ -42,7 +42,7 @@ bool SecurityEventNotificationReqConverter::fromJson(const rapidjson::Value& return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SecurityEventNotificationReqConverter::toJson(const SecurityEventNotificationReq& data, rapidjson::Document& json) { fill(json, "type", data.type); @@ -51,10 +51,10 @@ bool SecurityEventNotificationReqConverter::toJson(const SecurityEventNotificati return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SecurityEventNotificationConfConverter::fromJson(const rapidjson::Value& json, SecurityEventNotificationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -64,7 +64,7 @@ bool SecurityEventNotificationConfConverter::fromJson(const rapidjson::Value& return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SecurityEventNotificationConfConverter::toJson(const SecurityEventNotificationConf& data, rapidjson::Document& json) { (void)json; diff --git a/src/messages/SendLocalList.cpp b/src/messages/SendLocalList.cpp index f7b330a2..1c13f09c 100644 --- a/src/messages/SendLocalList.cpp +++ b/src/messages/SendLocalList.cpp @@ -38,10 +38,10 @@ const EnumToStringFromString UpdateStatusHelper = {{UpdateStatus:: namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SendLocalListReqConverter::fromJson(const rapidjson::Value& json, SendLocalListReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; @@ -63,7 +63,7 @@ bool SendLocalListReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SendLocalListReqConverter::toJson(const SendLocalListReq& data, rapidjson::Document& json) { bool ret = true; @@ -86,10 +86,10 @@ bool SendLocalListReqConverter::toJson(const SendLocalListReq& data, rapidjson:: return ret; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SendLocalListConfConverter::fromJson(const rapidjson::Value& json, SendLocalListConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -98,7 +98,7 @@ bool SendLocalListConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SendLocalListConfConverter::toJson(const SendLocalListConf& data, rapidjson::Document& json) { fill(json, "status", UpdateStatusHelper.toString(data.status)); diff --git a/src/messages/SetChargingProfile.cpp b/src/messages/SetChargingProfile.cpp index 2eaeba14..84e42e8b 100644 --- a/src/messages/SetChargingProfile.cpp +++ b/src/messages/SetChargingProfile.cpp @@ -49,10 +49,10 @@ const EnumToStringFromString ChargingRateUnitTypeHelper = namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SetChargingProfileReqConverter::fromJson(const rapidjson::Value& json, SetChargingProfileReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "connectorId", data.connectorId, error_message); @@ -68,7 +68,7 @@ bool SetChargingProfileReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SetChargingProfileReqConverter::toJson(const SetChargingProfileReq& data, rapidjson::Document& json) { (void)data; @@ -88,10 +88,10 @@ bool SetChargingProfileReqConverter::toJson(const SetChargingProfileReq& data, r return ret; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SetChargingProfileConfConverter::fromJson(const rapidjson::Value& json, SetChargingProfileConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -101,7 +101,7 @@ bool SetChargingProfileConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SetChargingProfileConfConverter::toJson(const SetChargingProfileConf& data, rapidjson::Document& json) { fill(json, "status", ChargingProfileStatusHelper.toString(data.status)); diff --git a/src/messages/SignCertificate.cpp b/src/messages/SignCertificate.cpp index 6959be66..87785e50 100644 --- a/src/messages/SignCertificate.cpp +++ b/src/messages/SignCertificate.cpp @@ -34,10 +34,10 @@ const EnumToStringFromString GenericStatusEnumTypeHelper namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SignCertificateReqConverter::fromJson(const rapidjson::Value& json, SignCertificateReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -46,17 +46,17 @@ bool SignCertificateReqConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SignCertificateReqConverter::toJson(const SignCertificateReq& data, rapidjson::Document& json) { fill(json, "csr", data.csr); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SignCertificateConfConverter::fromJson(const rapidjson::Value& json, SignCertificateConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -65,7 +65,7 @@ bool SignCertificateConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SignCertificateConfConverter::toJson(const SignCertificateConf& data, rapidjson::Document& json) { fill(json, "status", GenericStatusEnumTypeHelper.toString(data.status)); diff --git a/src/messages/SignedFirmwareStatusNotification.cpp b/src/messages/SignedFirmwareStatusNotification.cpp index 49ef3489..1a370360 100644 --- a/src/messages/SignedFirmwareStatusNotification.cpp +++ b/src/messages/SignedFirmwareStatusNotification.cpp @@ -47,10 +47,10 @@ const EnumToStringFromString FirmwareStatusEnumTypeHelpe namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SignedFirmwareStatusNotificationReqConverter::fromJson(const rapidjson::Value& json, SignedFirmwareStatusNotificationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -60,7 +60,7 @@ bool SignedFirmwareStatusNotificationReqConverter::fromJson(const rapidjson::Val return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SignedFirmwareStatusNotificationReqConverter::toJson(const SignedFirmwareStatusNotificationReq& data, rapidjson::Document& json) { fill(json, "status", FirmwareStatusEnumTypeHelper.toString(data.status)); @@ -68,10 +68,10 @@ bool SignedFirmwareStatusNotificationReqConverter::toJson(const SignedFirmwareSt return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SignedFirmwareStatusNotificationConfConverter::fromJson(const rapidjson::Value& json, SignedFirmwareStatusNotificationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -81,7 +81,7 @@ bool SignedFirmwareStatusNotificationConfConverter::fromJson(const rapidjson::Va return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SignedFirmwareStatusNotificationConfConverter::toJson(const SignedFirmwareStatusNotificationConf& data, rapidjson::Document& json) { (void)json; diff --git a/src/messages/SignedUpdateFirmware.cpp b/src/messages/SignedUpdateFirmware.cpp index 416ed1d7..bcb86058 100644 --- a/src/messages/SignedUpdateFirmware.cpp +++ b/src/messages/SignedUpdateFirmware.cpp @@ -39,10 +39,10 @@ const EnumToStringFromString UpdateFirmwareStatusE namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SignedUpdateFirmwareReqConverter::fromJson(const rapidjson::Value& json, SignedUpdateFirmwareReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -65,7 +65,7 @@ bool SignedUpdateFirmwareReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SignedUpdateFirmwareReqConverter::toJson(const SignedUpdateFirmwareReq& data, rapidjson::Document& json) { fill(json, "requestId", data.requestId); @@ -83,10 +83,10 @@ bool SignedUpdateFirmwareReqConverter::toJson(const SignedUpdateFirmwareReq& dat return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool SignedUpdateFirmwareConfConverter::fromJson(const rapidjson::Value& json, SignedUpdateFirmwareConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -95,7 +95,7 @@ bool SignedUpdateFirmwareConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool SignedUpdateFirmwareConfConverter::toJson(const SignedUpdateFirmwareConf& data, rapidjson::Document& json) { fill(json, "status", UpdateFirmwareStatusEnumTypeHelper.toString(data.status)); diff --git a/src/messages/StartTransaction.cpp b/src/messages/StartTransaction.cpp index 4df49856..6af85035 100644 --- a/src/messages/StartTransaction.cpp +++ b/src/messages/StartTransaction.cpp @@ -27,10 +27,10 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool StartTransactionReqConverter::fromJson(const rapidjson::Value& json, StartTransactionReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "connectorId", data.connectorId, error_message); @@ -49,7 +49,7 @@ bool StartTransactionReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool StartTransactionReqConverter::toJson(const StartTransactionReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); @@ -60,10 +60,10 @@ bool StartTransactionReqConverter::toJson(const StartTransactionReq& data, rapid return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool StartTransactionConfConverter::fromJson(const rapidjson::Value& json, StartTransactionConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { IdTagInfoConverter id_tag_info_converter; @@ -76,7 +76,7 @@ bool StartTransactionConfConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool StartTransactionConfConverter::toJson(const StartTransactionConf& data, rapidjson::Document& json) { IdTagInfoConverter id_tag_info_converter; diff --git a/src/messages/StatusNotification.cpp b/src/messages/StatusNotification.cpp index 68315881..71c8099f 100644 --- a/src/messages/StatusNotification.cpp +++ b/src/messages/StatusNotification.cpp @@ -59,10 +59,10 @@ const EnumToStringFromString ChargePointStatusHelper = {{Char namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool StatusNotificationReqConverter::fromJson(const rapidjson::Value& json, StatusNotificationReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -80,7 +80,7 @@ bool StatusNotificationReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool StatusNotificationReqConverter::toJson(const StatusNotificationReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); @@ -96,10 +96,10 @@ bool StatusNotificationReqConverter::toJson(const StatusNotificationReq& data, r return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool StatusNotificationConfConverter::fromJson(const rapidjson::Value& json, StatusNotificationConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -109,7 +109,7 @@ bool StatusNotificationConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool StatusNotificationConfConverter::toJson(const StatusNotificationConf& data, rapidjson::Document& json) { (void)data; diff --git a/src/messages/StopTransaction.cpp b/src/messages/StopTransaction.cpp index fb6641fb..0daf9ec4 100644 --- a/src/messages/StopTransaction.cpp +++ b/src/messages/StopTransaction.cpp @@ -47,10 +47,10 @@ const EnumToStringFromString ReasonHelper = {{Reason::DeAuthorized, "DeA namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool StopTransactionReqConverter::fromJson(const rapidjson::Value& json, StopTransactionReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { extract(json, "idTag", data.idTag); @@ -76,7 +76,7 @@ bool StopTransactionReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool StopTransactionReqConverter::toJson(const StopTransactionReq& data, rapidjson::Document& json) { bool ret = true; @@ -102,10 +102,10 @@ bool StopTransactionReqConverter::toJson(const StopTransactionReq& data, rapidjs return ret; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool StopTransactionConfConverter::fromJson(const rapidjson::Value& json, StopTransactionConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; @@ -117,7 +117,7 @@ bool StopTransactionConfConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool StopTransactionConfConverter::toJson(const StopTransactionConf& data, rapidjson::Document& json) { bool ret = true; diff --git a/src/messages/TriggerMessage.cpp b/src/messages/TriggerMessage.cpp index 9f633357..d33dfb13 100644 --- a/src/messages/TriggerMessage.cpp +++ b/src/messages/TriggerMessage.cpp @@ -43,10 +43,10 @@ const EnumToStringFromString TriggerMessageStatusHelper = namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool TriggerMessageReqConverter::fromJson(const rapidjson::Value& json, TriggerMessageReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -59,7 +59,7 @@ bool TriggerMessageReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool TriggerMessageReqConverter::toJson(const TriggerMessageReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); @@ -67,10 +67,10 @@ bool TriggerMessageReqConverter::toJson(const TriggerMessageReq& data, rapidjson return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool TriggerMessageConfConverter::fromJson(const rapidjson::Value& json, TriggerMessageConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -79,7 +79,7 @@ bool TriggerMessageConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool TriggerMessageConfConverter::toJson(const TriggerMessageConf& data, rapidjson::Document& json) { fill(json, "status", TriggerMessageStatusHelper.toString(data.status)); diff --git a/src/messages/UnlockConnector.cpp b/src/messages/UnlockConnector.cpp index 91eb5acc..eb4f4c21 100644 --- a/src/messages/UnlockConnector.cpp +++ b/src/messages/UnlockConnector.cpp @@ -36,10 +36,10 @@ const EnumToStringFromString UnlockStatusHelper = { namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool UnlockConnectorReqConverter::fromJson(const rapidjson::Value& json, UnlockConnectorReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "connectorId", data.connectorId, error_message); @@ -51,17 +51,17 @@ bool UnlockConnectorReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool UnlockConnectorReqConverter::toJson(const UnlockConnectorReq& data, rapidjson::Document& json) { fill(json, "connectorId", data.connectorId); return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool UnlockConnectorConfConverter::fromJson(const rapidjson::Value& json, UnlockConnectorConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; @@ -70,7 +70,7 @@ bool UnlockConnectorConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool UnlockConnectorConfConverter::toJson(const UnlockConnectorConf& data, rapidjson::Document& json) { fill(json, "status", UnlockStatusHelper.toString(data.status)); diff --git a/src/messages/UpdateFirmware.cpp b/src/messages/UpdateFirmware.cpp index 7e083ac4..e030dd86 100644 --- a/src/messages/UpdateFirmware.cpp +++ b/src/messages/UpdateFirmware.cpp @@ -27,10 +27,10 @@ namespace ocpp namespace messages { -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool UpdateFirmwareReqConverter::fromJson(const rapidjson::Value& json, UpdateFirmwareReq& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; @@ -47,7 +47,7 @@ bool UpdateFirmwareReqConverter::fromJson(const rapidjson::Value& json, return ret; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool UpdateFirmwareReqConverter::toJson(const UpdateFirmwareReq& data, rapidjson::Document& json) { fill(json, "location", data.location); @@ -57,10 +57,10 @@ bool UpdateFirmwareReqConverter::toJson(const UpdateFirmwareReq& data, rapidjson return true; } -/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, DataType&, std::string&, std::string&) */ bool UpdateFirmwareConfConverter::fromJson(const rapidjson::Value& json, UpdateFirmwareConf& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)json; @@ -70,7 +70,7 @@ bool UpdateFirmwareConfConverter::fromJson(const rapidjson::Value& json, return true; } -/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, const char*&, std::string&) */ +/** @copydoc bool IMessageConverter::toJson(DataType&, rapidjson::Document&, std::string&, std::string&) */ bool UpdateFirmwareConfConverter::toJson(const UpdateFirmwareConf& data, rapidjson::Document& json) { (void)json; diff --git a/src/messages/types/AuthorizationDataConverter.cpp b/src/messages/types/AuthorizationDataConverter.cpp index 31a52dae..81bfa340 100644 --- a/src/messages/types/AuthorizationDataConverter.cpp +++ b/src/messages/types/AuthorizationDataConverter.cpp @@ -30,11 +30,11 @@ namespace messages /** @bcopydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::AuthorizationData&, - * const char*&, + * std::string&, * std::string&) */ bool AuthorizationDataConverter::fromJson(const rapidjson::Value& json, ocpp::types::AuthorizationData& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = true; diff --git a/src/messages/types/AuthorizationDataConverter.h b/src/messages/types/AuthorizationDataConverter.h index 73620f9b..9bf69994 100644 --- a/src/messages/types/AuthorizationDataConverter.h +++ b/src/messages/types/AuthorizationDataConverter.h @@ -33,11 +33,11 @@ class AuthorizationDataConverter : public IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::AuthorizationData&, - * const char*&, + * std::string&, * std::string&) */ bool fromJson(const rapidjson::Value& json, ocpp::types::AuthorizationData& data, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool IMessageConverter::toJson(const ocpp::types::AuthorizationData&, diff --git a/src/messages/types/CertificateHashDataTypeConverter.cpp b/src/messages/types/CertificateHashDataTypeConverter.cpp index cd888e6b..c7560e7d 100644 --- a/src/messages/types/CertificateHashDataTypeConverter.cpp +++ b/src/messages/types/CertificateHashDataTypeConverter.cpp @@ -36,11 +36,11 @@ namespace messages /** @bcopydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::CertificateHashDataType&, - * const char*&, + * std::string&, * std::string&) */ bool CertificateHashDataTypeConverter::fromJson(const rapidjson::Value& json, ocpp::types::CertificateHashDataType& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { (void)error_code; diff --git a/src/messages/types/CertificateHashDataTypeConverter.h b/src/messages/types/CertificateHashDataTypeConverter.h index ecf7e0c7..a764f26a 100644 --- a/src/messages/types/CertificateHashDataTypeConverter.h +++ b/src/messages/types/CertificateHashDataTypeConverter.h @@ -33,11 +33,11 @@ class CertificateHashDataTypeConverter : public IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::CertificateHashDataType&, - * const char*&, + * std::string&, * std::string&) */ bool fromJson(const rapidjson::Value& json, ocpp::types::CertificateHashDataType& data, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool IMessageConverter::toJson(const ocpp::types::CertificateHashDataType&, diff --git a/src/messages/types/ChargingProfileConverter.cpp b/src/messages/types/ChargingProfileConverter.cpp index a15fbfa4..84ce920a 100644 --- a/src/messages/types/ChargingProfileConverter.cpp +++ b/src/messages/types/ChargingProfileConverter.cpp @@ -30,11 +30,11 @@ namespace messages /** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::ChargingProfile&, - * const char*&, + * std::string&, * std::string&) */ bool ChargingProfileConverter::fromJson(const rapidjson::Value& json, ocpp::types::ChargingProfile& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; diff --git a/src/messages/types/ChargingProfileConverter.h b/src/messages/types/ChargingProfileConverter.h index 243ce658..cc885b43 100644 --- a/src/messages/types/ChargingProfileConverter.h +++ b/src/messages/types/ChargingProfileConverter.h @@ -33,11 +33,11 @@ class ChargingProfileConverter : public IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::ChargingProfile&, - * const char*&, + * std::string&, * std::string&) */ bool fromJson(const rapidjson::Value& json, ocpp::types::ChargingProfile& data, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool IMessageConverter::toJson(const ocpp::types::ChargingProfile&, diff --git a/src/messages/types/ChargingScheduleConverter.cpp b/src/messages/types/ChargingScheduleConverter.cpp index dbc15402..21454154 100644 --- a/src/messages/types/ChargingScheduleConverter.cpp +++ b/src/messages/types/ChargingScheduleConverter.cpp @@ -29,11 +29,11 @@ namespace messages /** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::ChargingSchedule&, - * const char*&, + * std::string&, * std::string&) */ bool ChargingScheduleConverter::fromJson(const rapidjson::Value& json, ocpp::types::ChargingSchedule& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "startSchedule", data.startSchedule, error_message); diff --git a/src/messages/types/ChargingScheduleConverter.h b/src/messages/types/ChargingScheduleConverter.h index 96a944ee..5589d3c7 100644 --- a/src/messages/types/ChargingScheduleConverter.h +++ b/src/messages/types/ChargingScheduleConverter.h @@ -33,11 +33,11 @@ class ChargingScheduleConverter : public IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::ChargingSchedule&, - * const char*&, + * std::string&, * std::string&) */ bool fromJson(const rapidjson::Value& json, ocpp::types::ChargingSchedule& data, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool IMessageConverter::toJson(const ocpp::types::ChargingSchedule&, diff --git a/src/messages/types/IdTagInfoConverter.cpp b/src/messages/types/IdTagInfoConverter.cpp index dd1d7f96..7dfd7585 100644 --- a/src/messages/types/IdTagInfoConverter.cpp +++ b/src/messages/types/IdTagInfoConverter.cpp @@ -29,11 +29,11 @@ namespace messages /** @bcopydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::IdTagInfo&, - * const char*&, + * std::string&, * std::string&) */ bool IdTagInfoConverter::fromJson(const rapidjson::Value& json, ocpp::types::IdTagInfo& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret; diff --git a/src/messages/types/IdTagInfoConverter.h b/src/messages/types/IdTagInfoConverter.h index 06b5e370..4129c681 100644 --- a/src/messages/types/IdTagInfoConverter.h +++ b/src/messages/types/IdTagInfoConverter.h @@ -33,9 +33,9 @@ class IdTagInfoConverter : public IMessageConverter public: /** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::IdTagInfo&, - * const char*&, + * std::string&, * std::string&) */ - bool fromJson(const rapidjson::Value& json, ocpp::types::IdTagInfo& data, const char*& error_code, std::string& error_message) override; + bool fromJson(const rapidjson::Value& json, ocpp::types::IdTagInfo& data, std::string& error_code, std::string& error_message) override; /** @copydoc bool IMessageConverter::toJson(const ocpp::types::IdTagInfo&, * rapidjson::Document&) */ diff --git a/src/messages/types/MeterValueConverter.cpp b/src/messages/types/MeterValueConverter.cpp index 62bcd39e..4bcb9df8 100644 --- a/src/messages/types/MeterValueConverter.cpp +++ b/src/messages/types/MeterValueConverter.cpp @@ -28,11 +28,11 @@ namespace messages /** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::MeterValue&, - * const char*&, + * std::string&, * std::string&) */ bool MeterValueConverter::fromJson(const rapidjson::Value& json, ocpp::types::MeterValue& data, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = extract(json, "timestamp", data.timestamp, error_message); diff --git a/src/messages/types/MeterValueConverter.h b/src/messages/types/MeterValueConverter.h index fbddcf5d..4f7708ca 100644 --- a/src/messages/types/MeterValueConverter.h +++ b/src/messages/types/MeterValueConverter.h @@ -33,11 +33,11 @@ class MeterValueConverter : public IMessageConverter public: /** @copydoc bool IMessageConverter::fromJson(const rapidjson::Value&, * ocpp::types::MeterValue&, - * const char*&, + * std::string&, * std::string&) */ bool fromJson(const rapidjson::Value& json, ocpp::types::MeterValue& data, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @copydoc bool IMessageConverter::toJson(const ocpp::types::MeterValue&, diff --git a/src/rpc/IRpc.h b/src/rpc/IRpc.h index f97bc91d..b6c3749f 100644 --- a/src/rpc/IRpc.h +++ b/src/rpc/IRpc.h @@ -95,14 +95,14 @@ class IRpc * @param action Action * @param payload JSON payload for the action * @param response JSON response to send - * @param error_code Standard error code, set to nullptr if no error + * @param error_code Standard error code, empty if no error * @param error_msg Additionnal error message, empty if no error * @return true if the call is accepted, false otherwise */ virtual bool rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) = 0; }; diff --git a/src/rpc/RpcBase.cpp b/src/rpc/RpcBase.cpp index a54f5962..9adf8bb2 100644 --- a/src/rpc/RpcBase.cpp +++ b/src/rpc/RpcBase.cpp @@ -386,7 +386,7 @@ void RpcBase::rxThread() // Notify call rapidjson::Document response; std::string error; - const char* error_code = nullptr; + std::string error_code; response.Parse("{}"); if (m_rpc_listener->rpcCallReceived(rpc_message->action, rpc_message->payload, response, error_code, error)) { @@ -409,11 +409,11 @@ void RpcBase::rxThread() else { // Error - if (!error_code) + if (error_code.empty()) { error_code = RPC_ERROR_GENERIC; } - sendCallError(rpc_message->unique_id, error_code, error); + sendCallError(rpc_message->unique_id, error_code.c_str(), error); } // Free resources diff --git a/tests/chargepoint/authent/test_authent.cpp b/tests/chargepoint/authent/test_authent.cpp index 37437d5b..461b6952 100644 --- a/tests/chargepoint/authent/test_authent.cpp +++ b/tests/chargepoint/authent/test_authent.cpp @@ -111,12 +111,12 @@ TEST_SUITE("Authentication component") auth_data.idTagInfo.value().status = AuthorizationStatus::Blocked; send_req.localAuthorizationList.push_back(auth_data); SendLocalListConf send_resp; - const char* error_code = nullptr; + std::string error_code; std::string error_message; CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Accepted); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); } diff --git a/tests/chargepoint/authent/test_authent_cache.cpp b/tests/chargepoint/authent/test_authent_cache.cpp index 5723867d..2d223bdf 100644 --- a/tests/chargepoint/authent/test_authent_cache.cpp +++ b/tests/chargepoint/authent/test_authent_cache.cpp @@ -151,16 +151,16 @@ TEST_SUITE("Authentication cache") // Check clear cache request ClearCacheReq clear_req; ClearCacheConf clear_resp; - const char* error_code = nullptr; + std::string error_code; std::string error_message; CHECK(cache.handleMessage(clear_req, clear_resp, error_code, error_message)); CHECK_EQ(clear_resp.status, ClearCacheStatus::Accepted); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(cache.handleMessage(clear_req, clear_resp, error_code, error_message)); CHECK_EQ(clear_resp.status, ClearCacheStatus::Accepted); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK_FALSE(cache.check("TAG1", tag_info_r)); @@ -174,7 +174,7 @@ TEST_SUITE("Authentication cache") CHECK(cache.handleMessage(clear_req, clear_resp, error_code, error_message)); CHECK_EQ(clear_resp.status, ClearCacheStatus::Rejected); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); } diff --git a/tests/chargepoint/authent/test_authent_locallist.cpp b/tests/chargepoint/authent/test_authent_locallist.cpp index d9442800..8dad4f43 100644 --- a/tests/chargepoint/authent/test_authent_locallist.cpp +++ b/tests/chargepoint/authent/test_authent_locallist.cpp @@ -68,11 +68,11 @@ TEST_SUITE("Authentication local list") // Check version GetLocalListVersionReq version_req; GetLocalListVersionConf version_resp; - const char* error_code = nullptr; + std::string error_code; std::string error_message; CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 0); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Check send local list with too much data @@ -101,24 +101,24 @@ TEST_SUITE("Authentication local list") CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Failed); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 0); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Send local list with valid data send_req.localAuthorizationList.pop_back(); CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Accepted); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 1); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Check contents @@ -150,12 +150,12 @@ TEST_SUITE("Authentication local list") CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Accepted); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 2); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK_FALSE(local_list.check("TAG1", tag_info)); @@ -174,12 +174,12 @@ TEST_SUITE("Authentication local list") CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Failed); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 2); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Send a list which is too large @@ -188,12 +188,12 @@ TEST_SUITE("Authentication local list") CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Failed); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 2); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); } @@ -214,11 +214,11 @@ TEST_SUITE("Authentication local list") // Check version GetLocalListVersionReq version_req; GetLocalListVersionConf version_resp; - const char* error_code = nullptr; + std::string error_code; std::string error_message; CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 2); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Check send local list with valid data @@ -244,12 +244,12 @@ TEST_SUITE("Authentication local list") CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Accepted); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 3); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Check contents @@ -291,12 +291,12 @@ TEST_SUITE("Authentication local list") CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::Accepted); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, 4); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Check contents @@ -331,11 +331,11 @@ TEST_SUITE("Authentication local list") // Check version GetLocalListVersionReq version_req; GetLocalListVersionConf version_resp; - const char* error_code = nullptr; + std::string error_code; std::string error_message; CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, -1); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); // Check send local list @@ -350,12 +350,12 @@ TEST_SUITE("Authentication local list") CHECK(local_list.handleMessage(send_req, send_resp, error_code, error_message)); CHECK_EQ(send_resp.status, UpdateStatus::NotSupported); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); CHECK(local_list.handleMessage(version_req, version_resp, error_code, error_message)); CHECK_EQ(version_resp.listVersion, -1); - CHECK_EQ(error_code, nullptr); + CHECK(error_code.empty()); CHECK(error_message.empty()); } diff --git a/tests/chargepoint/metervalues/test_metervalues.cpp b/tests/chargepoint/metervalues/test_metervalues.cpp index 550ca0be..70129570 100644 --- a/tests/chargepoint/metervalues/test_metervalues.cpp +++ b/tests/chargepoint/metervalues/test_metervalues.cpp @@ -64,7 +64,7 @@ ConfigManagerStub config_mgr; static bool deserializeMeterValue(const rapidjson::Document& payload, MeterValuesReq& meter_value) { std::string error_message; - const char* error_code = nullptr; + std::string error_code; MeterValuesReqConverter meter_value_conv; meter_value.meterValue.clear(); return meter_value_conv.fromJson(payload, meter_value, error_code, error_message); diff --git a/tests/rpc/test_rpc.cpp b/tests/rpc/test_rpc.cpp index fac92688..967aeba8 100644 --- a/tests/rpc/test_rpc.cpp +++ b/tests/rpc/test_rpc.cpp @@ -59,12 +59,12 @@ class RpcClientListener : public IRpc::IListener, public RpcClient::IListener /** @copydoc void IRpc::IListener::rpcCallReceived(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool rpcCallReceived(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override { this->action = action; @@ -76,7 +76,10 @@ class RpcClientListener : public IRpc::IListener, public RpcClient::IListener { response.Parse(this->response); } - error_code = this->error_code; + if (this->error_code) + { + error_code = this->error_code; + } if (this->error_message) { error_message = this->error_message; diff --git a/tests/stubs/MessageDispatcherStub.cpp b/tests/stubs/MessageDispatcherStub.cpp index f364ca19..0884fee0 100755 --- a/tests/stubs/MessageDispatcherStub.cpp +++ b/tests/stubs/MessageDispatcherStub.cpp @@ -45,12 +45,12 @@ bool MessageDispatcherStub::registerHandler(const std::string& action, IMessageH /** @copydoc bool IMessageDispatcher::dispatchMessage(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool MessageDispatcherStub::dispatchMessage(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) { bool ret = false; diff --git a/tests/stubs/MessageDispatcherStub.h b/tests/stubs/MessageDispatcherStub.h index 9e45d2e7..50c64b4b 100755 --- a/tests/stubs/MessageDispatcherStub.h +++ b/tests/stubs/MessageDispatcherStub.h @@ -44,12 +44,12 @@ class MessageDispatcherStub : public IMessageDispatcher /** @copydoc bool IMessageDispatcher::dispatchMessage(const std::string&, const rapidjson::Value&, rapidjson::Document&, - const char*&, + std::string&, std::string&) */ bool dispatchMessage(const std::string& action, const rapidjson::Value& payload, rapidjson::Document& response, - const char*& error_code, + std::string& error_code, std::string& error_message) override; /** @brief Check if a specific action as a registered handler */