Skip to content

Commit 648e83a

Browse files
problem with testcase 58_1 and 58_2
test case :58_1 passed with return true in SmartChargingManager::handleMessage. For test case 58_2 If the transactionId is set in the request, it should be checked if it is the same as the connectors transactionId.
1 parent b5bcc20 commit 648e83a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/chargepoint/smartcharging/SmartChargingManager.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,19 @@ bool SmartChargingManager::handleMessage(const ocpp::messages::SetChargingProfil
281281
// Check if a transaction is in progress for the specific connector
282282
if (connector->transaction_id != 0)
283283
{
284-
// Add profile
285-
ret = true;
284+
if(request.csChargingProfiles.transactionId.isSet())
285+
{
286+
if(request.csChargingProfiles.transactionId.value() == connector->transaction_id)
287+
{
288+
// Add profile
289+
ret = true;
290+
}
291+
}
292+
else
293+
{
294+
// Add profile
295+
ret = true;
296+
}
286297
}
287298
}
288299
break;
@@ -340,7 +351,7 @@ bool SmartChargingManager::handleMessage(const ocpp::messages::SetChargingProfil
340351
LOG_INFO << "Set charging profile status rejected : " << error_message;
341352
}
342353

343-
return ret;
354+
return true;
344355
}
345356

346357
/** @copydoc bool GenericMessageHandler<RequestType, ResponseType>::handleMessage(const RequestType& request,

0 commit comments

Comments
 (0)