Skip to content

Commit

Permalink
Merge branch 'main' into doc/ocpp-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietfried authored Oct 15, 2024
2 parents d2379fc + dce296f commit 12b16b1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion modules/Auth/lib/AuthHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,11 @@ void AuthHandler::notify_evse(int connector_id, const ProvidedIdToken& provided_
this->connectors.at(connector_id)->timeout_timer.stop();
this->connectors.at(connector_id)
->timeout_timer.timeout(
[this, evse_index, connector_id]() {
[this, evse_index, connector_id, provided_token]() {
EVLOG_info << "Authorization timeout for evse#" << evse_index;
this->connectors.at(connector_id)->connector.identifier.reset();
this->withdraw_authorization_callback(evse_index);
this->publish_token_validation_status_callback(provided_token, TokenValidationStatus::TimedOut);
},
std::chrono::seconds(this->connection_timeout));
std::lock_guard<std::mutex> plug_in_lk(this->plug_in_queue_mutex);
Expand Down
3 changes: 3 additions & 0 deletions modules/Auth/tests/auth_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,9 @@ TEST_F(AuthTest, test_authorization_without_transaction) {
ASSERT_TRUE(result == TokenHandlingResult::ALREADY_IN_PROCESS);
ASSERT_TRUE(this->auth_receiver->get_authorization(0));

EXPECT_CALL(mock_publish_token_validation_status_callback,
Call(Field(&ProvidedIdToken::id_token, provided_token.id_token), TokenValidationStatus::TimedOut));

// wait for timeout
std::this_thread::sleep_for(std::chrono::seconds(CONNECTION_TIMEOUT + 1));

Expand Down
4 changes: 2 additions & 2 deletions modules/EnergyManager/EnergyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ std::vector<types::energy::EnforcedLimits> EnergyManager::run_optimizer(types::e
std::vector<types::energy::EnforcedLimits> optimized_values;
optimized_values.reserve(brokers.size());

for (auto broker : brokers) {
auto local_market = broker->get_local_market();
for (auto& broker : brokers) {
auto& local_market = broker->get_local_market();
const auto sold_energy = local_market.get_sold_energy();

if (sold_energy.size() > 0) {
Expand Down
4 changes: 0 additions & 4 deletions modules/EnergyManager/Market.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,6 @@ Market::Market(types::energy::EnergyFlowRequest& _energy_flow_request, const flo
}
}

const std::vector<Market>& Market::children() {
return _children;
}

ScheduleRes Market::get_sold_energy() {
return sold_root;
}
Expand Down
3 changes: 1 addition & 2 deletions modules/EnergyManager/Market.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class Market {
ScheduleRes get_sold_energy();

Market* parent();
const std::vector<Market>& children();

float nominal_ac_voltage();

Expand All @@ -77,7 +76,7 @@ class Market {

private:
Market* _parent;
std::vector<Market> _children;
std::list<Market> _children;
float _nominal_ac_voltage;

// main data structures
Expand Down

0 comments on commit 12b16b1

Please sign in to comment.