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
132
132
Connector& charge_point = m_connectors.getChargePointConnector ();
133
133
if (charge_point.status == ChargePointStatus::Reserved)
134
134
{
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)
138
137
{
139
- if (c->status == ChargePointStatus::Available)
140
- {
141
- available_count++;
142
- }
138
+ ret = AuthorizationStatus::Accepted;
143
139
}
144
- if (available_count > 1 )
140
+ else
145
141
{
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
+ }
147
155
}
148
156
}
149
157
else
You can’t perform that action at this time.
0 commit comments