Skip to content

Commit ffbcce1

Browse files
committed
Review comments / formatting.
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
1 parent 9f6d312 commit ffbcce1

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

include/ocpp/v201/ctrlr_component_variables.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace v201 {
1515
///
1616
struct RequiredComponentVariable : ComponentVariable {
1717
/// \brief Constructor
18-
RequiredComponentVariable() : required_for({OcppProtocolVersion::v201, OcppProtocolVersion::v21}) {};
18+
RequiredComponentVariable() : required_for({OcppProtocolVersion::v201, OcppProtocolVersion::v21}){};
1919

2020
///
2121
/// \brief RequiredComponentVariable
@@ -27,7 +27,7 @@ struct RequiredComponentVariable : ComponentVariable {
2727
RequiredComponentVariable(const Component component, const std::optional<Variable> variable,
2828
const std::optional<CustomData> custom_data = std::nullopt,
2929
const std::set<OcppProtocolVersion>& required_for = {OcppProtocolVersion::v201,
30-
OcppProtocolVersion::v21}) :
30+
OcppProtocolVersion::v21}) :
3131
ComponentVariable(), required_for(required_for) {
3232
this->component = component;
3333
this->variable = variable;

lib/ocpp/v201/charge_point.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,10 @@ void ChargePoint::message_callback(const std::string& message) {
806806
EVLOG_error << "Exception during handling of message: " << e.what();
807807
auto call_error = CallError(enhanced_message.uniqueId, "FormationViolation", e.what(), json({}));
808808
this->message_dispatcher->dispatch_call_error(call_error);
809+
} catch (const DeviceModelError& e) {
810+
EVLOG_error << "DeviceModelError during handling of message: " << e.what();
811+
auto call_error = CallError(enhanced_message.uniqueId, "GenericError", e.what(), json({}));
812+
this->message_dispatcher->dispatch_call_error(call_error);
809813
} catch (json::exception& e) {
810814
EVLOG_error << "JSON exception during handling of message: " << e.what();
811815
if (json_message.is_array() and json_message.size() > MESSAGE_ID) {

lib/ocpp/v201/functional_blocks/transaction.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ void TransactionBlock::handle_transaction_event_response(const EnhancedMessage<M
284284
}
285285

286286
if (tariff_and_cost != nullptr) {
287-
this->tariff_and_cost->handle_cost_and_tariff(call_result.msg, original_msg, message.message[CALLRESULT_PAYLOAD]);
287+
this->tariff_and_cost->handle_cost_and_tariff(call_result.msg, original_msg,
288+
message.message[CALLRESULT_PAYLOAD]);
288289
}
289290

290291
if (original_msg.eventType == TransactionEventEnum::Ended) {

tests/lib/ocpp/v201/test_device_model.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class DeviceModelTest : public ::testing::Test {
2323
}
2424
};
2525

26-
/// \brief Test if value can be changed. And test if setting a value of 0 is allowed for a value that is allowed to be 0.
26+
/// \brief Test if value can be changed. And test if setting a value of 0 is allowed for a value that is allowed to be
27+
/// 0.
2728
TEST_F(DeviceModelTest, test_set_value_and_allow_zero) {
2829
// default value is 900
2930
auto r = dm->get_value<int>(cv, ocpp::v201::AttributeEnum::Actual);

0 commit comments

Comments
 (0)