Skip to content

Commit

Permalink
Moved the check for network priorities into the cache function
Browse files Browse the repository at this point in the history
Signed-off-by: Soumya Subramanya <[email protected]>
  • Loading branch information
SNSubramanya committed Sep 12, 2024
1 parent f8342cb commit 642d46b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ocpp/v201/connectivity_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ void ConnectivityManager::init_websocket() {
// cache the network profiles on initialization
cache_network_connection_profiles();

if (this->network_connection_priorities.empty()) {
EVLOG_AND_THROW(std::runtime_error("NetworkConfigurationPriority must not be empty"));
}

const auto configuration_slot = this->network_connection_priorities.at(this->network_configuration_priority);
const auto connection_options = this->get_ws_connection_options(std::stoi(configuration_slot));

Expand Down Expand Up @@ -273,6 +269,10 @@ void ConnectivityManager::cache_network_connection_profiles() {

this->network_connection_priorities = ocpp::get_vector_from_csv(
this->device_model.get_value<std::string>(ControllerComponentVariables::NetworkConfigurationPriority));

if (this->network_connection_priorities.empty()) {
EVLOG_AND_THROW(std::runtime_error("NetworkConfigurationPriority must not be empty"));
}
}
} // namespace v201
} // namespace ocpp

0 comments on commit 642d46b

Please sign in to comment.