File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -712,6 +712,30 @@ std::shared_ptr<Transaction>& getTransaction(unsigned int connectorId) {
712712 return connector->getTransaction ();
713713}
714714
715+ #if MO_ENABLE_V201
716+ Ocpp201::Transaction *getTransactionV201 (unsigned int evseId) {
717+ if (!context) {
718+ MO_DBG_ERR (" OCPP uninitialized" ); // need to call mocpp_initialize before
719+ return nullptr ;
720+ }
721+
722+ if (context->getVersion ().major != 2 ) {
723+ MO_DBG_ERR (" only supported in v201" ); // need to call mocpp_initialize before
724+ return nullptr ;
725+ }
726+
727+ TransactionService::Evse *evse = nullptr ;
728+ if (auto txService = context->getModel ().getTransactionService ()) {
729+ evse = txService->getEvse (evseId);
730+ }
731+ if (!evse) {
732+ MO_DBG_ERR (" could not find EVSE" );
733+ return nullptr ;
734+ }
735+ return evse->getTransaction ();
736+ }
737+ #endif // MO_ENABLE_V201
738+
715739bool ocppPermitsCharge (unsigned int connectorId) {
716740 if (!context) {
717741 MO_DBG_WARN (" OCPP uninitialized" );
You can’t perform that action at this time.
0 commit comments