We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TransactionEvent
FormatViolation
triggerReason
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In some cases, TransactionEvent do not have the required property triggerReason.
In TransactionService::Evse::loop(), here it sets event triggerReason, but it may be the initial value UNDEFINED.
TransactionService::Evse::loop()
UNDEFINED
Then, the triggerReason property is skipped in message serialization.
Shouldn't you set something to follow the OCPP spec?
The text was updated successfully, but these errors were encountered:
Perhaps here is where to set txEvent->transaction->stopTrigger.
txEvent->transaction->stopTrigger
If the started transaction comes to be active = false, it would fall into the case of TransactionEventData::Type::Ended above.
started
active = false
TransactionEventData::Type::Ended
--- a/src/MicroOcpp/Operations/TransactionEvent.cpp +++ b/src/MicroOcpp/Operations/TransactionEvent.cpp @@ -131,14 +131,23 @@ std::unique_ptr<JsonDoc> TransactionEvent::createReq() { void TransactionEvent::processConf(JsonObject payload) { if (payload.containsKey("idTokenInfo")) { if (strcmp(payload["idTokenInfo"]["status"], "Accepted")) { MO_DBG_INFO("transaction deAuthorized"); txEvent->transaction->active = false; txEvent->transaction->isDeauthorized = true; + if (txEvent->transaction->started && !txEvent->transaction->stopped) { + if (txEvent->transaction->stopTrigger == TransactionEventTriggerReason::UNDEFINED) { + txEvent->transaction->stopTrigger = TransactionEventTriggerReason::Deauthorized; + } + + if (txEvent->transaction->stoppedReason == Ocpp201::Transaction::StoppedReason::UNDEFINED) { + txEvent->transaction->stoppedReason = Ocpp201::Transaction::StoppedReason::DeAuthorized; + } + } } } } void TransactionEvent::processReq(JsonObject payload) { /** * Ignore Contents of this Req-message, because this is for debug purposes only
Sorry, something went wrong.
No branches or pull requests
In some cases,
TransactionEvent
do not have the required propertytriggerReason
.In
TransactionService::Evse::loop()
,here it sets event
triggerReason
, but it may be the initial valueUNDEFINED
.Then, the
triggerReason
property is skipped in message serialization.Shouldn't you set something to follow the OCPP spec?
The text was updated successfully, but these errors were encountered: