Skip to content

Commit

Permalink
Fix formatting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Soumya Subramanya <[email protected]>
  • Loading branch information
SNSubramanya committed Oct 18, 2023
1 parent 40fbd05 commit c0ac552
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions include/ocpp/v201/device_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class DeviceModel {
/// \param allow_write_only true to allow a writeOnly value to be read.
/// \return GetVariableStatusEnum that indicates the result of the request
GetVariableStatusEnum request_value_internal(const Component& component_id, const Variable& variable_id,
const AttributeEnum& attribute_enum, std::string& value, bool allow_write_only);
const AttributeEnum& attribute_enum, std::string& value,
bool allow_write_only);

/// \brief Iterates over the given \p component_criteria and converts this to the variable names
/// (Active,Available,Enabled,Problem). If any of the variables can not be find as part of a component this function
Expand Down Expand Up @@ -94,8 +95,8 @@ class DeviceModel {
T get_value(const ComponentVariable& component_variable,
const AttributeEnum& attribute_enum = AttributeEnum::Actual) {
std::string value;
const auto response = this->request_value_internal(component_variable.component,
component_variable.variable.value(), attribute_enum,value, true);
const auto response = this->request_value_internal(
component_variable.component, component_variable.variable.value(), attribute_enum, value, true);
if (response == GetVariableStatusEnum::Accepted) {
return to_specific_type<T>(value);
} else {
Expand All @@ -117,8 +118,8 @@ class DeviceModel {
std::optional<T> get_optional_value(const ComponentVariable& component_variable,
const AttributeEnum& attribute_enum = AttributeEnum::Actual) {
std::string value;
const auto response = this->request_value_internal(component_variable.component,
component_variable.variable.value(), attribute_enum,value, true);
const auto response = this->request_value_internal(
component_variable.component, component_variable.variable.value(), attribute_enum, value, true);
if (response == GetVariableStatusEnum::Accepted) {
return to_specific_type<T>(value);
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/ocpp/v201/device_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ GetVariableStatusEnum DeviceModel::request_value_internal(const Component& compo

// only internal functions can access WriteOnly variables
if (attribute_opt.value().mutability.has_value() && !allow_write_only &&
attribute_opt.value().mutability.value() == MutabilityEnum::WriteOnly ) {
attribute_opt.value().mutability.value() == MutabilityEnum::WriteOnly) {
return GetVariableStatusEnum::Rejected;
}

Expand Down

0 comments on commit c0ac552

Please sign in to comment.