Skip to content

Commit

Permalink
[ocpp20] Fix clang build
Browse files Browse the repository at this point in the history
  • Loading branch information
c-jimenez committed Oct 23, 2024
1 parent 3759c49 commit 572018c
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 26 deletions.
4 changes: 2 additions & 2 deletions examples/ocpp20/quick_start_chargepoint/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ int main(int argc, char* argv[])
std::string error;
std::string error_msg;

auto last_boot_notif = std::chrono::steady_clock::time_point();
std::chrono::seconds hb_boot_notif_interval = std::chrono::seconds(10);
auto last_boot_notif = std::chrono::steady_clock::time_point();
std::chrono::seconds hb_boot_notif_interval = std::chrono::seconds(10);
RegistrationStatusEnumType registration_status = RegistrationStatusEnumType::Rejected;

unsigned int transaction_id = std::chrono::system_clock::now().time_since_epoch().count();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ namespace ocpp20
/** @brief Constructor */
ChargePointHandler20::ChargePointHandler20(const std::string& identifier,
const ocpp::messages::ocpp20::MessagesConverter20& messages_converter,
ocpp::messages::MessageDispatcher& msg_dispatcher,
const ocpp::config::ICentralSystemConfig20& stack_config)
ocpp::messages::MessageDispatcher& msg_dispatcher)
: GenericMessageHandler<BootNotificationReq, BootNotificationConf>(BOOTNOTIFICATION_ACTION, messages_converter),
GenericMessageHandler<AuthorizeReq, AuthorizeConf>(AUTHORIZE_ACTION, messages_converter),
GenericMessageHandler<ClearedChargingLimitReq, ClearedChargingLimitConf>(CLEAREDCHARGINGLIMIT_ACTION, messages_converter),
Expand Down Expand Up @@ -71,8 +70,6 @@ ChargePointHandler20::ChargePointHandler20(const std::string&
GenericMessageHandler<TransactionEventReq, TransactionEventConf>(TRANSACTIONEVENT_ACTION, messages_converter),

m_identifier(identifier),
m_stack_config(stack_config),
m_messages_converter(messages_converter),
m_handler(nullptr)
{
msg_dispatcher.registerHandler(BOOTNOTIFICATION_ACTION,
Expand Down
8 changes: 1 addition & 7 deletions src/ocpp20/centralsystem/chargepoint/ChargePointHandler20.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,10 @@ class ChargePointHandler20
* @param identifier Charge point's identifier
* @param messages_converter Converter from/to OCPP to/from JSON messages
* @param msg_dispatcher Message dispatcher
* @param stack_config Stack configuration
*/
ChargePointHandler20(const std::string& identifier,
const ocpp::messages::ocpp20::MessagesConverter20& messages_converter,
ocpp::messages::MessageDispatcher& msg_dispatcher,
const ocpp::config::ICentralSystemConfig20& stack_config);
ocpp::messages::MessageDispatcher& msg_dispatcher);
/** @brief Destructor */
virtual ~ChargePointHandler20();

Expand Down Expand Up @@ -352,10 +350,6 @@ class ChargePointHandler20
private:
/** @brief Charge point's identifier */
const std::string m_identifier;
/** @brief Stack configuration */
const ocpp::config::ICentralSystemConfig20& m_stack_config;
/** @brief Messages converters */
const ocpp::messages::GenericMessagesConverter& m_messages_converter;
/** @brief Request handler */
IChargePointRequestHandler20* m_handler;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ChargePointProxy20::ChargePointProxy20(ICentralSystem20&
m_rpc(rpc),
m_msg_dispatcher(messages_validator),
m_msg_sender(*m_rpc, messages_converter, messages_validator, stack_config.callRequestTimeout()),
m_handler(m_identifier, messages_converter, m_msg_dispatcher, stack_config),
m_handler(m_identifier, messages_converter, m_msg_dispatcher),
m_messages_validator(messages_validator),
m_messages_converter(messages_converter)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ namespace {{ocpp_version_namespace}}
/** @brief Constructor */
ChargePointHandler{{ocpp_version_suffix}}::ChargePointHandler{{ocpp_version_suffix}}(const std::string& identifier,
const ocpp::messages::{{ocpp_version_namespace}}::MessagesConverter{{ocpp_version_suffix}}& messages_converter,
ocpp::messages::MessageDispatcher& msg_dispatcher,
const ocpp::config::ICentralSystemConfig{{ocpp_version_suffix}}& stack_config)
ocpp::messages::MessageDispatcher& msg_dispatcher)
:
{%- for msg_name in cs_msgs %}
GenericMessageHandler<{{msg_name}}Req, {{msg_name}}Conf>({{msg_name.upper()}}_ACTION, messages_converter),
{%- endfor %}

m_identifier(identifier),
m_stack_config(stack_config),
m_messages_converter(messages_converter),
m_handler(nullptr)
{
{%- for msg_name in cs_msgs %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ class ChargePointHandler{{ocpp_version_suffix}}
* @param identifier Charge point's identifier
* @param messages_converter Converter from/to OCPP to/from JSON messages
* @param msg_dispatcher Message dispatcher
* @param stack_config Stack configuration
*/
ChargePointHandler{{ocpp_version_suffix}}(const std::string& identifier,
const ocpp::messages::{{ocpp_version_namespace}}::MessagesConverter{{ocpp_version_suffix}}& messages_converter,
ocpp::messages::MessageDispatcher& msg_dispatcher,
const ocpp::config::ICentralSystemConfig20& stack_config);
ocpp::messages::MessageDispatcher& msg_dispatcher);
/** @brief Destructor */
virtual ~ChargePointHandler{{ocpp_version_suffix}}();

Expand All @@ -92,10 +90,6 @@ class ChargePointHandler{{ocpp_version_suffix}}
private:
/** @brief Charge point's identifier */
const std::string m_identifier;
/** @brief Stack configuration */
const ocpp::config::ICentralSystemConfig{{ocpp_version_suffix}}& m_stack_config;
/** @brief Messages converters */
const ocpp::messages::GenericMessagesConverter& m_messages_converter;
/** @brief Request handler */
IChargePointRequestHandler{{ocpp_version_suffix}}* m_handler;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ChargePointProxy{{ocpp_version_suffix}}::ChargePointProxy{{ocpp_version_suffix}}
m_rpc(rpc),
m_msg_dispatcher(messages_validator),
m_msg_sender(*m_rpc, messages_converter, messages_validator, stack_config.callRequestTimeout()),
m_handler(m_identifier, messages_converter, m_msg_dispatcher, stack_config),
m_handler(m_identifier, messages_converter, m_msg_dispatcher),
m_messages_validator(messages_validator),
m_messages_converter(messages_converter)
{
Expand Down

0 comments on commit 572018c

Please sign in to comment.