Skip to content

Commit

Permalink
Merge branch 'main' into feature/PN7160TokenProv-extLib
Browse files Browse the repository at this point in the history
  • Loading branch information
cburandt committed Nov 7, 2024
2 parents 815e681 + a4edced commit 5cc8b6d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 47 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)

project(everest-core
VERSION 2024.9.0
VERSION 2024.10.0
DESCRIPTION "The open operating system for e-mobility charging stations"
LANGUAGES CXX C
)
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ libevse-security:
# OCPP
libocpp:
git: https://github.com/EVerest/libocpp.git
git_tag: 6a0010225535599b053e401307d76b58e9e3c7c5
git_tag: v0.19.0
cmake_condition: "EVEREST_DEPENDENCY_ENABLED_LIBOCPP"
# Josev
Josev:
Expand Down
21 changes: 14 additions & 7 deletions modules/OCPP/OCPP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,25 +745,32 @@ void OCPP::ready() {

this->charge_point->register_transaction_started_callback(
[this](const int32_t connector, const std::string& session_id) {
types::ocpp::OcppTransactionEvent tevent = {
types::ocpp::TransactionEvent::Started, connector, 1, session_id, std::nullopt,
};
types::ocpp::OcppTransactionEvent tevent;
tevent.transaction_event = types::ocpp::TransactionEvent::Started;
tevent.evse = {connector, 1};
tevent.session_id = session_id;
p_ocpp_generic->publish_ocpp_transaction_event(tevent);
});

this->charge_point->register_transaction_updated_callback(
[this](const int32_t connector, const std::string& session_id, const int32_t transaction_id,
const ocpp::v16::IdTagInfo& id_tag_info) {
types::ocpp::OcppTransactionEvent tevent = {types::ocpp::TransactionEvent::Updated, connector, 1,
session_id, std::to_string(transaction_id)};
types::ocpp::OcppTransactionEvent tevent;
tevent.transaction_event = types::ocpp::TransactionEvent::Updated;
tevent.evse = {connector, 1};
tevent.session_id = session_id;
tevent.transaction_id = std::to_string(transaction_id);
p_ocpp_generic->publish_ocpp_transaction_event(tevent);
});

this->charge_point->register_transaction_stopped_callback(
[this](const int32_t connector, const std::string& session_id, const int32_t transaction_id) {
EVLOG_info << "Transaction stopped at connector: " << connector << "session_id: " << session_id;
types::ocpp::OcppTransactionEvent tevent = {types::ocpp::TransactionEvent::Ended, connector, 1, session_id,
std::to_string(transaction_id)};
types::ocpp::OcppTransactionEvent tevent;
tevent.transaction_event = types::ocpp::TransactionEvent::Ended;
tevent.evse = {connector, 1};
tevent.session_id = session_id;
tevent.transaction_id = std::to_string(transaction_id);
p_ocpp_generic->publish_ocpp_transaction_event(tevent);
});

Expand Down
14 changes: 1 addition & 13 deletions modules/OCPP201/conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1058,21 +1058,9 @@ to_everest_ocpp_transaction_event(const ocpp::v201::TransactionEventRequest& tra
break;
}

auto evse_id = 1;
auto connector_id = 1;

if (transaction_event.evse.has_value()) {
evse_id = transaction_event.evse.value().id;
if (transaction_event.evse.value().connectorId.has_value()) {
connector_id = transaction_event.evse.value().connectorId.value();
}
} else {
EVLOG_warning << "Attempting to convert TransactionEventRequest that does not contain information about the "
"EVSE. evse_id and connector default to 1.";
ocpp_transaction_event.evse = to_everest_evse(transaction_event.evse.value());
}

ocpp_transaction_event.evse_id = evse_id;
ocpp_transaction_event.connector = connector_id;
ocpp_transaction_event.session_id =
transaction_event.transactionInfo.transactionId; // session_id == transaction_id for OCPP2.0.1
ocpp_transaction_event.transaction_id = transaction_event.transactionInfo.transactionId;
Expand Down
45 changes: 20 additions & 25 deletions types/ocpp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,40 @@ types:
description: schedule for a connector
type: object
$ref: /ocpp#/ChargingSchedule
EVSE:
description: >-
Type of an EVSE. If only the id is present, this type identifies an EVSE.
If also a connector_id is given, this type identifies a Connector of the EVSE
type: object
required:
- id
properties:
id:
description: Id of the EVSE
type: integer
minimum: 1
connector_id:
description: An id to designate a specific connector (on an EVSE) by connector index number
type: integer
minimum: 1
OcppTransactionEvent:
description: >-
Element providing information on OCPP transactions.
type: object
required:
- transaction_event
- evse_id
- connector
- session_id
properties:
transaction_event:
description: >-
The transaction related event.
type: string
$ref: /ocpp#/TransactionEvent
evse_id:
description: >-
The OCPP 2.0.1 EVSE ID associated with the transaction.
type: integer
connector:
evse:
description: >-
The connector associated with the transaction.
type: integer
The OCPP 2.0.1 EVSE associated with the transaction.
type: object
$ref: /ocpp#/EVSE
session_id:
description: >-
The EVSE manager assigned session ID.
Expand Down Expand Up @@ -271,22 +282,6 @@ types:
description: Timestamp of the moment the security event was generated, if absent the current datetime is assumed
type: string
format: date-time
EVSE:
description: >-
Type of an EVSE. If only the id is present, this type identifies an EVSE.
If also a connector_id is given, this type identifies a Connector of the EVSE
type: object
required:
- id
properties:
id:
description: Id of the EVSE
type: integer
minimum: 1
connector_id:
description: An id to designate a specific connector (on an EVSE) by connector index number
type: integer
minimum: 1
Variable:
description: >-
Type for a variable with a name and an optional instance
Expand Down

0 comments on commit 5cc8b6d

Please sign in to comment.