Skip to content

Commit

Permalink
Send rejected when a start or stop transaction request is sent and bo…
Browse files Browse the repository at this point in the history
…otnotification is still pending

Signed-off-by: Maaike <maaike@iolar.nl>
  • Loading branch information
maaikez committed Aug 16, 2023
1 parent 705cdb2 commit be047ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/ocpp/v201/charge_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,18 @@ void ChargePoint::message_callback(const std::string& message) {
enhanced_message.messageType == MessageType::GetReport or
enhanced_message.messageType == MessageType::TriggerMessage) {
this->handle_message(json_message, enhanced_message.messageType);
} else if (enhanced_message.messageType == MessageType::RequestStartTransaction) {
// Send rejected: B02.FR.05
RequestStartTransactionResponse response;
response.status = RequestStartStopStatusEnum::Rejected;
const ocpp::CallResult<RequestStartTransactionResponse> call_result(response, enhanced_message.uniqueId);
this->send<RequestStartTransactionResponse>(call_result);
} else if (enhanced_message.messageType == MessageType::RequestStopTransaction) {
// Send rejected: B02.FR.05
RequestStopTransactionResponse response;
response.status = RequestStartStopStatusEnum::Rejected;
const ocpp::CallResult<RequestStopTransactionResponse> call_result(response, enhanced_message.uniqueId);
this->send<RequestStopTransactionResponse>(call_result);
} else {
EVLOG_warning << "Received invalid MessageType: "
<< conversions::messagetype_to_string(enhanced_message.messageType)
Expand Down

0 comments on commit be047ed

Please sign in to comment.