Skip to content

Commit accd195

Browse files
Update DefaultChargePointEventsHandler.cpp
according to Test Case Id: 027 , in Remote start transaction - connector id shall not be 0
1 parent 86cd451 commit accd195

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

examples/common/DefaultChargePointEventsHandler.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -168,24 +168,16 @@ bool DefaultChargePointEventsHandler::remoteStartTransactionRequested(unsigned i
168168
{
169169
bool ret = false;
170170
cout << "Remote start transaction : " << connector_id << " - " << id_tag << endl;
171-
if (connector_id != 0)
171+
172+
if(connector_id > m_config.ocppConfig().numberOfConnectors() || connector_id == 0)
172173
{
173-
m_remote_start_pending[connector_id - 1u] = true;
174-
m_remote_start_id_tag[connector_id - 1u] = id_tag;
175-
ret = true;
174+
ret=false;
176175
}
177176
else
178177
{
179-
for (size_t i = 1; i <= m_config.ocppConfig().numberOfConnectors(); i++)
180-
{
181-
if (m_chargepoint->getConnectorStatus(i) < ChargePointStatus::Charging)
182-
{
183-
m_remote_start_pending[i - 1u] = true;
184-
m_remote_start_id_tag[i - 1u] = id_tag;
185-
ret = true;
186-
break;
187-
}
188-
}
178+
m_remote_start_pending[connector_id - 1u] = true;
179+
m_remote_start_id_tag[connector_id - 1u] = id_tag;
180+
ret=true;
189181
}
190182
return ret;
191183
}

0 commit comments

Comments
 (0)