-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/756-refactor-naming-of-component-sch…
…emas
- Loading branch information
Showing
33 changed files
with
723 additions
and
745 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
* @pietfried @hikinggrass @marcemmers @maaikez | ||
|
||
/config/v16/ @pietfried @hikinggrass | ||
/include/ocpp/v16/ @pietfried @hikinggrass | ||
/lib/ocpp/v16/ @pietfried @hikinggrass | ||
/config/v16/ @pietfried @hikinggrass @maaikez | ||
/include/ocpp/v16/ @pietfried @hikinggrass @maaikez | ||
/lib/ocpp/v16/ @pietfried @hikinggrass @maaikez | ||
|
||
/.github/ @pietfried @hikinggrass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright 2020 - 2024 Pionix GmbH and Contributors to EVerest | ||
#ifndef V16_UTILS_HPP | ||
#define V16_UTILS_HPP | ||
|
||
#include <ocpp/common/call_types.hpp> | ||
#include <ocpp/v16/messages/StopTransaction.hpp> | ||
#include <ocpp/v16/ocpp_types.hpp> | ||
#include <ocpp/v16/types.hpp> | ||
|
||
namespace ocpp { | ||
namespace v16 { | ||
namespace utils { | ||
|
||
size_t get_message_size(const ocpp::Call<StopTransactionRequest>& call) { | ||
return json(call).at(CALL_PAYLOAD).dump().length(); | ||
} | ||
size_t get_message_size(const ocpp::Call<StopTransactionRequest>& call); | ||
|
||
/// \brief Drops every second entry from transactionData as long as the message size of the \p call is greater than the | ||
/// \p max_message_size | ||
void drop_transaction_data(size_t max_message_size, ocpp::Call<StopTransactionRequest>& call) { | ||
auto& transaction_data = call.msg.transactionData.value(); | ||
while (get_message_size(call) > max_message_size && transaction_data.size() > 2) { | ||
for (size_t i = 1; i < transaction_data.size() - 1; i = i + 2) { | ||
transaction_data.erase(transaction_data.begin() + i); | ||
} | ||
} | ||
} | ||
void drop_transaction_data(size_t max_message_size, ocpp::Call<StopTransactionRequest>& call); | ||
|
||
/// \brief Determines if a given \p security_event is critical as defined in the OCPP 1.6 security whitepaper | ||
bool is_critical(const std::string& security_event); | ||
|
||
} // namespace utils | ||
} // namespace v16 | ||
} // namespace ocpp | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.