Skip to content

Commit

Permalink
Merge pull request #164 from Habbus/fix/reject_connectorId_0_on_remot…
Browse files Browse the repository at this point in the history
…estart

Fix for issue #161, a connectorId of 0 will now be rejected on a RemoteStartTransaction
  • Loading branch information
c-jimenez authored Nov 13, 2023
2 parents 1c8683c + 094bf82 commit 3366707
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/chargepoint/transaction/TransactionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ bool TransactionManager::handleMessage(const ocpp::messages::RemoteStartTransact
}
}
}
else
else if (!request.connectorId.isSet())
{
// The user application will determine which connector to use
authorized = m_events_handler.remoteStartTransactionRequested(Connectors::CONNECTOR_ID_CHARGE_POINT, request.idTag.str());
Expand All @@ -309,6 +309,12 @@ bool TransactionManager::handleMessage(const ocpp::messages::RemoteStartTransact
authorized = m_smart_charging_manager.installTxProfile(Connectors::CONNECTOR_ID_CHARGE_POINT, request.chargingProfile);
}
}
else
{
// Connector id is set but equal to CONNECTOR_ID_CHARGE_POINT
// This is not allowed by the ocpp1.6 standard
authorized = false;
}

// Response
if (authorized)
Expand Down

0 comments on commit 3366707

Please sign in to comment.