File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
src/chargepoint/reservation Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -132,18 +132,26 @@ ocpp::types::AuthorizationStatus ReservationManager::isTransactionAllowed(unsign
132132 Connector& charge_point = m_connectors.getChargePointConnector ();
133133 if (charge_point.status == ChargePointStatus::Reserved)
134134 {
135- // At least 1 connector must stay available
136- unsigned int available_count = 0 ;
137- for (const Connector* c : m_connectors.getConnectors ())
135+ // Ensure that the module functions properly even when the gun is inserted first by the user.
136+ if (m_connectors.getConnector (connector_id)->status == ChargePointStatus::Preparing)
138137 {
139- if (c->status == ChargePointStatus::Available)
140- {
141- available_count++;
142- }
138+ ret = AuthorizationStatus::Accepted;
143139 }
144- if (available_count > 1 )
140+ else
145141 {
146- ret = AuthorizationStatus::Accepted;
142+ // At least 1 connector must stay available
143+ unsigned int available_count = 0 ;
144+ for (const Connector* c : m_connectors.getConnectors ())
145+ {
146+ if (c->status == ChargePointStatus::Available)
147+ {
148+ available_count++;
149+ }
150+ }
151+ if (available_count >= 1 )
152+ {
153+ ret = AuthorizationStatus::Accepted;
154+ }
147155 }
148156 }
149157 else
You can’t perform that action at this time.
0 commit comments