Add extracted tools: CitrineOS, OpenOCPP, ShapeShifter
- CitrineOS core extracted (CSMS OCPP 2.0.1) - OpenOCPP extracted (firmware OCPP 1.6J/2.0.1) - ShapeShifter library installed (pip install -e) - ShapeShifter specification extracted - EVerest extracted TODO updated with progress
This commit is contained in:
24
tools/EVerest-main/lib/everest/CMakeLists.txt
Normal file
24
tools/EVerest-main/lib/everest/CMakeLists.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
# Conditionally include libraries based on EVEREST_INCLUDE_LIBS / EVEREST_EXCLUDE_LIBS.
|
||||
# When neither is set, all libraries are built (backwards compatible).
|
||||
# The library list is defined in cmake/ev-lib-dependencies.cmake (EVEREST_LIB_SUBDIRS).
|
||||
|
||||
foreach(_lib IN LISTS EVEREST_LIB_SUBDIRS)
|
||||
ev_should_build_lib(${_lib} _should_build)
|
||||
if(_should_build)
|
||||
add_subdirectory(${_lib})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(EVEREST_DEPENDENCY_ENABLED_EVEREST_GPIO)
|
||||
ev_should_build_lib(gpio _should_build)
|
||||
if(_should_build)
|
||||
add_subdirectory(gpio)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EVEREST_DEPENDENCY_ENABLED_SDBUS_CPP)
|
||||
ev_should_build_lib(system _should_build)
|
||||
if(_should_build)
|
||||
add_subdirectory(system)
|
||||
endif()
|
||||
endif()
|
||||
17
tools/EVerest-main/lib/everest/can_dpm1000/CMakeLists.txt
Normal file
17
tools/EVerest-main/lib/everest/can_dpm1000/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
add_library(can_dpm1000)
|
||||
add_library(can_protocols::dpm1000 ALIAS can_dpm1000)
|
||||
ev_register_library_target(can_dpm1000)
|
||||
|
||||
target_include_directories(can_dpm1000
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
)
|
||||
|
||||
target_sources(can_dpm1000
|
||||
PRIVATE
|
||||
src/dpm1000.cpp
|
||||
)
|
||||
|
||||
if(BUILD_DEV_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
@@ -0,0 +1,126 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright Pionix GmbH and Contributors to EVerest
|
||||
#ifndef CAN_PROTOCOL_DPM1000_HPP
|
||||
#define CAN_PROTOCOL_DPM1000_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
#include <linux/can.h>
|
||||
|
||||
namespace can::protocol::dpm1000 {
|
||||
namespace def {
|
||||
|
||||
enum class ErrorType : uint8_t {
|
||||
NO_ERROR = 0xf0,
|
||||
INVALID_NODE_ADDRESS = 0xf1,
|
||||
INVALID_COMMAND = 0xf2,
|
||||
DATA_VERIFICATION_FAULT = 0xf3,
|
||||
ADDRESS_RECOGNITION = 0xf4,
|
||||
};
|
||||
|
||||
enum class MessageType : uint8_t {
|
||||
SET_DATA_REQUEST = 0x00,
|
||||
REQUEST_DATA_BYTE = 0x01,
|
||||
RESPONSE_REQUEST = 0x41,
|
||||
SET_DATA = 0x03,
|
||||
RESPONSE_CONFIGURATION = 0x43,
|
||||
};
|
||||
|
||||
constexpr auto SET_DATA_REQUEST_INPUT_RELAY_BIT_SHIFT = 2;
|
||||
constexpr auto SET_DATA_REQUEST_POWER_BIT_SHIFT = 7;
|
||||
|
||||
enum class ReadValueType : uint16_t {
|
||||
VOLTAGE = 0x0001,
|
||||
CURRENT_REAL_PART = 0x0002,
|
||||
CURRENT_LIMIT = 0x0003,
|
||||
DCDC_TEMPERATURE = 0x0004,
|
||||
AC_VOLTAGE = 0x0005,
|
||||
VOLTAGE_LIMIT = 0x0006,
|
||||
CURRENT = 0x0007, // how is this different from the real part?
|
||||
PFC0_VOLTAGE = 0x0008,
|
||||
PFC1_VOLTAGE = 0x000A,
|
||||
ENV_TEMPERATURE = 0x000B,
|
||||
AC_VOLTAGE_PHASE_A = 0x000C,
|
||||
AC_VOLTAGE_PHASE_B = 0x000D,
|
||||
AC_VOLTAGE_PHASE_C = 0x000E,
|
||||
PFC_TEMPERATURE = 0x0010,
|
||||
POWER_LIMIT = 0x0014,
|
||||
ALARM = 0x0040,
|
||||
DEFAULT_CURRENT_LIMIT = 0x0019,
|
||||
};
|
||||
|
||||
enum class SetValueType : uint16_t {
|
||||
DEFAULT_CURRENT_LIMIT = 0x0019,
|
||||
POWER_LIMIT = 0x0020,
|
||||
VOLTAGE = 0x0021,
|
||||
CURRENT_LIMIT = 0x0022,
|
||||
SERIES_PARALLEL_MODE = 0x0023,
|
||||
DEFAULT_OUTPUT_VOLTAGE = 0x0024,
|
||||
SWITCH_ON_OFF_SETTING = 0x0030,
|
||||
INPUT_RELAY_POWER_OFF_SETTING = 0x0035,
|
||||
};
|
||||
|
||||
enum class Alarm : uint8_t {
|
||||
FUSE_BURN_OUT = 2,
|
||||
PFC_DCDC_COMMUNICATION_ERROR = 3,
|
||||
UNBALANCED_BUS_VOLTAGE = 6,
|
||||
BUS_OVER_VOLTAGE = 7,
|
||||
BUS_ABNORMAL_VOLTAGE = 8,
|
||||
PHASE_OVER_VOLTAGE = 9,
|
||||
ID_NUMBER_REPETITION = 10,
|
||||
BUS_UNDER_VOLTAGE = 11,
|
||||
PHASE_LOSS = 12,
|
||||
PHASE_UNDER_VOLTAGE = 14,
|
||||
CAN_COMMUNICATION_FAULT = 16,
|
||||
DCDC_UNEVEN_CURRENT_SHARING = 17,
|
||||
PFC_POWER_OFF = 19,
|
||||
FAN_FULL_SPEED = 21,
|
||||
DCDC_POWER_OFF = 22,
|
||||
POWER_LIMITING = 23,
|
||||
TEMPERATURE_POWER_LIMITING = 24,
|
||||
AC_POWER_LIMITING = 25,
|
||||
DCDC_EEPROM_FAULTS = 26,
|
||||
FAN_FAULTS = 27,
|
||||
DCDC_SHORT_CIRCUIT = 28,
|
||||
PFC_EEPROM_FAULTS = 29,
|
||||
DCDC_OVER_TEMPERATURE = 30,
|
||||
DCDC_OUTPUT_OVER_VOLTAGE = 31,
|
||||
};
|
||||
|
||||
constexpr uint16_t MESSAGE_HEADER = 0b001100000;
|
||||
constexpr uint16_t MESSAGE_HEADER_MASK = 0b111111111;
|
||||
constexpr auto MESSAGE_HEADER_BIT_SHIFT = 20;
|
||||
constexpr auto MESSAGE_HEADER_PTP_BIT_SHIFT = 19;
|
||||
constexpr auto MESSAGE_HEADER_DSTADDR_BIT_SHIFT = 11;
|
||||
constexpr auto MESSAGE_HEADER_SRCADDR_BIT_SHIFT = 3;
|
||||
constexpr auto MESSAGE_HEADER_CNT_BIT_SHIFT = 2;
|
||||
|
||||
constexpr auto ERROR_FLAG_BIT_SHIFT = 7;
|
||||
|
||||
// FIXME (aw): unknown ValueTypes
|
||||
// CURRENT_ALARM_STATUS = 0x0040 (is this get or set?)
|
||||
// MODULE_GROUPING_SETTINGS = 0x0048 (is this get or set?)
|
||||
|
||||
} // namespace def
|
||||
|
||||
int dumb_function();
|
||||
|
||||
void set_header(struct can_frame&, uint8_t source, uint8_t destination = 0xFF);
|
||||
|
||||
void power_on(struct can_frame&, bool switch_on, bool close_input_relay);
|
||||
|
||||
void request_data(struct can_frame&, def::ReadValueType);
|
||||
|
||||
void set_data(struct can_frame&, def::SetValueType, const std::vector<uint8_t>& payload);
|
||||
|
||||
uint8_t parse_source(const struct can_frame&);
|
||||
uint16_t parse_msg_type(const struct can_frame&);
|
||||
|
||||
inline bool is_error_flag_set(const struct can_frame& frame) {
|
||||
return (frame.data[0] >> def::ERROR_FLAG_BIT_SHIFT);
|
||||
}
|
||||
|
||||
} // namespace can::protocol::dpm1000
|
||||
|
||||
#endif // CAN_PROTOCOL_DPM1000_HPP
|
||||
81
tools/EVerest-main/lib/everest/can_dpm1000/src/dpm1000.cpp
Normal file
81
tools/EVerest-main/lib/everest/can_dpm1000/src/dpm1000.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright Pionix GmbH and Contributors to EVerest
|
||||
#include <everest/can/protocol/dpm1000.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
#include <endian.h>
|
||||
|
||||
namespace can::protocol::dpm1000 {
|
||||
|
||||
static inline void clear_frame_data(struct can_frame& frame) {
|
||||
memset(frame.data, 0, sizeof(frame.data));
|
||||
}
|
||||
|
||||
template <typename EnumType> static inline auto to_underlying(EnumType value) {
|
||||
return static_cast<std::underlying_type_t<EnumType>>(value);
|
||||
}
|
||||
|
||||
static void set_msg_type(def::MessageType msg_type, struct can_frame& frame) {
|
||||
frame.data[0] = to_underlying(msg_type);
|
||||
}
|
||||
|
||||
void set_header(struct can_frame& frame, uint8_t source, uint8_t destination) {
|
||||
const auto ptp_value = (destination != 0xFF);
|
||||
frame.can_id = (0b1UL << 31UL) | (def::MESSAGE_HEADER << def::MESSAGE_HEADER_BIT_SHIFT) |
|
||||
(ptp_value << def::MESSAGE_HEADER_PTP_BIT_SHIFT) |
|
||||
(destination << def::MESSAGE_HEADER_DSTADDR_BIT_SHIFT) |
|
||||
(source << def::MESSAGE_HEADER_SRCADDR_BIT_SHIFT) | (0 << def::MESSAGE_HEADER_CNT_BIT_SHIFT) |
|
||||
0b11; // bits 0 and 1 default to 1 ...
|
||||
frame.data[1] = to_underlying(def::ErrorType::NO_ERROR);
|
||||
}
|
||||
|
||||
void power_on(struct can_frame& frame, bool switch_on, bool close_input_relay) {
|
||||
clear_frame_data(frame);
|
||||
frame.data[0] = to_underlying(def::MessageType::SET_DATA_REQUEST);
|
||||
|
||||
frame.data[2] |= (((switch_on) ? 0 : 1) << def::SET_DATA_REQUEST_POWER_BIT_SHIFT);
|
||||
frame.data[2] |= (((close_input_relay) ? 0 : 1) << def::SET_DATA_REQUEST_INPUT_RELAY_BIT_SHIFT);
|
||||
frame.data[3] = 0x80; // FIXME (aw): literal
|
||||
frame.can_dlc = sizeof(frame.data);
|
||||
}
|
||||
|
||||
void request_data(struct can_frame& frame, def::ReadValueType value_type) {
|
||||
clear_frame_data(frame);
|
||||
frame.data[0] = to_underlying(def::MessageType::REQUEST_DATA_BYTE);
|
||||
|
||||
const auto value_type_raw = htobe16(to_underlying(value_type));
|
||||
memcpy(&frame.data[2], &value_type_raw, sizeof(value_type_raw));
|
||||
|
||||
frame.can_dlc = sizeof(frame.data);
|
||||
}
|
||||
|
||||
void set_data(struct can_frame& frame, def::SetValueType value_type, const std::vector<uint8_t>& payload) {
|
||||
clear_frame_data(frame);
|
||||
frame.data[0] = to_underlying(def::MessageType::SET_DATA);
|
||||
|
||||
const auto value_type_raw = htobe16(to_underlying(value_type));
|
||||
memcpy(&frame.data[2], &value_type_raw, sizeof(value_type_raw));
|
||||
|
||||
constexpr std::size_t MAX_PAYLOAD_SIZE = 4;
|
||||
const auto payload_size = std::min(payload.size(), MAX_PAYLOAD_SIZE);
|
||||
|
||||
memcpy(&frame.data[4], payload.data(), payload_size);
|
||||
|
||||
frame.can_dlc = sizeof(frame.data) - MAX_PAYLOAD_SIZE + payload_size;
|
||||
}
|
||||
|
||||
uint8_t parse_source(const struct can_frame& frame) {
|
||||
return ((frame.can_id >> def::MESSAGE_HEADER_SRCADDR_BIT_SHIFT) & 0xFF);
|
||||
}
|
||||
|
||||
uint16_t parse_msg_type(const struct can_frame& frame) {
|
||||
uint16_t retval;
|
||||
memcpy(&retval, &frame.data[2], sizeof(retval));
|
||||
|
||||
return be16toh(retval);
|
||||
}
|
||||
|
||||
} // namespace can::protocol::dpm1000
|
||||
@@ -0,0 +1,13 @@
|
||||
add_executable(dpm1000_tester)
|
||||
target_sources(dpm1000_tester
|
||||
PRIVATE
|
||||
dpm1000_tester.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(dpm1000_tester
|
||||
PRIVATE
|
||||
can_protocols::dpm1000
|
||||
Threads::Threads
|
||||
)
|
||||
|
||||
target_compile_features(dpm1000_tester PRIVATE cxx_std_17)
|
||||
@@ -0,0 +1,346 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright Pionix GmbH and Contributors to EVerest
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <future>
|
||||
#include <mutex>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <poll.h>
|
||||
#include <sys/eventfd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <everest/can/protocol/dpm1000.hpp>
|
||||
|
||||
namespace dpm1000 = can::protocol::dpm1000;
|
||||
|
||||
static void exit_with_error(const char* msg) {
|
||||
fprintf(stderr, "%s (%s)\n", msg, strerror(errno));
|
||||
exit(-EXIT_FAILURE);
|
||||
}
|
||||
|
||||
template <typename EnumType> static inline auto to_underlying(EnumType value) {
|
||||
return static_cast<std::underlying_type_t<EnumType>>(value);
|
||||
}
|
||||
|
||||
struct CanRequest {
|
||||
enum class State {
|
||||
IDLE,
|
||||
ISSUED,
|
||||
COMPLETED,
|
||||
FAILED,
|
||||
} state{State::IDLE};
|
||||
|
||||
uint16_t msg_type;
|
||||
std::array<uint8_t, 4> response;
|
||||
std::condition_variable cv;
|
||||
std::mutex mutex;
|
||||
};
|
||||
|
||||
class CanBroker {
|
||||
public:
|
||||
enum class AccessReturnType {
|
||||
SUCCESS,
|
||||
FAILED,
|
||||
TIMEOUT,
|
||||
NOT_READY,
|
||||
};
|
||||
CanBroker(const std::string& interface_name);
|
||||
|
||||
AccessReturnType read_data(dpm1000::def::ReadValueType, float& result);
|
||||
AccessReturnType set_data(dpm1000::def::SetValueType, float value);
|
||||
void enable();
|
||||
|
||||
~CanBroker();
|
||||
|
||||
private:
|
||||
constexpr static auto ACCESS_TIMEOUT = std::chrono::milliseconds(250);
|
||||
void loop();
|
||||
|
||||
void write_to_can(const struct can_frame& frame);
|
||||
AccessReturnType dispatch_frame(const struct can_frame& frame, uint16_t id, uint32_t* result = nullptr);
|
||||
|
||||
void handle_can_input(const struct can_frame& frame);
|
||||
|
||||
bool device_found{false};
|
||||
uint8_t device_src;
|
||||
|
||||
std::mutex access_mtx;
|
||||
CanRequest request;
|
||||
|
||||
const uint8_t monitor_id{0xf0};
|
||||
|
||||
std::thread loop_thread;
|
||||
|
||||
int event_fd{-1};
|
||||
int can_fd{-1};
|
||||
};
|
||||
|
||||
CanBroker::CanBroker(const std::string& interface_name) {
|
||||
can_fd = socket(PF_CAN, SOCK_RAW, CAN_RAW);
|
||||
|
||||
if (can_fd == -1) {
|
||||
exit_with_error("Failed to open socket");
|
||||
}
|
||||
|
||||
// retrieve interface index from interface name
|
||||
struct ifreq ifr;
|
||||
|
||||
if (interface_name.size() >= sizeof(ifr.ifr_name)) {
|
||||
exit_with_error("Interface name too long.");
|
||||
} else {
|
||||
strcpy(ifr.ifr_name, interface_name.c_str());
|
||||
}
|
||||
|
||||
if (ioctl(can_fd, SIOCGIFINDEX, &ifr) == -1) {
|
||||
exit_with_error("Failed with ioctl/SIOCGIFINDEX");
|
||||
}
|
||||
|
||||
// bind to the interface
|
||||
struct sockaddr_can addr;
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.can_family = AF_CAN;
|
||||
addr.can_ifindex = ifr.ifr_ifindex;
|
||||
|
||||
if (bind(can_fd, reinterpret_cast<struct sockaddr*>(&addr), sizeof(addr)) == -1) {
|
||||
exit_with_error("Failed with bind");
|
||||
}
|
||||
|
||||
event_fd = eventfd(0, 0);
|
||||
|
||||
loop_thread = std::thread(&CanBroker::loop, this);
|
||||
}
|
||||
|
||||
CanBroker::~CanBroker() {
|
||||
uint64_t quit_value = 1;
|
||||
write(event_fd, &quit_value, sizeof(quit_value));
|
||||
|
||||
loop_thread.join();
|
||||
|
||||
close(can_fd);
|
||||
close(event_fd);
|
||||
}
|
||||
|
||||
void CanBroker::loop() {
|
||||
std::array<struct pollfd, 2> pollfds = {{
|
||||
{can_fd, POLLIN, 0},
|
||||
{event_fd, POLLIN, 0},
|
||||
}};
|
||||
|
||||
while (true) {
|
||||
const auto poll_result = poll(pollfds.data(), pollfds.size(), -1);
|
||||
|
||||
if (poll_result == 0) {
|
||||
// timeout
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pollfds[0].revents & POLLIN) {
|
||||
struct can_frame frame;
|
||||
read(can_fd, &frame, sizeof(frame));
|
||||
|
||||
if (device_found) {
|
||||
handle_can_input(frame);
|
||||
} else {
|
||||
device_src = dpm1000::parse_source(frame);
|
||||
device_found = true;
|
||||
printf("Found device with source number %02X\n", device_src);
|
||||
}
|
||||
}
|
||||
|
||||
if (pollfds[1].revents & POLLIN) {
|
||||
uint64_t tmp;
|
||||
read(event_fd, &tmp, sizeof(tmp));
|
||||
// new event, for now, we do not care, later on we could check, if it is an exit event code
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CanBroker::enable() {
|
||||
struct can_frame frame;
|
||||
dpm1000::power_on(frame, true, true);
|
||||
dpm1000::set_header(frame, monitor_id, device_src);
|
||||
|
||||
write_to_can(frame);
|
||||
}
|
||||
|
||||
CanBroker::AccessReturnType CanBroker::dispatch_frame(const struct can_frame& frame, uint16_t id,
|
||||
uint32_t* return_payload) {
|
||||
if (not device_found) {
|
||||
return AccessReturnType::NOT_READY;
|
||||
}
|
||||
|
||||
// wait until we get access
|
||||
std::lock_guard<std::mutex> access_lock(access_mtx);
|
||||
|
||||
std::unique_lock<std::mutex> request_lock(request.mutex);
|
||||
write_to_can(frame);
|
||||
request.msg_type = id;
|
||||
request.state = CanRequest::State::ISSUED;
|
||||
|
||||
const auto finished = request.cv.wait_for(request_lock, ACCESS_TIMEOUT,
|
||||
[this]() { return request.state != CanRequest::State::ISSUED; });
|
||||
|
||||
if (not finished) {
|
||||
return AccessReturnType::TIMEOUT;
|
||||
}
|
||||
|
||||
if (request.state == CanRequest::State::FAILED) {
|
||||
return AccessReturnType::FAILED;
|
||||
}
|
||||
|
||||
// success
|
||||
if (return_payload) {
|
||||
memcpy(return_payload, request.response.data(), sizeof(std::remove_pointer_t<decltype(return_payload)>));
|
||||
}
|
||||
|
||||
return AccessReturnType::SUCCESS;
|
||||
}
|
||||
|
||||
CanBroker::AccessReturnType CanBroker::read_data(dpm1000::def::ReadValueType value_type, float& result) {
|
||||
const auto id = static_cast<std::underlying_type_t<decltype(value_type)>>(value_type);
|
||||
|
||||
struct can_frame frame;
|
||||
dpm1000::request_data(frame, value_type);
|
||||
dpm1000::set_header(frame, monitor_id, device_src);
|
||||
|
||||
uint32_t tmp;
|
||||
const auto status = dispatch_frame(frame, id, &tmp);
|
||||
|
||||
if (status == AccessReturnType::SUCCESS) {
|
||||
memcpy(&result, &tmp, sizeof(result));
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
CanBroker::AccessReturnType CanBroker::set_data(dpm1000::def::SetValueType value_type, float payload) {
|
||||
const auto id = static_cast<std::underlying_type_t<decltype(value_type)>>(value_type);
|
||||
|
||||
uint8_t raw_payload[sizeof(payload)];
|
||||
memcpy(raw_payload, &payload, sizeof(payload));
|
||||
|
||||
struct can_frame frame;
|
||||
dpm1000::set_data(frame, value_type, {raw_payload[3], raw_payload[2], raw_payload[1], raw_payload[0]});
|
||||
dpm1000::set_header(frame, monitor_id, device_src);
|
||||
|
||||
return dispatch_frame(frame, id);
|
||||
}
|
||||
|
||||
void CanBroker::write_to_can(const struct can_frame& frame) {
|
||||
write(can_fd, &frame, sizeof(frame));
|
||||
}
|
||||
|
||||
void CanBroker::handle_can_input(const struct can_frame& frame) {
|
||||
if (((frame.can_id >> dpm1000::def::MESSAGE_HEADER_BIT_SHIFT) & dpm1000::def::MESSAGE_HEADER_MASK) !=
|
||||
dpm1000::def::MESSAGE_HEADER) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> request_lock(request.mutex);
|
||||
if ((request.state != CanRequest::State::ISSUED) or (request.msg_type != dpm1000::parse_msg_type(frame))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (dpm1000::is_error_flag_set(frame)) {
|
||||
request.state = CanRequest::State::FAILED;
|
||||
} else {
|
||||
// this is ugly
|
||||
for (auto i = 0; i < request.response.size(); ++i) {
|
||||
request.response[i] = frame.data[7 - i];
|
||||
}
|
||||
request.state = CanRequest::State::COMPLETED;
|
||||
}
|
||||
|
||||
request_lock.unlock();
|
||||
request.cv.notify_one();
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
struct can_frame frame;
|
||||
|
||||
CanBroker broker("can0");
|
||||
float result;
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
broker.enable();
|
||||
|
||||
// voltage 300 - 1000
|
||||
// current 0 - 2
|
||||
|
||||
// while (1) {
|
||||
auto success = broker.set_data(dpm1000::def::SetValueType::VOLTAGE, 1000);
|
||||
printf("Voltage setting success: %d\n", to_underlying(success));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
success = broker.set_data(dpm1000::def::SetValueType::CURRENT_LIMIT, 0);
|
||||
printf("Current setting success: %d\n", to_underlying(success));
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
// }
|
||||
|
||||
broker.read_data(dpm1000::def::ReadValueType::VOLTAGE_LIMIT, result);
|
||||
printf("Upper limit point voltage: %f\n", result);
|
||||
|
||||
broker.read_data(dpm1000::def::ReadValueType::CURRENT_LIMIT, result);
|
||||
printf("Current limit: %f\n", result);
|
||||
|
||||
broker.read_data(dpm1000::def::ReadValueType::VOLTAGE, result);
|
||||
printf("Default Voltage: %f\n", result);
|
||||
|
||||
broker.read_data(dpm1000::def::ReadValueType::ENV_TEMPERATURE, result);
|
||||
printf("Env temp: %f\n", result);
|
||||
|
||||
broker.read_data(dpm1000::def::ReadValueType::CURRENT, result);
|
||||
printf("Current: %f\n", result);
|
||||
|
||||
broker.read_data(dpm1000::def::ReadValueType::VOLTAGE, result);
|
||||
printf("Voltage: %f\n", result);
|
||||
|
||||
broker.read_data(dpm1000::def::ReadValueType::AC_VOLTAGE_PHASE_A, result);
|
||||
printf("Voltage PH1: %f\n", result);
|
||||
broker.read_data(dpm1000::def::ReadValueType::AC_VOLTAGE_PHASE_B, result);
|
||||
printf("Voltage PH2: %f\n", result);
|
||||
broker.read_data(dpm1000::def::ReadValueType::AC_VOLTAGE_PHASE_C, result);
|
||||
printf("Voltage PH3: %f\n", result);
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
return 0;
|
||||
|
||||
// dpm1000::power_on(frame, false, false);
|
||||
dpm1000::request_data(frame, dpm1000::def::ReadValueType::CURRENT_LIMIT);
|
||||
// dpm1000::set_data(frame, dpm1000::def::SetValueType::CURRENT_LIMIT, {0x23, 0x24});
|
||||
dpm1000::set_header(frame, 0xf0, 0b00000100);
|
||||
|
||||
printf("frame is %08X#", frame.can_id);
|
||||
for (auto i = 0; i < sizeof(frame.data); ++i) {
|
||||
printf("%02X", frame.data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
printf("frame length: %d\n", frame.can_dlc);
|
||||
|
||||
float foo = 5.0;
|
||||
uint32_t bar;
|
||||
memcpy(&bar, &foo, sizeof(foo));
|
||||
printf("float repr is %08lX\n", (unsigned long)bar);
|
||||
// printf("Answer is %d\n", dpm1000::dumb_function());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// can0 07078023 [8] 01 F0 10 00 00 00 00 00
|
||||
// 0b1110000 | 0 | 11110000 | 00000100 | 011
|
||||
|
||||
// 0607FF83
|
||||
// 0b1100000 | 0 | 11111111 | 11110000 | 011
|
||||
|
||||
// request: 0b1000 | 01100000 | 1 | 00000100 | 11110000 | 011
|
||||
|
||||
// 060F8023 [8] C1 F2 03 00 00 00 00 00 -> error bit, response request,
|
||||
// 0b1100000 | 1 | 11110000 | 00000100 | 011
|
||||
// can0 07078023 [8] 02 F0 01 00 00 00 00 00
|
||||
138
tools/EVerest-main/lib/everest/cbv2g/.clang-format
Normal file
138
tools/EVerest-main/lib/everest/cbv2g/.clang-format
Normal file
@@ -0,0 +1,138 @@
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveMacros: true
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: false
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Attach
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: true
|
||||
DeriveLineEnding: true
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
SortPriority: 0
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
SortPriority: 0
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
SortPriority: 0
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
IndentCaseLabels: false
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInConditionalStatement: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
SpaceBeforeSquareBrackets: false
|
||||
Standard: Latest
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 8
|
||||
UseCRLF: false
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
1
tools/EVerest-main/lib/everest/cbv2g/.github/CODEOWNERS
vendored
Normal file
1
tools/EVerest-main/lib/everest/cbv2g/.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* @SebaLukas @a-w50 @barsnick @chausGit
|
||||
2
tools/EVerest-main/lib/everest/cbv2g/.gitignore
vendored
Normal file
2
tools/EVerest-main/lib/everest/cbv2g/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*build
|
||||
.vscode
|
||||
76
tools/EVerest-main/lib/everest/cbv2g/BUILD.bazel
Normal file
76
tools/EVerest-main/lib/everest/cbv2g/BUILD.bazel
Normal file
@@ -0,0 +1,76 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
_INCLUDES = ["include"]
|
||||
|
||||
cc_library(
|
||||
name = "exi_codec",
|
||||
srcs = [
|
||||
"lib/cbv2g/common/exi_basetypes.c",
|
||||
"lib/cbv2g/common/exi_basetypes_decoder.c",
|
||||
"lib/cbv2g/common/exi_basetypes_encoder.c",
|
||||
"lib/cbv2g/common/exi_bitstream.c",
|
||||
"lib/cbv2g/common/exi_header.c",
|
||||
"lib/cbv2g/common/exi_types_decoder.c",
|
||||
],
|
||||
hdrs = glob(["include/cbv2g/common/*.h"]),
|
||||
includes = _INCLUDES,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
_APP_HANDSHAKE_SRCS = [
|
||||
"lib/cbv2g/app_handshake/appHand_Datatypes.c",
|
||||
"lib/cbv2g/app_handshake/appHand_Decoder.c",
|
||||
"lib/cbv2g/app_handshake/appHand_Encoder.c",
|
||||
]
|
||||
|
||||
cc_library(
|
||||
name = "din",
|
||||
srcs = _APP_HANDSHAKE_SRCS + [
|
||||
"lib/cbv2g/din/din_msgDefDatatypes.c",
|
||||
"lib/cbv2g/din/din_msgDefDecoder.c",
|
||||
"lib/cbv2g/din/din_msgDefEncoder.c",
|
||||
],
|
||||
hdrs = glob([
|
||||
"include/cbv2g/app_handshake/*.h",
|
||||
"include/cbv2g/din/*.h",
|
||||
]),
|
||||
includes = _INCLUDES,
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [":exi_codec"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "iso2",
|
||||
srcs = _APP_HANDSHAKE_SRCS + [
|
||||
"lib/cbv2g/iso_2/iso2_msgDefDatatypes.c",
|
||||
"lib/cbv2g/iso_2/iso2_msgDefDecoder.c",
|
||||
"lib/cbv2g/iso_2/iso2_msgDefEncoder.c",
|
||||
],
|
||||
hdrs = glob([
|
||||
"include/cbv2g/app_handshake/*.h",
|
||||
"include/cbv2g/iso_2/*.h",
|
||||
]),
|
||||
includes = _INCLUDES,
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [":exi_codec"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "iso20",
|
||||
srcs = _APP_HANDSHAKE_SRCS + glob(["lib/cbv2g/iso_20/*.c"]),
|
||||
hdrs = glob([
|
||||
"include/cbv2g/app_handshake/*.h",
|
||||
"include/cbv2g/iso_20/*.h",
|
||||
]),
|
||||
includes = _INCLUDES,
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [":exi_codec"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "tp",
|
||||
srcs = ["lib/cbv2g/exi_v2gtp.c"],
|
||||
hdrs = ["include/cbv2g/exi_v2gtp.h"],
|
||||
includes = _INCLUDES,
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
66
tools/EVerest-main/lib/everest/cbv2g/CMakeLists.txt
Normal file
66
tools/EVerest-main/lib/everest/cbv2g/CMakeLists.txt
Normal file
@@ -0,0 +1,66 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(cb_v2g
|
||||
VERSION 0.3.1
|
||||
DESCRIPTION "V2GTP EXI library"
|
||||
HOMEPAGE_URL "https://github.com/Everest/libcbv2g"
|
||||
LANGUAGES C CXX
|
||||
)
|
||||
|
||||
find_package(everest-cmake 0.5
|
||||
PATHS ../everest-cmake
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
find_package(everest-cmake 0.5)
|
||||
|
||||
if (NOT everest-cmake_FOUND)
|
||||
message(STATUS "Retrieving everest-cmake using FetchContent")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
everest-cmake
|
||||
GIT_REPOSITORY https://github.com/EVerest/everest-cmake.git
|
||||
GIT_TAG v0.5.4
|
||||
)
|
||||
FetchContent_MakeAvailable(everest-cmake)
|
||||
set(everest-cmake_DIR "${everest-cmake_SOURCE_DIR}")
|
||||
include("${everest-cmake_SOURCE_DIR}/everest-cmake-config.cmake")
|
||||
endif()
|
||||
|
||||
# options
|
||||
option(CB_V2G_INSTALL "Install the library (shared data might be installed anyway)" ${EVC_MAIN_PROJECT})
|
||||
|
||||
add_subdirectory(lib)
|
||||
|
||||
message(STATUS "library code based on cbexigen generator version: 871fcb3")
|
||||
|
||||
# tests
|
||||
if (CB_V2G_BUILD_TESTS)
|
||||
include(CTest)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
# packaging
|
||||
if (CB_V2G_INSTALL)
|
||||
install(
|
||||
TARGETS
|
||||
cbv2g_exi_codec
|
||||
cbv2g_din
|
||||
cbv2g_iso2
|
||||
cbv2g_iso20
|
||||
cbv2g_tp
|
||||
EXPORT cbv2g-targets
|
||||
LIBRARY
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY include/
|
||||
TYPE INCLUDE
|
||||
)
|
||||
|
||||
evc_setup_package(
|
||||
NAME cbv2g
|
||||
NAMESPACE cbv2g
|
||||
EXPORT cbv2g-targets
|
||||
)
|
||||
endif()
|
||||
|
||||
201
tools/EVerest-main/lib/everest/cbv2g/LICENSE
Normal file
201
tools/EVerest-main/lib/everest/cbv2g/LICENSE
Normal file
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
22
tools/EVerest-main/lib/everest/cbv2g/README.md
Normal file
22
tools/EVerest-main/lib/everest/cbv2g/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# libcbV2G - The V2GTP EXI codec library
|
||||
|
||||
libcbv2g is a library to encode and decode EXI messages and is able to process DIN70121, ISO15118-2 and ISO15118-20 messages. The library is based on the generated code output of the [cbExiGen](https://github.com/Everest/cbexigen) generator.
|
||||
|
||||
All documentation and the issue tracking can be found in our main repository here: https://github.com/EVerest/everest
|
||||
|
||||
## Dependencies
|
||||
|
||||
To build this library you need [everest-cmake](https://github.com/EVerest/everest-cmake) checkout in the same directory as libcbV2G.
|
||||
|
||||
## Getting started
|
||||
|
||||
```
|
||||
# Run cmake (CB_V2G_BUILD_TESTS to enable/disable unit tests)
|
||||
cmake -S . -B build -G Ninja -DCB_V2G_BUILD_TESTS=1 -DCMAKE_EXPORT_COMPILE_COMMANDS=1
|
||||
|
||||
# Build
|
||||
ninja -C build
|
||||
|
||||
# Running tests
|
||||
ninja -C build test
|
||||
```
|
||||
1
tools/EVerest-main/lib/everest/cbv2g/THIRD_PARTY.md
Normal file
1
tools/EVerest-main/lib/everest/cbv2g/THIRD_PARTY.md
Normal file
@@ -0,0 +1 @@
|
||||
_Use this file to list out any third-party dependencies used by this project. You may choose to point to a Gemfile or other language specific packaging file for details._
|
||||
@@ -0,0 +1,120 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file appHand_Datatypes.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef APP_HANDSHAKE_DATATYPES_H
|
||||
#define APP_HANDSHAKE_DATATYPES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
#define appHand_ProtocolNamespace_CHARACTER_SIZE (100)
|
||||
#define appHand_AppProtocolType_5_ARRAY_SIZE (5)
|
||||
|
||||
|
||||
// enum for function numbers
|
||||
typedef enum {
|
||||
appHand_supportedAppProtocolReq = 0,
|
||||
appHand_supportedAppProtocolRes = 1
|
||||
} appHand_generatedFunctionNumbersType;
|
||||
|
||||
// Element: definition=enum; name=ResponseCode; type={urn:iso:15118:2:2010:AppProtocol}responseCodeType; base type=string; content type=simple;
|
||||
// abstract=False; final=False; derivation=restriction;
|
||||
typedef enum {
|
||||
appHand_responseCodeType_OK_SuccessfulNegotiation = 0,
|
||||
appHand_responseCodeType_OK_SuccessfulNegotiationWithMinorDeviation = 1,
|
||||
appHand_responseCodeType_Failed_NoNegotiation = 2
|
||||
} appHand_responseCodeType;
|
||||
|
||||
// Element: definition=complex; name=AppProtocol; type={urn:iso:15118:2:2010:AppProtocol}AppProtocolType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: ProtocolNamespace, protocolNamespaceType (1, 1); VersionNumberMajor, unsignedInt (1, 1); VersionNumberMinor, unsignedInt (1, 1); SchemaID, idType (1, 1); Priority, priorityType (1, 1);
|
||||
struct appHand_AppProtocolType {
|
||||
// ProtocolNamespace, protocolNamespaceType (base: anyURI)
|
||||
struct {
|
||||
char characters[appHand_ProtocolNamespace_CHARACTER_SIZE];
|
||||
uint16_t charactersLen;
|
||||
} ProtocolNamespace;
|
||||
// VersionNumberMajor, unsignedInt (base: unsignedLong)
|
||||
uint32_t VersionNumberMajor;
|
||||
// VersionNumberMinor, unsignedInt (base: unsignedLong)
|
||||
uint32_t VersionNumberMinor;
|
||||
// SchemaID, idType (base: unsignedByte)
|
||||
uint8_t SchemaID;
|
||||
// Priority, priorityType (base: unsignedByte)
|
||||
uint8_t Priority;
|
||||
|
||||
};
|
||||
|
||||
// Element: definition=complex; name={urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq; type=AnonymousType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: AppProtocol, AppProtocolType (1, 5) (original max 20);
|
||||
struct appHand_supportedAppProtocolReq {
|
||||
// AppProtocol, AppProtocolType
|
||||
struct {
|
||||
struct appHand_AppProtocolType array[appHand_AppProtocolType_5_ARRAY_SIZE];
|
||||
uint16_t arrayLen;
|
||||
} AppProtocol;
|
||||
};
|
||||
|
||||
// Element: definition=complex; name={urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes; type=AnonymousType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: ResponseCode, responseCodeType (1, 1); SchemaID, idType (0, 1);
|
||||
struct appHand_supportedAppProtocolRes {
|
||||
// ResponseCode, responseCodeType (base: string)
|
||||
appHand_responseCodeType ResponseCode;
|
||||
// SchemaID, idType (base: unsignedByte)
|
||||
uint8_t SchemaID;
|
||||
unsigned int SchemaID_isUsed:1;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
struct appHand_exiDocument {
|
||||
union {
|
||||
struct appHand_supportedAppProtocolReq supportedAppProtocolReq;
|
||||
struct appHand_supportedAppProtocolRes supportedAppProtocolRes;
|
||||
};
|
||||
unsigned int supportedAppProtocolReq_isUsed:1;
|
||||
unsigned int supportedAppProtocolRes_isUsed:1;
|
||||
};
|
||||
|
||||
// init for structs
|
||||
void init_appHand_exiDocument(struct appHand_exiDocument* exiDoc);
|
||||
void init_appHand_supportedAppProtocolReq(struct appHand_supportedAppProtocolReq* supportedAppProtocolReq);
|
||||
void init_appHand_supportedAppProtocolRes(struct appHand_supportedAppProtocolRes* supportedAppProtocolRes);
|
||||
void init_appHand_AppProtocolType(struct appHand_AppProtocolType* AppProtocolType);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APP_HANDSHAKE_DATATYPES_H */
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file appHand_Decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef APP_HANDSHAKE_DECODER_H
|
||||
#define APP_HANDSHAKE_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_basetypes.h"
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "appHand_Datatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_appHand_exiDocument(exi_bitstream_t* stream, struct appHand_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APP_HANDSHAKE_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file appHand_Encoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef APP_HANDSHAKE_ENCODER_H
|
||||
#define APP_HANDSHAKE_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_basetypes.h"
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "appHand_Datatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_appHand_exiDocument(exi_bitstream_t* stream, struct appHand_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* APP_HANDSHAKE_ENCODER_H */
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_basetypes.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_BASETYPES_H
|
||||
#define EXI_BASETYPES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
// TODO: delete me later! just for compiling the still not reworked parts.
|
||||
#define EXI_ELEMENT_STACK_SIZE 24
|
||||
#define EXTRA_CHAR 1
|
||||
//
|
||||
|
||||
#define ASCII_EXTRA_CHAR 1
|
||||
#define ASCII_CHAR_TERMINATOR '\0'
|
||||
|
||||
#define EXI_STRING_MAX_LEN 64
|
||||
#define EXI_BYTE_ARRAY_MAX_LEN 350
|
||||
|
||||
// To support EXI integer 8/7 coding, this needs to be 8/7 of the desired
|
||||
// size of 25 for EXI representation
|
||||
#define EXI_BASETYPES_MAX_OCTETS_SUPPORTED 29
|
||||
|
||||
#define EXI_BASETYPES_OCTET_SEQ_FLAG_MASK 0x80
|
||||
#define EXI_BASETYPES_OCTET_SEQ_VALUE_MASK 0x7F
|
||||
|
||||
#define EXI_BASETYPES_UINT8_MAX_OCTETS 2
|
||||
#define EXI_BASETYPES_UINT16_MAX_OCTETS 3
|
||||
#define EXI_BASETYPES_UINT32_MAX_OCTETS 5
|
||||
#define EXI_BASETYPES_UINT64_MAX_OCTETS 10
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t octets_size;
|
||||
uint8_t* octets;
|
||||
size_t octets_count;
|
||||
} exi_binary_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t octets[EXI_BASETYPES_MAX_OCTETS_SUPPORTED];
|
||||
size_t octets_count;
|
||||
} exi_unsigned_t;
|
||||
|
||||
typedef struct exi_signed_t
|
||||
{
|
||||
exi_unsigned_t data;
|
||||
uint8_t is_negative : 1;
|
||||
} exi_signed_t;
|
||||
|
||||
typedef char exi_character_t;
|
||||
|
||||
int exi_basetypes_convert_to_unsigned(exi_unsigned_t* exi_unsigned, uint32_t value, size_t max_octets);
|
||||
int exi_basetypes_convert_64_to_unsigned(exi_unsigned_t* exi_unsigned, uint64_t value);
|
||||
|
||||
int exi_basetypes_convert_from_unsigned(const exi_unsigned_t* exi_unsigned, uint32_t* value, size_t max_octets);
|
||||
int exi_basetypes_convert_64_from_unsigned(const exi_unsigned_t* exi_unsigned, uint64_t* value);
|
||||
|
||||
int exi_basetypes_convert_to_signed(exi_signed_t* exi_signed, int32_t value, size_t max_octets);
|
||||
int exi_basetypes_convert_64_to_signed(exi_signed_t* exi_signed, int64_t value);
|
||||
|
||||
int exi_basetypes_convert_from_signed(const exi_signed_t* exi_unsigned, int32_t* value, size_t max_octets);
|
||||
int exi_basetypes_convert_64_from_signed(const exi_signed_t* exi_unsigned, int64_t* value);
|
||||
|
||||
int exi_basetypes_convert_bytes_from_unsigned(const exi_unsigned_t* exi_unsigned, uint8_t* data, size_t* data_len, size_t data_size);
|
||||
int exi_basetypes_convert_bytes_to_unsigned(exi_unsigned_t* exi_unsigned, const uint8_t* data, size_t data_len);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_BASETYPES_H */
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_basetypes_decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_BASETYPES_DECODER_H
|
||||
#define EXI_BASETYPES_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "exi_basetypes.h"
|
||||
#include "exi_bitstream.h"
|
||||
|
||||
|
||||
/**
|
||||
* \brief decoder for type bool
|
||||
*
|
||||
* reads a boolean value from the bitstream and decodes it into value.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value decoded value
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_decoder_bool(exi_bitstream_t* stream, int* value);
|
||||
|
||||
/**
|
||||
* \brief decoder for type byte array
|
||||
*
|
||||
* reads a bytes from the bitstream and writes it to the array.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param bytes_len length of the used bytes inside the array
|
||||
* \param bytes pointer to the first byte of the array
|
||||
* \param bytes_size size of the byte array
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_decoder_bytes(exi_bitstream_t* stream, size_t bytes_len, uint8_t* bytes, size_t bytes_size);
|
||||
|
||||
/**
|
||||
* \brief decoder for n-bit unsigned integer
|
||||
*
|
||||
* reads n-bits from the bitstream end decodes it into an unsigned integer value.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param bit_count number of bits to read from the stream
|
||||
* \param value Value into which the bit_count bits are decoded
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_decoder_nbit_uint(exi_bitstream_t* stream, size_t bit_count, uint32_t* value);
|
||||
|
||||
/**
|
||||
* \brief decoder for type unsigned integer
|
||||
*
|
||||
* this description applies to the specified functions, as only the value type is different.
|
||||
* reads an unsigned integer value from the bitstream and decodes it into value.
|
||||
* this decoder is for unsigned integer values with no restriction or having a value > 4096.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value decoded value
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_decoder_uint_8(exi_bitstream_t* stream, uint8_t* value);
|
||||
int exi_basetypes_decoder_uint_16(exi_bitstream_t* stream, uint16_t* value);
|
||||
int exi_basetypes_decoder_uint_32(exi_bitstream_t* stream, uint32_t* value);
|
||||
int exi_basetypes_decoder_uint_64(exi_bitstream_t* stream, uint64_t* value);
|
||||
int exi_basetypes_decoder_unsigned(exi_bitstream_t* stream, exi_unsigned_t* value);
|
||||
|
||||
/**
|
||||
* \brief decoder for type integer
|
||||
*
|
||||
* this description applies to the specified functions, as only the value type is different.
|
||||
* reads an integer value from the bitstream and decodes it into value.
|
||||
* this decoder is for integer values with no restriction or having a value > 4096.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value decoded value
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_decoder_integer_8(exi_bitstream_t* stream, int8_t* value);
|
||||
int exi_basetypes_decoder_integer_16(exi_bitstream_t* stream, int16_t* value);
|
||||
int exi_basetypes_decoder_integer_32(exi_bitstream_t* stream, int32_t* value);
|
||||
int exi_basetypes_decoder_integer_64(exi_bitstream_t* stream, int64_t* value);
|
||||
int exi_basetypes_decoder_signed(exi_bitstream_t* stream, exi_signed_t* value);
|
||||
|
||||
/**
|
||||
* \brief decoder for type character array
|
||||
*
|
||||
* reads a characters from the bitstream and writes it to the array.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param bytes_len length of the used characters inside the array
|
||||
* \param bytes pointer to the first character of the array
|
||||
* \param bytes_size size of the character array
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_decoder_characters(exi_bitstream_t* stream, size_t characters_len, exi_character_t* characters, size_t characters_size);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_BASETYPES_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_basetypes_encoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_BASETYPES_ENCODER_H
|
||||
#define EXI_BASETYPES_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "exi_basetypes.h"
|
||||
#include "exi_bitstream.h"
|
||||
|
||||
|
||||
/**
|
||||
* \brief encoder for type bool
|
||||
*
|
||||
* encodes a boolean value and writes it to the bitstream.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value value to encode
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_encoder_bool(exi_bitstream_t* stream, int value);
|
||||
|
||||
/**
|
||||
* \brief encoder for type byte array
|
||||
*
|
||||
* encodes a byte array and writes it to the bitstream.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param bytes_len length of the used bytes inside the array
|
||||
* \param bytes pointer to the first byte of the array
|
||||
* \param bytes_size size of the byte array
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_encoder_bytes(exi_bitstream_t* stream, size_t bytes_len, const uint8_t* bytes, size_t bytes_size);
|
||||
|
||||
/**
|
||||
* \brief encoder for n-bit unsigned integer
|
||||
*
|
||||
* encodes a n-bit unsigned value and writes it to the bitstream.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param bit_count number of bit representing the value
|
||||
* \param value Value from which the bit_count least significant bits are to be encoded
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_encoder_nbit_uint(exi_bitstream_t* stream, size_t bit_count, uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief encoder for type unsigned integer
|
||||
*
|
||||
* this description applies to the specified functions, as only the value type is different.
|
||||
* encodes an unsigned integer value and writes it to the bitstream.
|
||||
* this encoder is for uint values with no restriction or having a value < 4096.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value value to encode
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_encoder_uint_8(exi_bitstream_t* stream, uint8_t value);
|
||||
int exi_basetypes_encoder_uint_16(exi_bitstream_t* stream, uint16_t value);
|
||||
int exi_basetypes_encoder_uint_32(exi_bitstream_t* stream, uint32_t value);
|
||||
int exi_basetypes_encoder_uint_64(exi_bitstream_t* stream, uint64_t value);
|
||||
int exi_basetypes_encoder_unsigned(exi_bitstream_t* stream, const exi_unsigned_t* value);
|
||||
|
||||
/**
|
||||
* \brief encoder for type integer
|
||||
*
|
||||
* this description applies to the specified functions, as only the value type is different.
|
||||
* encodes an integer value and writes it to the bitstream.
|
||||
* this encoder is for int values with no restriction or having a value < 4096.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value value to encode
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_encoder_integer_8(exi_bitstream_t* stream, int8_t value);
|
||||
int exi_basetypes_encoder_integer_16(exi_bitstream_t* stream, int16_t value);
|
||||
int exi_basetypes_encoder_integer_32(exi_bitstream_t* stream, int32_t value);
|
||||
int exi_basetypes_encoder_integer_64(exi_bitstream_t* stream, int64_t value);
|
||||
int exi_basetypes_encoder_signed(exi_bitstream_t* stream, const exi_signed_t* value);
|
||||
|
||||
/**
|
||||
* \brief encoder for type exi_character array
|
||||
*
|
||||
* encodes an exi_character (char) array and writes it to the bitstream.
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param bytes_len length of the used characters inside the array
|
||||
* \param bytes pointer to the first character of the array
|
||||
* \param bytes_size size of the character array
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_basetypes_encoder_characters(exi_bitstream_t* stream, size_t characters_len, const exi_character_t* characters, size_t characters_size);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_BASETYPES_ENCODER_H */
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_bitstream.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_BITSTREAM_H
|
||||
#define EXI_BITSTREAM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#define EXI_BITSTREAM_MAX_BIT_COUNT 8
|
||||
|
||||
|
||||
typedef void (*exi_status_callback)(int message_id, int status_code, int value_1, int value_2);
|
||||
|
||||
typedef struct exi_bitstream {
|
||||
/* byte array size and data */
|
||||
uint8_t* data;
|
||||
size_t data_size;
|
||||
|
||||
/* byte array current byte and bit position in array */
|
||||
uint8_t bit_count;
|
||||
size_t byte_pos;
|
||||
|
||||
/* flags for reset and length function */
|
||||
uint8_t _init_called;
|
||||
size_t _flag_byte_pos;
|
||||
|
||||
/* Pointer to callback for reporting errors or logging if assigned */
|
||||
exi_status_callback status_callback;
|
||||
} exi_bitstream_t;
|
||||
|
||||
|
||||
/**
|
||||
* \brief bitstream init
|
||||
*
|
||||
* Initializes the exi bitstream with the given parameters.
|
||||
*
|
||||
* \param stream input or output stream
|
||||
* \param data pointer to EXI data
|
||||
* \param data_size size of EXI data
|
||||
* \param data_offset start of payload inside EXI data
|
||||
* \param status_callback pointer to callback function for error reporting or logging
|
||||
*
|
||||
*/
|
||||
void exi_bitstream_init(exi_bitstream_t* stream, uint8_t* data, size_t data_size, size_t data_offset, exi_status_callback status_callback);
|
||||
|
||||
/**
|
||||
* \brief bitstream reset
|
||||
*
|
||||
* Resets the exi bitstream to the parameters from the last init state.
|
||||
*
|
||||
* \param stream input or output stream
|
||||
*
|
||||
*/
|
||||
void exi_bitstream_reset(exi_bitstream_t* stream);
|
||||
|
||||
/**
|
||||
* \brief bitstream get length
|
||||
*
|
||||
* Returns the length of the stream.
|
||||
*
|
||||
* \param stream output Stream
|
||||
* \return length of stream
|
||||
*
|
||||
*/
|
||||
size_t exi_bitstream_get_length(const exi_bitstream_t* stream);
|
||||
|
||||
/**
|
||||
* \brief bitstream write bits
|
||||
*
|
||||
* Write the bit_count bits of value to the stream.
|
||||
*
|
||||
* \param stream output Stream
|
||||
* \param bit_count number of bits to write
|
||||
* \param value value to write
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_bitstream_write_bits(exi_bitstream_t* stream, size_t bit_count, uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief bitstream write octet
|
||||
*
|
||||
* write an octet to the stream.
|
||||
*
|
||||
* \param stream output Stream
|
||||
* \param value write octet value
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_bitstream_write_octet(exi_bitstream_t* stream, uint8_t value);
|
||||
|
||||
/**
|
||||
* \brief bitstream read bits
|
||||
*
|
||||
* read the bit_count bits from the stream and return the result.
|
||||
*
|
||||
* \param stream input Stream
|
||||
* \param bit_count number of bits to read
|
||||
* \param value read value
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_bitstream_read_bits(exi_bitstream_t* stream, size_t bit_count, uint32_t* value);
|
||||
|
||||
/**
|
||||
* \brief bitstream read octet
|
||||
*
|
||||
* read an octet from the stream and return the result.
|
||||
*
|
||||
* \param stream input Stream
|
||||
* \param value read octet value
|
||||
* \return NO_ERROR or error code
|
||||
*
|
||||
*/
|
||||
int exi_bitstream_read_octet(exi_bitstream_t* stream, uint8_t* value);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_BITSTREAM_H */
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_error_codes.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_ERROR_CODES_H
|
||||
#define EXI_ERROR_CODES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define EXI_ERROR__NO_ERROR 0
|
||||
|
||||
// stream processing -1 to -19
|
||||
#define EXI_ERROR__BITSTREAM_OVERFLOW -1
|
||||
|
||||
// stream header -20 to -29
|
||||
#define EXI_ERROR__HEADER_COOKIE_NOT_SUPPORTED -20
|
||||
#define EXI_ERROR__HEADER_OPTIONS_NOT_SUPPORTED -21
|
||||
#define EXI_ERROR__HEADER_INCORRECT -22
|
||||
|
||||
// stream read -30 to -39
|
||||
#define EXI_ERROR__SUPPORTED_MAX_OCTETS_OVERRUN -30
|
||||
#define EXI_ERROR__OCTET_COUNT_LARGER_THAN_TYPE_SUPPORTS -31
|
||||
|
||||
// stream write -40 to -49
|
||||
|
||||
// decoder -50 to -69
|
||||
#define EXI_ERROR__UNKNOWN_EVENT_FOR_DECODING -50
|
||||
#define EXI_ERROR__DECODER_NOT_IMPLEMENTED -69
|
||||
|
||||
// encoder -70 to -89
|
||||
#define EXI_ERROR__UNKNOWN_EVENT_FOR_ENCODING -70
|
||||
#define EXI_ERROR__ENCODER_NOT_IMPLEMENTED -89
|
||||
|
||||
// common errors -100 to -129
|
||||
#define EXI_ERROR__BIT_COUNT_LARGER_THAN_TYPE_SIZE -100
|
||||
#define EXI_ERROR__BYTE_COUNT_LARGER_THAN_TYPE_SIZE -101
|
||||
#define EXI_ERROR__ARRAY_OUT_OF_BOUNDS -110
|
||||
#define EXI_ERROR__CHARACTER_BUFFER_TOO_SMALL -111
|
||||
#define EXI_ERROR__BYTE_BUFFER_TOO_SMALL -112
|
||||
#define EXI_ERROR__ENCODED_INTEGER_SIZE_LARGER_THAN_DESTINATION -113
|
||||
|
||||
// grammar errors -130 to -149
|
||||
#define EXI_ERROR__UNKNOWN_GRAMMAR_ID -130
|
||||
|
||||
// event errors -150 to -169
|
||||
#define EXI_ERROR__UNKNOWN_EVENT_CODE -150
|
||||
#define EXI_ERROR__UNSUPPORTED_SUB_EVENT -151
|
||||
|
||||
// document errors -170 to -199
|
||||
#define EXI_ERROR__DEVIANTS_NOT_SUPPORTED -170
|
||||
|
||||
// datatype errors -200 to -229
|
||||
#define EXI_ERROR__STRINGVALUES_NOT_SUPPORTED -200
|
||||
|
||||
#define EXI_ERROR__UNSUPPORTED_INTEGER_VALUE_TYPE -210
|
||||
#define EXI_ERROR__UNSUPPORTED_DATETIME_TYPE -211
|
||||
#define EXI_ERROR__UNSUPPORTED_CHARACTER_VALUE -212
|
||||
|
||||
// fragment errors -230 to -259
|
||||
#define EXI_ERROR__INCORRECT_END_FRAGMENT_VALUE -230
|
||||
|
||||
// internal errors
|
||||
#define EXI_ERROR__NOT_IMPLEMENTED_YET -299
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_ERROR_CODES_H */
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_header.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_HEADER_H
|
||||
#define EXI_HEADER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include "exi_bitstream.h"
|
||||
|
||||
|
||||
#define EXI_SIMPLE_HEADER_BIT_SIZE 8
|
||||
#define EXI_SIMPLE_HEADER_VALUE 0x80
|
||||
|
||||
|
||||
/**
|
||||
* \brief Writes a simple EXI header (0x80)
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \return NO_ERROR or an error code
|
||||
*
|
||||
*/
|
||||
int exi_header_write(exi_bitstream_t* stream);
|
||||
|
||||
/**
|
||||
* \brief Reads the simple EXI header
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param header EXI simple header value from the stream
|
||||
* \return NO_ERROR or an error code
|
||||
*
|
||||
*/
|
||||
int exi_header_read(exi_bitstream_t* stream, uint32_t* header);
|
||||
|
||||
/**
|
||||
* \brief Reads and checks the simple EXI header
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \return NO_ERROR or an error code
|
||||
*
|
||||
*/
|
||||
int exi_header_read_and_check(exi_bitstream_t* stream);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_HEADER_H */
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_types_decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_TYPES_DECODER_H
|
||||
#define EXI_TYPES_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include "exi_basetypes.h"
|
||||
#include "exi_bitstream.h"
|
||||
|
||||
|
||||
/**
|
||||
* \brief Decode hexBinary
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value_len uint16_t (out) used length of decoded value
|
||||
* \param value_buffer byte buffer (out) decoded value
|
||||
* \param value_buffer_size size of the buffer
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_hex_binary(exi_bitstream_t* stream, uint16_t* value_len, uint8_t* value_buffer, size_t value_buffer_size);
|
||||
|
||||
/**
|
||||
* \brief Decode 8-bit integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value int8_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_integer8(exi_bitstream_t* stream, int8_t* value);
|
||||
|
||||
/**
|
||||
* \brief Decode 16-bit integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value int16_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_integer16(exi_bitstream_t* stream, int16_t* value);
|
||||
|
||||
/**
|
||||
* \brief Decode 32-bit integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value int32_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_integer32(exi_bitstream_t* stream, int32_t* value);
|
||||
|
||||
/**
|
||||
* \brief Decode 64-bit integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value int64_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_integer64(exi_bitstream_t* stream, int64_t* value);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Decode 8-bit unsigned integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value uint8_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_uint8(exi_bitstream_t* stream, uint8_t* value);
|
||||
|
||||
/**
|
||||
* \brief Decode 16-bit unsigned integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value uint16_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_uint16(exi_bitstream_t* stream, uint16_t* value);
|
||||
|
||||
/**
|
||||
* \brief Decode 32-bit unsigned integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value uint32_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_uint32(exi_bitstream_t* stream, uint32_t* value);
|
||||
|
||||
/**
|
||||
* \brief Decode 64-bit unsigned integer
|
||||
*
|
||||
* \param stream EXI bitstream
|
||||
* \param value uint64_t (out) decoded value
|
||||
* \return Error-Code <> 0, if no error 0
|
||||
*
|
||||
*/
|
||||
int decode_exi_type_uint64(exi_bitstream_t* stream, uint64_t* value);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_TYPES_DECODER_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file din_msgDefDecoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef DIN_MSG_DEF_DECODER_H
|
||||
#define DIN_MSG_DEF_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "cbv2g/din/din_msgDefDatatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_din_exiDocument(exi_bitstream_t* stream, struct din_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* DIN_MSG_DEF_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file din_msgDefEncoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef DIN_MSG_DEF_ENCODER_H
|
||||
#define DIN_MSG_DEF_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "cbv2g/din/din_msgDefDatatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_din_exiDocument(exi_bitstream_t* stream, struct din_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* DIN_MSG_DEF_ENCODER_H */
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_v2gtp.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef EXI_V2GTP_H
|
||||
#define EXI_V2GTP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/*====================================================================*
|
||||
* error defines;
|
||||
*--------------------------------------------------------------------*/
|
||||
#define V2GTP_ERROR__NO_ERROR 0
|
||||
#define V2GTP_ERROR__VERSION_DOES_NOT_MATCH -1
|
||||
#define V2GTP_ERROR__PAYLOAD_ID_DOES_NOT_MATCH -2
|
||||
|
||||
/*====================================================================*
|
||||
* global defines;
|
||||
*--------------------------------------------------------------------*/
|
||||
#define V2GTP_HEADER_LENGTH 8u
|
||||
|
||||
#define V2GTP20_SAP_PAYLOAD_ID 0x8001u
|
||||
#define V2GTP20_MAINSTREAM_PAYLOAD_ID 0x8002u
|
||||
#define V2GTP20_AC_MAINSTREAM_PAYLOAD_ID 0x8003u
|
||||
#define V2GTP20_DC_MAINSTREAM_PAYLOAD_ID 0x8004u
|
||||
#define V2GTP20_ACDP_MAINSTREAM_PAYLOAD_ID 0x8005u
|
||||
#define V2GTP20_WPT_MAINSTREAM_PAYLOAD_ID 0x8006u
|
||||
|
||||
#define V2GTP20_SCHEDULE_RENEGOTIATION_PAYLOAD_ID 0x8101u
|
||||
#define V2GTP20_METERING_CONFIRMATION_PAYLOAD_ID 0x8102u
|
||||
#define V2GTP20_ACDP_SYSTEM_STATUS_PAYLOAD_ID 0x8103u
|
||||
#define V2GTP20_PARKING_STATUS_PAYLOAD_ID 0x8104u
|
||||
|
||||
#define V2GTP20_SDP_REQUEST_PAYLOAD_ID 0x9000u
|
||||
#define V2GTP20_SDP_RESPONSE_PAYLOAD_ID 0x9001u
|
||||
#define V2GTP20_SDP_REQUEST_WIRELESS_PAYLOAD_ID 0x9002u
|
||||
#define V2GTP20_SDP_RESPONSE_WIRELESS_PAYLOAD_ID 0x9003u
|
||||
|
||||
/*====================================================================*
|
||||
* interface
|
||||
*--------------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief Writes the V2GTP Header and the given payload length into the data stream
|
||||
* 2nd function is the -20 version with different payload ids.
|
||||
*
|
||||
* @retval void
|
||||
*
|
||||
*/
|
||||
void V2GTP_WriteHeader(uint8_t* stream_data, uint32_t stream_payload_length);
|
||||
void V2GTP20_WriteHeader(uint8_t* stream_data, uint32_t stream_payload_length, uint16_t v2gtp20_payload_id);
|
||||
|
||||
/**
|
||||
* @brief Verifies the V2GTP Header and returns the payload length from the data stream
|
||||
* 2nd function is the -20 version with different payload ids.
|
||||
*
|
||||
* @retval on success V2GTP_ERROR__NO_ERROR otherwise an error code
|
||||
*
|
||||
*/
|
||||
int V2GTP_ReadHeader(const uint8_t* stream_data, uint32_t* stream_payload_length);
|
||||
int V2GTP20_ReadHeader(const uint8_t* stream_data, uint32_t* stream_payload_length, uint16_t v2gtp20_payload_id);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EXI_V2GTP_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso2_msgDefDecoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO2_MSG_DEF_DECODER_H
|
||||
#define ISO2_MSG_DEF_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso2_msgDefDatatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_iso2_exiDocument(exi_bitstream_t* stream, struct iso2_exiDocument* exiDoc);
|
||||
// decoding function for fragment
|
||||
int decode_iso2_exiFragment(exi_bitstream_t* stream, struct iso2_exiFragment* exiFrag);
|
||||
// decoding function for xmldsig fragment
|
||||
int decode_iso2_xmldsigFragment(exi_bitstream_t* stream, struct iso2_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO2_MSG_DEF_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso2_msgDefEncoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO2_MSG_DEF_ENCODER_H
|
||||
#define ISO2_MSG_DEF_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso2_msgDefDatatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_iso2_exiDocument(exi_bitstream_t* stream, struct iso2_exiDocument* exiDoc);
|
||||
// encoding function for fragment
|
||||
int encode_iso2_exiFragment(exi_bitstream_t* stream, struct iso2_exiFragment* exiFrag);
|
||||
// encoding function for xmldsig fragment
|
||||
int encode_iso2_xmldsigFragment(exi_bitstream_t* stream, struct iso2_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO2_MSG_DEF_ENCODER_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_ACDP_Decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_ACDP_DECODER_H
|
||||
#define ISO20_ACDP_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_ACDP_Datatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_iso20_acdp_exiDocument(exi_bitstream_t* stream, struct iso20_acdp_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_ACDP_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_ACDP_Encoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_ACDP_ENCODER_H
|
||||
#define ISO20_ACDP_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_ACDP_Datatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_iso20_acdp_exiDocument(exi_bitstream_t* stream, struct iso20_acdp_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_ACDP_ENCODER_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_AC_Decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_AC_DECODER_H
|
||||
#define ISO20_AC_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_AC_Datatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_iso20_ac_exiDocument(exi_bitstream_t* stream, struct iso20_ac_exiDocument* exiDoc);
|
||||
// decoding function for fragment
|
||||
int decode_iso20_ac_exiFragment(exi_bitstream_t* stream, struct iso20_ac_exiFragment* exiFrag);
|
||||
// decoding function for xmldsig fragment
|
||||
int decode_iso20_ac_xmldsigFragment(exi_bitstream_t* stream, struct iso20_ac_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_AC_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_AC_Encoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_AC_ENCODER_H
|
||||
#define ISO20_AC_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_AC_Datatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_iso20_ac_exiDocument(exi_bitstream_t* stream, struct iso20_ac_exiDocument* exiDoc);
|
||||
// encoding function for fragment
|
||||
int encode_iso20_ac_exiFragment(exi_bitstream_t* stream, struct iso20_ac_exiFragment* exiFrag);
|
||||
// encoding function for xmldsig fragment
|
||||
int encode_iso20_ac_xmldsigFragment(exi_bitstream_t* stream, struct iso20_ac_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_AC_ENCODER_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_CommonMessages_Decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_COMMON_MESSAGES_DECODER_H
|
||||
#define ISO20_COMMON_MESSAGES_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_CommonMessages_Datatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_iso20_exiDocument(exi_bitstream_t* stream, struct iso20_exiDocument* exiDoc);
|
||||
// decoding function for fragment
|
||||
int decode_iso20_exiFragment(exi_bitstream_t* stream, struct iso20_exiFragment* exiFrag);
|
||||
// decoding function for xmldsig fragment
|
||||
int decode_iso20_xmldsigFragment(exi_bitstream_t* stream, struct iso20_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_COMMON_MESSAGES_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_CommonMessages_Encoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_COMMON_MESSAGES_ENCODER_H
|
||||
#define ISO20_COMMON_MESSAGES_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_CommonMessages_Datatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_iso20_exiDocument(exi_bitstream_t* stream, struct iso20_exiDocument* exiDoc);
|
||||
// encoding function for fragment
|
||||
int encode_iso20_exiFragment(exi_bitstream_t* stream, struct iso20_exiFragment* exiFrag);
|
||||
// encoding function for xmldsig fragment
|
||||
int encode_iso20_xmldsigFragment(exi_bitstream_t* stream, struct iso20_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_COMMON_MESSAGES_ENCODER_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_DC_Decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_DC_DECODER_H
|
||||
#define ISO20_DC_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_DC_Datatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_iso20_dc_exiDocument(exi_bitstream_t* stream, struct iso20_dc_exiDocument* exiDoc);
|
||||
// decoding function for fragment
|
||||
int decode_iso20_dc_exiFragment(exi_bitstream_t* stream, struct iso20_dc_exiFragment* exiFrag);
|
||||
// decoding function for xmldsig fragment
|
||||
int decode_iso20_dc_xmldsigFragment(exi_bitstream_t* stream, struct iso20_dc_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_DC_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_DC_Encoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_DC_ENCODER_H
|
||||
#define ISO20_DC_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_DC_Datatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_iso20_dc_exiDocument(exi_bitstream_t* stream, struct iso20_dc_exiDocument* exiDoc);
|
||||
// encoding function for fragment
|
||||
int encode_iso20_dc_exiFragment(exi_bitstream_t* stream, struct iso20_dc_exiFragment* exiFrag);
|
||||
// encoding function for xmldsig fragment
|
||||
int encode_iso20_dc_xmldsigFragment(exi_bitstream_t* stream, struct iso20_dc_xmldsigFragment* xmldsigFrag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_DC_ENCODER_H */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_WPT_Decoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_WPT_DECODER_H
|
||||
#define ISO20_WPT_DECODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_WPT_Datatypes.h"
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_iso20_wpt_exiDocument(exi_bitstream_t* stream, struct iso20_wpt_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_WPT_DECODER_H */
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_WPT_Encoder.h
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#ifndef ISO20_WPT_ENCODER_H
|
||||
#define ISO20_WPT_ENCODER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "iso20_WPT_Datatypes.h"
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_iso20_wpt_exiDocument(exi_bitstream_t* stream, struct iso20_wpt_exiDocument* exiDoc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ISO20_WPT_ENCODER_H */
|
||||
|
||||
1
tools/EVerest-main/lib/everest/cbv2g/lib/CMakeLists.txt
Normal file
1
tools/EVerest-main/lib/everest/cbv2g/lib/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(cbv2g)
|
||||
133
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/CMakeLists.txt
Normal file
133
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/CMakeLists.txt
Normal file
@@ -0,0 +1,133 @@
|
||||
add_library(cbv2g_exi_codec)
|
||||
add_library(cbv2g::exi_codec ALIAS cbv2g_exi_codec)
|
||||
set_property(TARGET cbv2g_exi_codec PROPERTY EXPORT_NAME exi_codec)
|
||||
|
||||
target_sources(cbv2g_exi_codec
|
||||
PRIVATE
|
||||
common/exi_basetypes_decoder.c
|
||||
common/exi_basetypes_encoder.c
|
||||
common/exi_basetypes.c
|
||||
common/exi_bitstream.c
|
||||
common/exi_header.c
|
||||
common/exi_types_decoder.c
|
||||
)
|
||||
|
||||
target_include_directories(cbv2g_exi_codec
|
||||
INTERFACE
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
PRIVATE
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
target_compile_features(cbv2g_exi_codec PRIVATE c_std_99)
|
||||
|
||||
add_library(cbv2g_din)
|
||||
add_library(cbv2g::din ALIAS cbv2g_din)
|
||||
set_property(TARGET cbv2g_din PROPERTY EXPORT_NAME din)
|
||||
|
||||
target_sources(cbv2g_din
|
||||
PRIVATE
|
||||
app_handshake/appHand_Datatypes.c
|
||||
app_handshake/appHand_Decoder.c
|
||||
app_handshake/appHand_Encoder.c
|
||||
din/din_msgDefDatatypes.c
|
||||
din/din_msgDefDecoder.c
|
||||
din/din_msgDefEncoder.c
|
||||
)
|
||||
|
||||
target_include_directories(cbv2g_din
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
target_link_libraries(cbv2g_din
|
||||
PUBLIC
|
||||
cbv2g::exi_codec
|
||||
)
|
||||
|
||||
target_compile_features(cbv2g_din PUBLIC c_std_99)
|
||||
|
||||
add_library(cbv2g_iso2)
|
||||
add_library(cbv2g::iso2 ALIAS cbv2g_iso2)
|
||||
set_property(TARGET cbv2g_iso2 PROPERTY EXPORT_NAME iso2)
|
||||
|
||||
target_sources(cbv2g_iso2
|
||||
PRIVATE
|
||||
app_handshake/appHand_Datatypes.c
|
||||
app_handshake/appHand_Decoder.c
|
||||
app_handshake/appHand_Encoder.c
|
||||
iso_2/iso2_msgDefDatatypes.c
|
||||
iso_2/iso2_msgDefDecoder.c
|
||||
iso_2/iso2_msgDefEncoder.c
|
||||
)
|
||||
|
||||
target_include_directories(cbv2g_iso2
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
target_link_libraries(cbv2g_iso2
|
||||
PUBLIC
|
||||
cbv2g::exi_codec
|
||||
)
|
||||
|
||||
target_compile_features(cbv2g_iso2 PUBLIC c_std_99)
|
||||
|
||||
add_library(cbv2g_iso20)
|
||||
add_library(cbv2g::iso20 ALIAS cbv2g_iso20)
|
||||
set_property(TARGET cbv2g_iso20 PROPERTY EXPORT_NAME iso20)
|
||||
|
||||
target_sources(cbv2g_iso20
|
||||
PRIVATE
|
||||
app_handshake/appHand_Datatypes.c
|
||||
app_handshake/appHand_Decoder.c
|
||||
app_handshake/appHand_Encoder.c
|
||||
iso_20/iso20_AC_Datatypes.c
|
||||
iso_20/iso20_AC_Decoder.c
|
||||
iso_20/iso20_AC_Encoder.c
|
||||
iso_20/iso20_ACDP_Datatypes.c
|
||||
iso_20/iso20_ACDP_Decoder.c
|
||||
iso_20/iso20_ACDP_Encoder.c
|
||||
iso_20/iso20_CommonMessages_Datatypes.c
|
||||
iso_20/iso20_CommonMessages_Decoder.c
|
||||
iso_20/iso20_CommonMessages_Encoder.c
|
||||
iso_20/iso20_DC_Datatypes.c
|
||||
iso_20/iso20_DC_Decoder.c
|
||||
iso_20/iso20_DC_Encoder.c
|
||||
iso_20/iso20_WPT_Datatypes.c
|
||||
iso_20/iso20_WPT_Decoder.c
|
||||
iso_20/iso20_WPT_Encoder.c
|
||||
)
|
||||
|
||||
target_include_directories(cbv2g_iso20
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
target_link_libraries(cbv2g_iso20
|
||||
PUBLIC
|
||||
cbv2g::exi_codec
|
||||
)
|
||||
|
||||
target_compile_features(cbv2g_iso20 PUBLIC c_std_99)
|
||||
|
||||
add_library(cbv2g_tp)
|
||||
add_library(cbv2g::tp ALIAS cbv2g_tp)
|
||||
set_property(TARGET cbv2g_tp PROPERTY EXPORT_NAME tp)
|
||||
|
||||
|
||||
target_sources(cbv2g_tp
|
||||
PRIVATE
|
||||
exi_v2gtp.c
|
||||
)
|
||||
|
||||
target_include_directories(cbv2g_tp
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
)
|
||||
|
||||
target_compile_features(cbv2g_tp PUBLIC c_std_99)
|
||||
@@ -0,0 +1,42 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file appHand_Datatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/app_handshake/appHand_Datatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_appHand_exiDocument(struct appHand_exiDocument* exiDoc) {
|
||||
exiDoc->supportedAppProtocolReq_isUsed = 0u;
|
||||
exiDoc->supportedAppProtocolRes_isUsed = 0u;
|
||||
}
|
||||
void init_appHand_AppProtocolType(struct appHand_AppProtocolType* AppProtocolType) {
|
||||
(void) AppProtocolType;
|
||||
}
|
||||
|
||||
void init_appHand_supportedAppProtocolReq(struct appHand_supportedAppProtocolReq* supportedAppProtocolReq) {
|
||||
supportedAppProtocolReq->AppProtocol.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_appHand_supportedAppProtocolRes(struct appHand_supportedAppProtocolRes* supportedAppProtocolRes) {
|
||||
supportedAppProtocolRes->SchemaID_isUsed = 0u;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,600 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file appHand_Decoder.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cbv2g/common/exi_basetypes.h"
|
||||
#include "cbv2g/common/exi_basetypes_decoder.h"
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
#include "cbv2g/common/exi_header.h"
|
||||
#include "cbv2g/common/exi_types_decoder.h"
|
||||
#include "cbv2g/app_handshake/appHand_Datatypes.h"
|
||||
#include "cbv2g/app_handshake/appHand_Decoder.h"
|
||||
|
||||
|
||||
|
||||
static int decode_appHand_AppProtocolType(exi_bitstream_t* stream, struct appHand_AppProtocolType* AppProtocolType);
|
||||
static int decode_appHand_supportedAppProtocolReq(exi_bitstream_t* stream, struct appHand_supportedAppProtocolReq* supportedAppProtocolReq);
|
||||
static int decode_appHand_supportedAppProtocolRes(exi_bitstream_t* stream, struct appHand_supportedAppProtocolRes* supportedAppProtocolRes);
|
||||
|
||||
// Element: definition=complex; name=AppProtocol; type={urn:iso:15118:2:2010:AppProtocol}AppProtocolType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: ProtocolNamespace, protocolNamespaceType (1, 1); VersionNumberMajor, unsignedInt (1, 1); VersionNumberMinor, unsignedInt (1, 1); SchemaID, idType (1, 1); Priority, priorityType (1, 1);
|
||||
static int decode_appHand_AppProtocolType(exi_bitstream_t* stream, struct appHand_AppProtocolType* AppProtocolType) {
|
||||
int grammar_id = 0;
|
||||
int done = 0;
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
init_appHand_AppProtocolType(AppProtocolType);
|
||||
|
||||
while (!done)
|
||||
{
|
||||
switch (grammar_id)
|
||||
{
|
||||
case 0:
|
||||
// Grammar: ID=0; read/write bits=1; START (ProtocolNamespace)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (ProtocolNamespace, protocolNamespaceType (anyURI)); next=1
|
||||
// decode: string (len, characters)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_uint_16(stream, &AppProtocolType->ProtocolNamespace.charactersLen);
|
||||
if (error == 0)
|
||||
{
|
||||
if (AppProtocolType->ProtocolNamespace.charactersLen >= 2)
|
||||
{
|
||||
// string tables and table partitions are not supported, so the length has to be decremented by 2
|
||||
AppProtocolType->ProtocolNamespace.charactersLen -= 2;
|
||||
error = exi_basetypes_decoder_characters(stream, AppProtocolType->ProtocolNamespace.charactersLen, AppProtocolType->ProtocolNamespace.characters, appHand_ProtocolNamespace_CHARACTER_SIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// the string seems to be in the table, but this is not supported
|
||||
error = EXI_ERROR__STRINGVALUES_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// second level event is not supported
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
// if nothing went wrong, the error of exi_basetypes_decoder_characters is evaluated here
|
||||
if (error == 0)
|
||||
{
|
||||
// END Element for simple type
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
grammar_id = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// Grammar: ID=1; read/write bits=1; START (VersionNumberMajor)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (VersionNumberMajor, unsignedInt (unsignedLong)); next=2
|
||||
// decode: unsigned int
|
||||
error = decode_exi_type_uint32(stream, &AppProtocolType->VersionNumberMajor);
|
||||
if (error == 0)
|
||||
{
|
||||
grammar_id = 2;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// Grammar: ID=2; read/write bits=1; START (VersionNumberMinor)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (VersionNumberMinor, unsignedInt (unsignedLong)); next=3
|
||||
// decode: unsigned int
|
||||
error = decode_exi_type_uint32(stream, &AppProtocolType->VersionNumberMinor);
|
||||
if (error == 0)
|
||||
{
|
||||
grammar_id = 3;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// Grammar: ID=3; read/write bits=1; START (SchemaID)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (SchemaID, idType (unsignedByte)); next=4
|
||||
// decode: restricted integer (4096 or fewer values)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
uint32_t value;
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 8, &value);
|
||||
if (error == 0)
|
||||
{
|
||||
AppProtocolType->SchemaID = (uint8_t)value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// second level event is not supported
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
// if nothing went wrong, the error of exi_basetypes_decoder_nbit_uint is evaluated here
|
||||
if (error == 0)
|
||||
{
|
||||
// END Element for simple type
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
grammar_id = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
// Grammar: ID=4; read/write bits=1; START (Priority)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (Priority, priorityType (unsignedByte)); next=5
|
||||
// decode: restricted integer (4096 or fewer values)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
uint32_t value;
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 5, &value);
|
||||
if (error == 0)
|
||||
{
|
||||
// type has min_value = 1
|
||||
AppProtocolType->Priority = (uint8_t)(value + 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// second level event is not supported
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
// if nothing went wrong, the error of exi_basetypes_decoder_nbit_uint is evaluated here
|
||||
if (error == 0)
|
||||
{
|
||||
// END Element for simple type
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
grammar_id = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// Grammar: ID=5; read/write bits=1; END Element
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_GRAMMAR_ID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
// Element: definition=complex; name={urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq; type=AnonymousType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: AppProtocol, AppProtocolType (1, 5) (original max 20);
|
||||
static int decode_appHand_supportedAppProtocolReq(exi_bitstream_t* stream, struct appHand_supportedAppProtocolReq* supportedAppProtocolReq) {
|
||||
int grammar_id = 7;
|
||||
int done = 0;
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
init_appHand_supportedAppProtocolReq(supportedAppProtocolReq);
|
||||
|
||||
while (!done)
|
||||
{
|
||||
switch (grammar_id)
|
||||
{
|
||||
case 7:
|
||||
// Grammar: ID=7; read/write bits=1; START (AppProtocol)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (AppProtocol, AppProtocolType (AppProtocolType)); next=8
|
||||
// decode: element array
|
||||
if (supportedAppProtocolReq->AppProtocol.arrayLen < appHand_AppProtocolType_5_ARRAY_SIZE)
|
||||
{
|
||||
error = decode_appHand_AppProtocolType(stream, &supportedAppProtocolReq->AppProtocol.array[supportedAppProtocolReq->AppProtocol.arrayLen++]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// static array not large enough, only appHand_AppProtocolType_5_ARRAY_SIZE elements
|
||||
error = EXI_ERROR__ARRAY_OUT_OF_BOUNDS;
|
||||
}
|
||||
grammar_id = 8;
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
// Grammar: ID=8; read/write bits=2; LOOP (AppProtocol), END Element
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 2, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: LOOP (AppProtocol, AppProtocolType (AppProtocolType)); next=8
|
||||
// decode: element array
|
||||
if (supportedAppProtocolReq->AppProtocol.arrayLen < appHand_AppProtocolType_5_ARRAY_SIZE)
|
||||
{
|
||||
error = decode_appHand_AppProtocolType(stream, &supportedAppProtocolReq->AppProtocol.array[supportedAppProtocolReq->AppProtocol.arrayLen++]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// static array not large enough, only appHand_AppProtocolType_5_ARRAY_SIZE elements
|
||||
error = EXI_ERROR__ARRAY_OUT_OF_BOUNDS;
|
||||
}
|
||||
// LOOP breakout code for schema given maximum, regardless of ARRAY_SIZE definition
|
||||
if (supportedAppProtocolReq->AppProtocol.arrayLen < 20)
|
||||
{
|
||||
grammar_id = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
grammar_id = 5;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// Grammar: ID=5; read/write bits=1; END Element
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_GRAMMAR_ID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
// Element: definition=complex; name={urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes; type=AnonymousType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: ResponseCode, responseCodeType (1, 1); SchemaID, idType (0, 1);
|
||||
static int decode_appHand_supportedAppProtocolRes(exi_bitstream_t* stream, struct appHand_supportedAppProtocolRes* supportedAppProtocolRes) {
|
||||
int grammar_id = 9;
|
||||
int done = 0;
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
init_appHand_supportedAppProtocolRes(supportedAppProtocolRes);
|
||||
|
||||
while (!done)
|
||||
{
|
||||
switch (grammar_id)
|
||||
{
|
||||
case 9:
|
||||
// Grammar: ID=9; read/write bits=1; START (ResponseCode)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (ResponseCode, responseCodeType (string)); next=10
|
||||
// decode: enum
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
uint32_t value;
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 2, &value);
|
||||
if (error == 0)
|
||||
{
|
||||
supportedAppProtocolRes->ResponseCode = (appHand_responseCodeType)value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// second level event is not supported
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
// if nothing went wrong, the error of exi_basetypes_decoder_nbit_uint is evaluated here
|
||||
if (error == 0)
|
||||
{
|
||||
// END Element for simple type
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
grammar_id = 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
// Grammar: ID=10; read/write bits=2; START (SchemaID), END Element
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 2, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: START (SchemaID, idType (unsignedByte)); next=5
|
||||
// decode: restricted integer (4096 or fewer values)
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
uint32_t value;
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 8, &value);
|
||||
if (error == 0)
|
||||
{
|
||||
supportedAppProtocolRes->SchemaID = (uint8_t)value;
|
||||
supportedAppProtocolRes->SchemaID_isUsed = 1u;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// second level event is not supported
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
// if nothing went wrong, the error of exi_basetypes_decoder_nbit_uint is evaluated here
|
||||
if (error == 0)
|
||||
{
|
||||
// END Element for simple type
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
grammar_id = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// Grammar: ID=5; read/write bits=1; END Element
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_GRAMMAR_ID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
// main function for decoding
|
||||
int decode_appHand_exiDocument(exi_bitstream_t* stream, struct appHand_exiDocument* exiDoc) {
|
||||
uint32_t eventCode;
|
||||
int error = exi_header_read_and_check(stream);
|
||||
|
||||
if (error == 0)
|
||||
{
|
||||
init_appHand_exiDocument(exiDoc);
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 2, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
switch (eventCode)
|
||||
{
|
||||
case 0:
|
||||
error = decode_appHand_supportedAppProtocolReq(stream, &exiDoc->supportedAppProtocolReq);
|
||||
exiDoc->supportedAppProtocolReq_isUsed = 1u;
|
||||
break;
|
||||
case 1:
|
||||
error = decode_appHand_supportedAppProtocolRes(stream, &exiDoc->supportedAppProtocolRes);
|
||||
exiDoc->supportedAppProtocolRes_isUsed = 1u;
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,395 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file appHand_Encoder.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include <stdint.h>
|
||||
|
||||
#include "cbv2g/common/exi_basetypes_encoder.h"
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
#include "cbv2g/common/exi_header.h"
|
||||
#include "cbv2g/app_handshake/appHand_Datatypes.h"
|
||||
#include "cbv2g/app_handshake/appHand_Encoder.h"
|
||||
|
||||
|
||||
|
||||
static int encode_appHand_AppProtocolType(exi_bitstream_t* stream, const struct appHand_AppProtocolType* AppProtocolType);
|
||||
static int encode_appHand_supportedAppProtocolReq(exi_bitstream_t* stream, const struct appHand_supportedAppProtocolReq* supportedAppProtocolReq);
|
||||
static int encode_appHand_supportedAppProtocolRes(exi_bitstream_t* stream, const struct appHand_supportedAppProtocolRes* supportedAppProtocolRes);
|
||||
|
||||
// Element: definition=complex; name=AppProtocol; type={urn:iso:15118:2:2010:AppProtocol}AppProtocolType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: ProtocolNamespace, protocolNamespaceType (1, 1); VersionNumberMajor, unsignedInt (1, 1); VersionNumberMinor, unsignedInt (1, 1); SchemaID, idType (1, 1); Priority, priorityType (1, 1);
|
||||
static int encode_appHand_AppProtocolType(exi_bitstream_t* stream, const struct appHand_AppProtocolType* AppProtocolType) {
|
||||
int grammar_id = 0;
|
||||
int done = 0;
|
||||
int error = 0;
|
||||
|
||||
while (!done)
|
||||
{
|
||||
switch (grammar_id)
|
||||
{
|
||||
case 0:
|
||||
// Grammar: ID=0; read/write bits=1; START (ProtocolNamespace)
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (anyURI); next=1
|
||||
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// string should not be found in table, so add 2
|
||||
error = exi_basetypes_encoder_uint_16(stream, (uint16_t)(AppProtocolType->ProtocolNamespace.charactersLen + 2));
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = exi_basetypes_encoder_characters(stream, AppProtocolType->ProtocolNamespace.charactersLen, AppProtocolType->ProtocolNamespace.characters, appHand_ProtocolNamespace_CHARACTER_SIZE);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// encode END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// Grammar: ID=1; read/write bits=1; START (VersionNumberMajor)
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (unsignedLong); next=2
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = exi_basetypes_encoder_uint_32(stream, AppProtocolType->VersionNumberMajor);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// encode END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// Grammar: ID=2; read/write bits=1; START (VersionNumberMinor)
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (unsignedLong); next=3
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = exi_basetypes_encoder_uint_32(stream, AppProtocolType->VersionNumberMinor);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// encode END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
// Grammar: ID=3; read/write bits=1; START (SchemaID)
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (unsignedByte); next=4
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 8, (uint32_t)AppProtocolType->SchemaID);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// encode END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
// Grammar: ID=4; read/write bits=1; START (Priority)
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (unsignedByte); next=5
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 5, (uint32_t)AppProtocolType->Priority - 1);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// encode END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// Grammar: ID=5; read/write bits=1; END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_GRAMMAR_ID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
// Element: definition=complex; name={urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq; type=AnonymousType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: AppProtocol, AppProtocolType (1, 5) (original max 20);
|
||||
static int encode_appHand_supportedAppProtocolReq(exi_bitstream_t* stream, const struct appHand_supportedAppProtocolReq* supportedAppProtocolReq) {
|
||||
int grammar_id = 7;
|
||||
int done = 0;
|
||||
int error = 0;
|
||||
uint16_t AppProtocol_currentIndex = 0;
|
||||
|
||||
while (!done)
|
||||
{
|
||||
switch (grammar_id)
|
||||
{
|
||||
case 7:
|
||||
// Grammar: ID=7; read/write bits=1; START (AppProtocol)
|
||||
if (AppProtocol_currentIndex < supportedAppProtocolReq->AppProtocol.arrayLen)
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (AppProtocolType); next=8
|
||||
error = encode_appHand_AppProtocolType(stream, &supportedAppProtocolReq->AppProtocol.array[AppProtocol_currentIndex++]);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_CODE;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
// Grammar: ID=8; read/write bits=2; LOOP (AppProtocol), END Element
|
||||
if (AppProtocol_currentIndex < supportedAppProtocolReq->AppProtocol.arrayLen)
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 2, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: LOOP (AppProtocolType); next=8
|
||||
error = encode_appHand_AppProtocolType(stream, &supportedAppProtocolReq->AppProtocol.array[AppProtocol_currentIndex++]);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 2, 1);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// Grammar: ID=5; read/write bits=1; END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_GRAMMAR_ID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
// Element: definition=complex; name={urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes; type=AnonymousType; base type=; content type=ELEMENT-ONLY;
|
||||
// abstract=False; final=False;
|
||||
// Particle: ResponseCode, responseCodeType (1, 1); SchemaID, idType (0, 1);
|
||||
static int encode_appHand_supportedAppProtocolRes(exi_bitstream_t* stream, const struct appHand_supportedAppProtocolRes* supportedAppProtocolRes) {
|
||||
int grammar_id = 9;
|
||||
int done = 0;
|
||||
int error = 0;
|
||||
|
||||
while (!done)
|
||||
{
|
||||
switch (grammar_id)
|
||||
{
|
||||
case 9:
|
||||
// Grammar: ID=9; read/write bits=1; START (ResponseCode)
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (string); next=10
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 2, supportedAppProtocolRes->ResponseCode);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// encode END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
// Grammar: ID=10; read/write bits=2; START (SchemaID), END Element
|
||||
if (supportedAppProtocolRes->SchemaID_isUsed == 1u)
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 2, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: START (SchemaID, unsignedByte); next=5
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 8, (uint32_t)supportedAppProtocolRes->SchemaID);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// encode END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
grammar_id = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 2, 1);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
// Grammar: ID=5; read/write bits=1; END Element
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 1, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
// Event: END Element; next=6
|
||||
done = 1;
|
||||
grammar_id = 6;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EXI_ERROR__UNKNOWN_GRAMMAR_ID;
|
||||
break;
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
// main function for encoding
|
||||
int encode_appHand_exiDocument(exi_bitstream_t* stream, struct appHand_exiDocument* exiDoc)
|
||||
{
|
||||
int error = exi_header_write(stream);
|
||||
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
if (exiDoc->supportedAppProtocolReq_isUsed == 1)
|
||||
{
|
||||
// encode event 0
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 2, 0);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = encode_appHand_supportedAppProtocolReq(stream, &exiDoc->supportedAppProtocolReq);
|
||||
}
|
||||
}
|
||||
else if (exiDoc->supportedAppProtocolRes_isUsed == 1)
|
||||
{
|
||||
// encode event 1
|
||||
error = exi_basetypes_encoder_nbit_uint(stream, 2, 1);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
error = encode_appHand_supportedAppProtocolRes(stream, &exiDoc->supportedAppProtocolRes);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error = EXI_ERROR__UNKNOWN_EVENT_FOR_ENCODING;
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,260 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_basetypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
#include "cbv2g/common/exi_basetypes.h"
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_convert_to_unsigned(exi_unsigned_t* exi_unsigned, uint32_t value, size_t max_octets)
|
||||
{
|
||||
exi_unsigned->octets_count = 0;
|
||||
uint8_t* current_octet = exi_unsigned->octets;
|
||||
uint32_t dummy = value;
|
||||
|
||||
for (size_t n = 0; n < EXI_BASETYPES_UINT32_MAX_OCTETS; n++)
|
||||
{
|
||||
exi_unsigned->octets_count++;
|
||||
*current_octet = (uint8_t)(dummy & EXI_BASETYPES_OCTET_SEQ_VALUE_MASK);
|
||||
|
||||
dummy >>= 7u;
|
||||
if (dummy == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
*current_octet |= EXI_BASETYPES_OCTET_SEQ_FLAG_MASK;
|
||||
current_octet++;
|
||||
}
|
||||
|
||||
return (exi_unsigned->octets_count <= max_octets) ? EXI_ERROR__NO_ERROR : EXI_ERROR__OCTET_COUNT_LARGER_THAN_TYPE_SUPPORTS;
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_64_to_unsigned(exi_unsigned_t* exi_unsigned, uint64_t value)
|
||||
{
|
||||
exi_unsigned->octets_count = 0;
|
||||
uint8_t* current_octet = exi_unsigned->octets;
|
||||
uint64_t dummy = value;
|
||||
|
||||
for (size_t n = 0; n < EXI_BASETYPES_UINT64_MAX_OCTETS; n++)
|
||||
{
|
||||
exi_unsigned->octets_count++;
|
||||
*current_octet = (uint8_t)(dummy & EXI_BASETYPES_OCTET_SEQ_VALUE_MASK);
|
||||
|
||||
dummy >>= 7u;
|
||||
if (dummy == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
*current_octet |= EXI_BASETYPES_OCTET_SEQ_FLAG_MASK;
|
||||
current_octet++;
|
||||
}
|
||||
|
||||
return (exi_unsigned->octets_count <= EXI_BASETYPES_UINT64_MAX_OCTETS) ? EXI_ERROR__NO_ERROR : EXI_ERROR__OCTET_COUNT_LARGER_THAN_TYPE_SUPPORTS;
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_to_signed(exi_signed_t* exi_signed, int32_t value, size_t max_octets)
|
||||
{
|
||||
if (value < 0) {
|
||||
exi_signed->is_negative = 1;
|
||||
return exi_basetypes_convert_to_unsigned(&exi_signed->data, -value, max_octets);
|
||||
}
|
||||
exi_signed->is_negative = 0;
|
||||
return exi_basetypes_convert_to_unsigned(&exi_signed->data, value, max_octets);
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_64_to_signed(exi_signed_t* exi_signed, int64_t value)
|
||||
{
|
||||
if (value < 0) {
|
||||
exi_signed->is_negative = 1;
|
||||
return exi_basetypes_convert_64_to_unsigned(&exi_signed->data, -value);
|
||||
}
|
||||
exi_signed->is_negative = 0;
|
||||
return exi_basetypes_convert_64_to_unsigned(&exi_signed->data, value);
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_from_unsigned(const exi_unsigned_t* exi_unsigned, uint32_t* value, size_t max_octets)
|
||||
{
|
||||
if (exi_unsigned->octets_count > max_octets)
|
||||
{
|
||||
return EXI_ERROR__OCTET_COUNT_LARGER_THAN_TYPE_SUPPORTS;
|
||||
}
|
||||
|
||||
const uint8_t* current_octet = exi_unsigned->octets;
|
||||
*value = 0;
|
||||
|
||||
for (size_t n = 0; n < exi_unsigned->octets_count; n++)
|
||||
{
|
||||
*value = *value + ((uint32_t)(*current_octet & EXI_BASETYPES_OCTET_SEQ_VALUE_MASK) << (n * 7));
|
||||
|
||||
current_octet++;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_64_from_unsigned(const exi_unsigned_t* exi_unsigned, uint64_t* value)
|
||||
{
|
||||
if (exi_unsigned->octets_count > EXI_BASETYPES_UINT64_MAX_OCTETS)
|
||||
{
|
||||
return EXI_ERROR__OCTET_COUNT_LARGER_THAN_TYPE_SUPPORTS;
|
||||
}
|
||||
|
||||
const uint8_t* current_octet = exi_unsigned->octets;
|
||||
*value = 0;
|
||||
|
||||
for (size_t n = 0; n < exi_unsigned->octets_count; n++)
|
||||
{
|
||||
*value = *value + ((uint64_t)(*current_octet & EXI_BASETYPES_OCTET_SEQ_VALUE_MASK) << (n * 7));
|
||||
|
||||
current_octet++;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_from_signed(const exi_signed_t* exi_signed, int32_t* value, size_t max_octets)
|
||||
{
|
||||
uint32_t u_value = 0;
|
||||
int res = exi_basetypes_convert_from_unsigned(&exi_signed->data, &u_value, max_octets);
|
||||
*value = (exi_signed->is_negative == 0) ? u_value : -u_value;
|
||||
return res;
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_64_from_signed(const exi_signed_t* exi_signed, int64_t* value)
|
||||
{
|
||||
uint64_t u_value = 0;
|
||||
int res = exi_basetypes_convert_64_from_unsigned(&exi_signed->data, &u_value);
|
||||
*value = (exi_signed->is_negative == 0) ? u_value : -u_value;
|
||||
return res;
|
||||
}
|
||||
|
||||
static void _reverse_array(uint8_t* data, size_t data_size)
|
||||
{
|
||||
if (!data_size)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
size_t j = data_size - 1;
|
||||
while (i < j) {
|
||||
const uint8_t temp = data[i];
|
||||
data[i] = data[j];
|
||||
data[j] = temp;
|
||||
i++;
|
||||
j--;
|
||||
}
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_bytes_from_unsigned(const exi_unsigned_t* exi_unsigned, uint8_t* data, size_t* data_len, size_t data_size)
|
||||
{
|
||||
// raw EXI 7/8 integer byte stream with flags (exi_unsigned) to API exi_unsigned_t representation (data, data_len)
|
||||
const uint8_t* current_octet = exi_unsigned->octets;
|
||||
uint16_t temp = 0;
|
||||
*data_len = 0;
|
||||
size_t total_offset = 0;
|
||||
|
||||
for (size_t n = 0; n < exi_unsigned->octets_count; n++) {
|
||||
temp += ((uint16_t)(*current_octet & EXI_BASETYPES_OCTET_SEQ_VALUE_MASK) << total_offset);
|
||||
total_offset += 7;
|
||||
if (total_offset >= 8) {
|
||||
if (*data_len >= data_size) {
|
||||
return EXI_ERROR__ENCODED_INTEGER_SIZE_LARGER_THAN_DESTINATION;
|
||||
}
|
||||
total_offset -= 8;
|
||||
data[*data_len] = temp & 0xFF;
|
||||
(*data_len)++;
|
||||
temp >>= 8;
|
||||
}
|
||||
current_octet++;
|
||||
}
|
||||
if (total_offset != 0 && (temp & 0xFF) != 0) {
|
||||
if (*data_len >= data_size) {
|
||||
return EXI_ERROR__ENCODED_INTEGER_SIZE_LARGER_THAN_DESTINATION;
|
||||
}
|
||||
data[*data_len] = temp & 0xFF;
|
||||
(*data_len)++;
|
||||
}
|
||||
_reverse_array(data, *data_len);
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
int exi_basetypes_convert_bytes_to_unsigned(exi_unsigned_t* exi_unsigned, const uint8_t* data, size_t data_len)
|
||||
{
|
||||
// API exi_unsigned_t representation (data, data_len) to raw EXI 7/8 integer byte stream with flags (exi_unsigned)
|
||||
uint8_t *current_octet = &exi_unsigned->octets[0];
|
||||
uint16_t dummy = 0;
|
||||
uint8_t dummy_count = 0;
|
||||
exi_unsigned->octets_count = 0;
|
||||
|
||||
// first, determine the number of relevant bits (or octets), to have a termination criterion
|
||||
size_t bytenum;
|
||||
for (bytenum = 0; bytenum < data_len; bytenum++) {
|
||||
if (data[bytenum] != 0)
|
||||
break;
|
||||
}
|
||||
if (bytenum == data_len) {
|
||||
// special case: all zeros
|
||||
*current_octet = 0;
|
||||
exi_unsigned->octets_count = 1;
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
// bytenum is now index of big-endian first relevant byte
|
||||
// number of total input relevant bits t is (data_len - bytenum - 1) * 8 plus number of relevant bits in data[bytenum]
|
||||
uint8_t byte = data[bytenum];
|
||||
int bits_in_byte = 0;
|
||||
while (byte) {
|
||||
bits_in_byte++;
|
||||
byte >>= 1;
|
||||
}
|
||||
|
||||
const int total_relevant_input_bits = (data_len - bytenum - 1) * 8 + bits_in_byte;
|
||||
const size_t exi_expected_octets_count = (total_relevant_input_bits + 6) / 7; // integer division ceil
|
||||
|
||||
size_t incount = 0;
|
||||
for (size_t outcount = 0; outcount < exi_expected_octets_count; outcount++) {
|
||||
if (dummy_count < 7) {
|
||||
// fill dummy when more flushable bits are needed
|
||||
dummy |= (data[data_len - incount - 1] << dummy_count);
|
||||
dummy_count += 8;
|
||||
incount++;
|
||||
}
|
||||
*current_octet = (uint8_t)(dummy & EXI_BASETYPES_OCTET_SEQ_VALUE_MASK);
|
||||
exi_unsigned->octets_count++;
|
||||
if (exi_unsigned->octets_count < exi_expected_octets_count) {
|
||||
*current_octet |= EXI_BASETYPES_OCTET_SEQ_FLAG_MASK;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
current_octet++;
|
||||
dummy >>= 7u;
|
||||
dummy_count -= 7;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,366 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_basetypes_decoder.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cbv2g/common/exi_basetypes.h"
|
||||
#include "cbv2g/common/exi_basetypes_decoder.h"
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* local functions
|
||||
*****************************************************************************/
|
||||
static int exi_basetypes_decoder_read_unsigned(exi_bitstream_t* stream, exi_unsigned_t* exi_unsigned)
|
||||
{
|
||||
const uint8_t MSB = (1u << 7);
|
||||
|
||||
int found_sequence_end = 0;
|
||||
uint8_t* current_octet = exi_unsigned->octets;
|
||||
exi_unsigned->octets_count = 0;
|
||||
|
||||
while (exi_unsigned->octets_count < EXI_BASETYPES_MAX_OCTETS_SUPPORTED)
|
||||
{
|
||||
int error;
|
||||
error = exi_bitstream_read_octet(stream, current_octet);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
exi_unsigned->octets_count++;
|
||||
|
||||
if ((*current_octet & MSB) == 0)
|
||||
{
|
||||
found_sequence_end = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
current_octet++;
|
||||
}
|
||||
|
||||
return (found_sequence_end) ? EXI_ERROR__NO_ERROR : EXI_ERROR__SUPPORTED_MAX_OCTETS_OVERRUN;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - bool
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_decoder_bool(exi_bitstream_t* stream, int* value)
|
||||
{
|
||||
int error;
|
||||
uint32_t bit;
|
||||
|
||||
error = exi_bitstream_read_bits(stream, 1, &bit);
|
||||
if (error == EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
*value = (bit) ? 1 : 0;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - bytes, binary
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_decoder_bytes(exi_bitstream_t* stream, size_t bytes_len, uint8_t* bytes, size_t bytes_size)
|
||||
{
|
||||
|
||||
if (bytes_len > bytes_size)
|
||||
{
|
||||
return EXI_ERROR__BYTE_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
uint8_t* current_byte = bytes;
|
||||
|
||||
for (size_t n = 0; n < bytes_len; n++)
|
||||
{
|
||||
int error;
|
||||
error = exi_bitstream_read_octet(stream, current_byte);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
current_byte++;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - unsigned integer
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_decoder_nbit_uint(exi_bitstream_t* stream, size_t bit_count, uint32_t* value)
|
||||
{
|
||||
return exi_bitstream_read_bits(stream, bit_count, value);
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_uint_8(exi_bitstream_t* stream, uint8_t* value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
uint32_t result;
|
||||
|
||||
error = exi_basetypes_decoder_read_unsigned(stream, &exi_unsigned);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_convert_from_unsigned(&exi_unsigned, &result, EXI_BASETYPES_UINT8_MAX_OCTETS);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
*value = (uint8_t)result;
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_uint_16(exi_bitstream_t* stream, uint16_t* value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
uint32_t result;
|
||||
|
||||
error = exi_basetypes_decoder_read_unsigned(stream, &exi_unsigned);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_convert_from_unsigned(&exi_unsigned, &result, EXI_BASETYPES_UINT16_MAX_OCTETS);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
*value = (uint16_t)result;
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_uint_32(exi_bitstream_t* stream, uint32_t* value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
|
||||
error = exi_basetypes_decoder_read_unsigned(stream, &exi_unsigned);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_convert_from_unsigned(&exi_unsigned, value, EXI_BASETYPES_UINT32_MAX_OCTETS);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_uint_64(exi_bitstream_t* stream, uint64_t* value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
|
||||
error = exi_basetypes_decoder_read_unsigned(stream, &exi_unsigned);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_convert_64_from_unsigned(&exi_unsigned, value);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_unsigned(exi_bitstream_t* stream, exi_unsigned_t* value)
|
||||
{
|
||||
return exi_basetypes_decoder_read_unsigned(stream, value);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - integer
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_decoder_integer_8(exi_bitstream_t* stream, int8_t* value)
|
||||
{
|
||||
int sign;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_bool(stream, &sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_decoder_uint_8(stream, (uint8_t*)value);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
if (sign)
|
||||
{
|
||||
*value = -(*value + 1);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_integer_16(exi_bitstream_t* stream, int16_t* value)
|
||||
{
|
||||
int sign;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_bool(stream, &sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_decoder_uint_16(stream, (uint16_t*)value);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
if (sign)
|
||||
{
|
||||
*value = -(*value + 1);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_integer_32(exi_bitstream_t* stream, int32_t* value)
|
||||
{
|
||||
int sign;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_bool(stream, &sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_decoder_uint_32(stream, (uint32_t*)value);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
if (sign)
|
||||
{
|
||||
*value = -(*value + 1);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_integer_64(exi_bitstream_t* stream, int64_t* value)
|
||||
{
|
||||
int sign;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_bool(stream, &sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
error = exi_basetypes_decoder_uint_64(stream, (uint64_t*)value);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
if (sign)
|
||||
{
|
||||
*value = -(*value + 1);
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int exi_basetypes_decoder_signed(exi_bitstream_t* stream, exi_signed_t* value)
|
||||
{
|
||||
int sign = 0;
|
||||
|
||||
int error = exi_basetypes_decoder_bool(stream, &sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
value->is_negative = (sign == 0) ? 0 : 1;
|
||||
|
||||
exi_unsigned_t raw_value;
|
||||
error = exi_basetypes_decoder_unsigned(stream, &raw_value);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
error = exi_basetypes_convert_bytes_from_unsigned(&raw_value, value->data.octets, &value->data.octets_count, sizeof(raw_value.octets));
|
||||
return error;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - characters, string
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_decoder_characters(exi_bitstream_t* stream, size_t characters_len, exi_character_t* characters, size_t characters_size)
|
||||
{
|
||||
const uint8_t ASCII_MAX_VALUE = 127;
|
||||
|
||||
if (characters_len + EXTRA_CHAR > characters_size)
|
||||
{
|
||||
return EXI_ERROR__CHARACTER_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
uint8_t* current_char = (uint8_t*)characters;
|
||||
|
||||
for (size_t n = 0; n < characters_len; n++)
|
||||
{
|
||||
int error;
|
||||
error = exi_bitstream_read_octet(stream, current_char);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
if (*current_char > ASCII_MAX_VALUE)
|
||||
{
|
||||
return EXI_ERROR__UNSUPPORTED_CHARACTER_VALUE;
|
||||
}
|
||||
|
||||
current_char++;
|
||||
}
|
||||
|
||||
*current_char = ASCII_CHAR_TERMINATOR;
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_basetypes_encoder.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cbv2g/common/exi_basetypes.h"
|
||||
#include "cbv2g/common/exi_basetypes_encoder.h"
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* local functions
|
||||
*****************************************************************************/
|
||||
static int exi_basetypes_encoder_write_unsigned(exi_bitstream_t* stream, const exi_unsigned_t* exi_unsigned)
|
||||
{
|
||||
const uint8_t* current_octet = exi_unsigned->octets;
|
||||
|
||||
for (size_t n = 0; n < exi_unsigned->octets_count; n++)
|
||||
{
|
||||
int error;
|
||||
error = exi_bitstream_write_octet(stream, *current_octet);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
current_octet++;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - bool
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_encoder_bool(exi_bitstream_t* stream, int value)
|
||||
{
|
||||
int error;
|
||||
uint32_t bit = (value) ? 1 : 0;
|
||||
|
||||
error = exi_bitstream_write_bits(stream, 1, bit);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - bytes, binary
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_encoder_bytes(exi_bitstream_t* stream, size_t bytes_len, const uint8_t* bytes, size_t bytes_size)
|
||||
{
|
||||
if (bytes_len > bytes_size)
|
||||
{
|
||||
return EXI_ERROR__BYTE_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
const uint8_t* current_byte = bytes;
|
||||
|
||||
for (size_t n = 0; n < bytes_len; n++)
|
||||
{
|
||||
int error;
|
||||
error = exi_bitstream_write_octet(stream, *current_byte);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
current_byte++;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - unsigned integer
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_encoder_nbit_uint(exi_bitstream_t* stream, size_t bit_count, uint32_t value)
|
||||
{
|
||||
return exi_bitstream_write_bits(stream, bit_count, value);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_uint_8(exi_bitstream_t* stream, uint8_t value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
uint32_t result = (uint32_t)value;
|
||||
|
||||
error = exi_basetypes_convert_to_unsigned(&exi_unsigned, result, EXI_BASETYPES_UINT8_MAX_OCTETS);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_write_unsigned(stream, &exi_unsigned);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_uint_16(exi_bitstream_t* stream, uint16_t value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
uint32_t result = (uint32_t)value;
|
||||
|
||||
error = exi_basetypes_convert_to_unsigned(&exi_unsigned, result, EXI_BASETYPES_UINT16_MAX_OCTETS);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_write_unsigned(stream, &exi_unsigned);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_uint_32(exi_bitstream_t* stream, uint32_t value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
|
||||
error = exi_basetypes_convert_to_unsigned(&exi_unsigned, value, EXI_BASETYPES_UINT32_MAX_OCTETS);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_write_unsigned(stream, &exi_unsigned);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_uint_64(exi_bitstream_t* stream, uint64_t value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t exi_unsigned;
|
||||
|
||||
error = exi_basetypes_convert_64_to_unsigned(&exi_unsigned, value);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_write_unsigned(stream, &exi_unsigned);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_unsigned(exi_bitstream_t* stream, const exi_unsigned_t* value)
|
||||
{
|
||||
int error;
|
||||
exi_unsigned_t raw_exi_unsigned;
|
||||
|
||||
// convert integer API bytes to EXI coded 7/8 byte stream
|
||||
error = exi_basetypes_convert_bytes_to_unsigned(&raw_exi_unsigned, value->octets, value->octets_count);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_write_unsigned(stream, &raw_exi_unsigned);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - integer
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_encoder_integer_8(exi_bitstream_t* stream, int8_t value)
|
||||
{
|
||||
int error;
|
||||
int sign = (value < 0) ? 1 : 0;
|
||||
|
||||
error = exi_basetypes_encoder_bool(stream, sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
uint8_t result = (uint8_t)value;
|
||||
|
||||
if (sign)
|
||||
{
|
||||
result = -value - 1;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_uint_8(stream, result);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_integer_16(exi_bitstream_t* stream, int16_t value)
|
||||
{
|
||||
int error;
|
||||
int sign = (value < 0) ? 1 : 0;
|
||||
|
||||
error = exi_basetypes_encoder_bool(stream, sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
uint16_t result = (uint16_t)value;
|
||||
|
||||
if (sign)
|
||||
{
|
||||
result = -value - 1;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_uint_16(stream, result);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_integer_32(exi_bitstream_t* stream, int32_t value)
|
||||
{
|
||||
int error;
|
||||
int sign = (value < 0) ? 1 : 0;
|
||||
|
||||
error = exi_basetypes_encoder_bool(stream, sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
uint32_t result = (uint32_t)value;
|
||||
|
||||
if (sign)
|
||||
{
|
||||
result = -value - 1;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_uint_32(stream, result);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_integer_64(exi_bitstream_t* stream, int64_t value)
|
||||
{
|
||||
int error;
|
||||
int sign = (value < 0) ? 1 : 0;
|
||||
|
||||
error = exi_basetypes_encoder_bool(stream, sign);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
uint64_t result = (uint64_t)value;
|
||||
|
||||
if (sign)
|
||||
{
|
||||
result = -value - 1;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_uint_64(stream, result);
|
||||
}
|
||||
|
||||
int exi_basetypes_encoder_signed(exi_bitstream_t* stream, const exi_signed_t* value)
|
||||
{
|
||||
int error = exi_basetypes_encoder_bool(stream, value->is_negative);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
return exi_basetypes_encoder_unsigned(stream, &value->data);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions - characters, string
|
||||
*****************************************************************************/
|
||||
int exi_basetypes_encoder_characters(exi_bitstream_t* stream, size_t characters_len, const exi_character_t* characters, size_t characters_size)
|
||||
{
|
||||
const uint8_t ASCII_MAX_VALUE = 127;
|
||||
|
||||
if (characters_len > characters_size)
|
||||
{
|
||||
return EXI_ERROR__CHARACTER_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
const uint8_t* current_char = (const uint8_t*)characters;
|
||||
|
||||
for (size_t n = 0; n < characters_len; n++)
|
||||
{
|
||||
int error;
|
||||
if (*current_char > ASCII_MAX_VALUE)
|
||||
{
|
||||
return EXI_ERROR__UNSUPPORTED_CHARACTER_VALUE;
|
||||
}
|
||||
|
||||
error = exi_bitstream_write_octet(stream, *current_char);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
current_char++;
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_bitstream.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* local functions
|
||||
*****************************************************************************/
|
||||
static int exi_bitstream_has_overflow(exi_bitstream_t* stream)
|
||||
{
|
||||
if (stream->bit_count == EXI_BITSTREAM_MAX_BIT_COUNT)
|
||||
{
|
||||
if (stream->byte_pos < stream->data_size)
|
||||
{
|
||||
stream->byte_pos++;
|
||||
stream->bit_count = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return EXI_ERROR__BITSTREAM_OVERFLOW;
|
||||
}
|
||||
}
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
static int exi_bitstream_write_bit(exi_bitstream_t* stream, uint8_t bit)
|
||||
{
|
||||
// check whether the bit to be written is within the stream capacity
|
||||
if (exi_bitstream_has_overflow(stream))
|
||||
{
|
||||
return EXI_ERROR__BITSTREAM_OVERFLOW;
|
||||
}
|
||||
|
||||
// point to current byte
|
||||
uint8_t* current_byte = stream->data + stream->byte_pos;
|
||||
|
||||
if (stream->bit_count == 0)
|
||||
{
|
||||
// clear everything if at the beginning of a new byte
|
||||
*current_byte = 0;
|
||||
}
|
||||
|
||||
if (bit)
|
||||
{
|
||||
*current_byte = *current_byte | (1u << (EXI_BITSTREAM_MAX_BIT_COUNT - (stream->bit_count + 1u)));
|
||||
}
|
||||
|
||||
stream->bit_count++;
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
static int exi_bitstream_read_bit(exi_bitstream_t* stream, uint8_t* bit)
|
||||
{
|
||||
// check whether the bit to be read is within the stream capacity
|
||||
if (exi_bitstream_has_overflow(stream))
|
||||
{
|
||||
return EXI_ERROR__BITSTREAM_OVERFLOW;
|
||||
}
|
||||
|
||||
uint8_t current_bit = *(stream->data + stream->byte_pos) >> (EXI_BITSTREAM_MAX_BIT_COUNT - (stream->bit_count + 1u));
|
||||
*bit = (current_bit & 1u) ? 1 : 0;
|
||||
|
||||
stream->bit_count++;
|
||||
|
||||
return EXI_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* interface functions
|
||||
*****************************************************************************/
|
||||
void exi_bitstream_init(exi_bitstream_t* stream, uint8_t* data, size_t data_size, size_t data_offset, exi_status_callback status_callback)
|
||||
{
|
||||
stream->byte_pos = data_offset;
|
||||
stream->bit_count = 0;
|
||||
|
||||
stream->data = data;
|
||||
stream->data_size = data_size;
|
||||
|
||||
stream->_init_called = 1;
|
||||
stream->_flag_byte_pos = data_offset;
|
||||
|
||||
stream->status_callback = status_callback;
|
||||
}
|
||||
|
||||
void exi_bitstream_reset(exi_bitstream_t* stream)
|
||||
{
|
||||
if (stream->_init_called)
|
||||
{
|
||||
stream->byte_pos = stream->_flag_byte_pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
stream->byte_pos = 0;
|
||||
}
|
||||
|
||||
stream->bit_count = 0;
|
||||
}
|
||||
|
||||
size_t exi_bitstream_get_length(const exi_bitstream_t* stream)
|
||||
{
|
||||
size_t length = stream->byte_pos;
|
||||
|
||||
if (stream->_init_called && (stream->_flag_byte_pos > 0))
|
||||
{
|
||||
length -= stream->_flag_byte_pos;
|
||||
}
|
||||
|
||||
length += stream->bit_count > 0u ? 1u : 0u;
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
int exi_bitstream_write_bits(exi_bitstream_t* stream, size_t bit_count, uint32_t value)
|
||||
{
|
||||
if (bit_count > 32)
|
||||
{
|
||||
return EXI_ERROR__BIT_COUNT_LARGER_THAN_TYPE_SIZE;
|
||||
}
|
||||
|
||||
int error = EXI_ERROR__NO_ERROR;
|
||||
|
||||
for (size_t n = 0; n < bit_count; n++)
|
||||
{
|
||||
uint8_t bit;
|
||||
bit = (value & (1u << (bit_count - n - 1))) > 0;
|
||||
|
||||
error = exi_bitstream_write_bit(stream, bit);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int exi_bitstream_write_octet(exi_bitstream_t* stream, uint8_t value)
|
||||
{
|
||||
return exi_bitstream_write_bits(stream, 8, (uint32_t)value);
|
||||
}
|
||||
|
||||
int exi_bitstream_read_bits(exi_bitstream_t* stream, size_t bit_count, uint32_t* value)
|
||||
{
|
||||
*value = 0;
|
||||
|
||||
if (bit_count > 32)
|
||||
{
|
||||
return EXI_ERROR__BIT_COUNT_LARGER_THAN_TYPE_SIZE;
|
||||
}
|
||||
|
||||
int error = EXI_ERROR__NO_ERROR;
|
||||
|
||||
for (size_t n = 0; n < bit_count; n++)
|
||||
{
|
||||
uint8_t bit;
|
||||
error = exi_bitstream_read_bit(stream, &bit);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
*value = (*value << 1u) | bit;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
int exi_bitstream_read_octet(exi_bitstream_t* stream, uint8_t* value)
|
||||
{
|
||||
*value = 0;
|
||||
|
||||
int error = EXI_ERROR__NO_ERROR;
|
||||
|
||||
for (int n = 0; n < 8; n++)
|
||||
{
|
||||
uint8_t bit;
|
||||
error = exi_bitstream_read_bit(stream, &bit);
|
||||
if (error != EXI_ERROR__NO_ERROR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
*value = (*value << 1u) | bit;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_header.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
#include "cbv2g/common/exi_header.h"
|
||||
|
||||
|
||||
int exi_header_write(exi_bitstream_t* stream)
|
||||
{
|
||||
return exi_bitstream_write_bits(stream, EXI_SIMPLE_HEADER_BIT_SIZE, EXI_SIMPLE_HEADER_VALUE);
|
||||
}
|
||||
|
||||
int exi_header_read(exi_bitstream_t* stream, uint32_t* header)
|
||||
{
|
||||
return exi_bitstream_read_bits(stream, EXI_SIMPLE_HEADER_BIT_SIZE, header);
|
||||
}
|
||||
|
||||
int exi_header_read_and_check(exi_bitstream_t* stream)
|
||||
{
|
||||
int error;
|
||||
uint32_t header;
|
||||
|
||||
int result = EXI_ERROR__NO_ERROR;
|
||||
|
||||
error = exi_header_read(stream, &header);
|
||||
if (error)
|
||||
{
|
||||
return error;
|
||||
}
|
||||
|
||||
// EXI header:
|
||||
// - two Distinguishing Bits 0b10
|
||||
// - one Presence Bit for EXI Options "absence of options" 0b0
|
||||
// - EXI format version "Final version 1" 0b00000
|
||||
// results in eight header bits 0b10000000 = 0x80
|
||||
if (header != EXI_SIMPLE_HEADER_VALUE) {
|
||||
result = EXI_ERROR__HEADER_INCORRECT;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,372 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_types_decoder.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cbv2g/common/exi_basetypes.h"
|
||||
#include "cbv2g/common/exi_basetypes_decoder.h"
|
||||
#include "cbv2g/common/exi_bitstream.h"
|
||||
#include "cbv2g/common/exi_error_codes.h"
|
||||
#include "cbv2g/common/exi_types_decoder.h"
|
||||
|
||||
|
||||
// *********
|
||||
// HexBinary
|
||||
// *********
|
||||
int decode_exi_type_hex_binary(exi_bitstream_t* stream, uint16_t* value_len, uint8_t* value_buffer, size_t value_buffer_size)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_uint_16(stream, value_len);
|
||||
if (error == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_bytes(stream, *value_len, value_buffer, value_buffer_size);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Second level event is not supported
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
// if nothing went wrong, the error of last decoding is evaluated here
|
||||
if (error == 0)
|
||||
{
|
||||
// test EE for simple element
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
// deviants are not supported or also typecast and nillable
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
// *********
|
||||
// integers
|
||||
// *********
|
||||
int decode_exi_type_integer8(exi_bitstream_t* stream, int8_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_integer_8(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int decode_exi_type_integer16(exi_bitstream_t* stream, int16_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_integer_16(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int decode_exi_type_integer32(exi_bitstream_t* stream, int32_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_integer_32(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int decode_exi_type_integer64(exi_bitstream_t* stream, int64_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_integer_64(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
int decode_exi_type_uint8(exi_bitstream_t* stream, uint8_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_uint_8(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int decode_exi_type_uint16(exi_bitstream_t* stream, uint16_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_uint_16(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int decode_exi_type_uint32(exi_bitstream_t* stream, uint32_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_uint_32(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int decode_exi_type_uint64(exi_bitstream_t* stream, uint64_t* value)
|
||||
{
|
||||
uint32_t eventCode;
|
||||
int error;
|
||||
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode == 0)
|
||||
{
|
||||
error = exi_basetypes_decoder_uint_64(stream, value);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Second level event is not supported */
|
||||
error = EXI_ERROR__UNSUPPORTED_SUB_EVENT;
|
||||
}
|
||||
}
|
||||
|
||||
/* if nothing went wrong, the error of last decoding is evaluated here */
|
||||
if (error == 0)
|
||||
{
|
||||
/* test EE for simple element */
|
||||
error = exi_basetypes_decoder_nbit_uint(stream, 1, &eventCode);
|
||||
if (error == 0)
|
||||
{
|
||||
if (eventCode != 0)
|
||||
{
|
||||
/* deviants are not supported or also typecast and nillable */
|
||||
error = EXI_ERROR__DEVIANTS_NOT_SUPPORTED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,530 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file din_msgDefDatatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/din/din_msgDefDatatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_din_exiDocument(struct din_exiDocument* exiDoc) {
|
||||
(void) exiDoc;
|
||||
}
|
||||
void init_din_CostType(struct din_CostType* CostType) {
|
||||
CostType->amountMultiplier_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_RelativeTimeIntervalType(struct din_RelativeTimeIntervalType* RelativeTimeIntervalType) {
|
||||
RelativeTimeIntervalType->duration_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_IntervalType(struct din_IntervalType* IntervalType) {
|
||||
(void) IntervalType;
|
||||
}
|
||||
|
||||
void init_din_ConsumptionCostType(struct din_ConsumptionCostType* ConsumptionCostType) {
|
||||
ConsumptionCostType->Cost_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_TransformType(struct din_TransformType* TransformType) {
|
||||
TransformType->ANY_isUsed = 0u;
|
||||
TransformType->XPath_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_PMaxScheduleEntryType(struct din_PMaxScheduleEntryType* PMaxScheduleEntryType) {
|
||||
PMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u;
|
||||
PMaxScheduleEntryType->TimeInterval_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SalesTariffEntryType(struct din_SalesTariffEntryType* SalesTariffEntryType) {
|
||||
SalesTariffEntryType->RelativeTimeInterval_isUsed = 0u;
|
||||
SalesTariffEntryType->TimeInterval_isUsed = 0u;
|
||||
SalesTariffEntryType->ConsumptionCost_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_TransformsType(struct din_TransformsType* TransformsType) {
|
||||
(void) TransformsType;
|
||||
}
|
||||
|
||||
void init_din_DSAKeyValueType(struct din_DSAKeyValueType* DSAKeyValueType) {
|
||||
DSAKeyValueType->P_isUsed = 0u;
|
||||
DSAKeyValueType->Q_isUsed = 0u;
|
||||
DSAKeyValueType->G_isUsed = 0u;
|
||||
DSAKeyValueType->J_isUsed = 0u;
|
||||
DSAKeyValueType->Seed_isUsed = 0u;
|
||||
DSAKeyValueType->PgenCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_X509IssuerSerialType(struct din_X509IssuerSerialType* X509IssuerSerialType) {
|
||||
(void) X509IssuerSerialType;
|
||||
}
|
||||
|
||||
void init_din_DigestMethodType(struct din_DigestMethodType* DigestMethodType) {
|
||||
DigestMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_RSAKeyValueType(struct din_RSAKeyValueType* RSAKeyValueType) {
|
||||
(void) RSAKeyValueType;
|
||||
}
|
||||
|
||||
void init_din_ParameterType(struct din_ParameterType* ParameterType) {
|
||||
ParameterType->boolValue_isUsed = 0u;
|
||||
ParameterType->byteValue_isUsed = 0u;
|
||||
ParameterType->shortValue_isUsed = 0u;
|
||||
ParameterType->intValue_isUsed = 0u;
|
||||
ParameterType->physicalValue_isUsed = 0u;
|
||||
ParameterType->stringValue_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_PMaxScheduleType(struct din_PMaxScheduleType* PMaxScheduleType) {
|
||||
PMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_din_SalesTariffType(struct din_SalesTariffType* SalesTariffType) {
|
||||
SalesTariffType->SalesTariffEntry.arrayLen = 0u;
|
||||
SalesTariffType->SalesTariffDescription_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_CanonicalizationMethodType(struct din_CanonicalizationMethodType* CanonicalizationMethodType) {
|
||||
CanonicalizationMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServiceTagType(struct din_ServiceTagType* ServiceTagType) {
|
||||
ServiceTagType->ServiceName_isUsed = 0u;
|
||||
ServiceTagType->ServiceScope_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServiceType(struct din_ServiceType* ServiceType) {
|
||||
(void) ServiceType;
|
||||
}
|
||||
|
||||
void init_din_ParameterSetType(struct din_ParameterSetType* ParameterSetType) {
|
||||
(void) ParameterSetType;
|
||||
}
|
||||
|
||||
void init_din_SelectedServiceType(struct din_SelectedServiceType* SelectedServiceType) {
|
||||
SelectedServiceType->ParameterSetID_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SAScheduleTupleType(struct din_SAScheduleTupleType* SAScheduleTupleType) {
|
||||
SAScheduleTupleType->SalesTariff_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_AC_EVSEStatusType(struct din_AC_EVSEStatusType* AC_EVSEStatusType) {
|
||||
(void) AC_EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_din_SignatureMethodType(struct din_SignatureMethodType* SignatureMethodType) {
|
||||
SignatureMethodType->HMACOutputLength_isUsed = 0u;
|
||||
SignatureMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_KeyValueType(struct din_KeyValueType* KeyValueType) {
|
||||
KeyValueType->DSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->RSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SubCertificatesType(struct din_SubCertificatesType* SubCertificatesType) {
|
||||
(void) SubCertificatesType;
|
||||
}
|
||||
|
||||
void init_din_ProfileEntryType(struct din_ProfileEntryType* ProfileEntryType) {
|
||||
(void) ProfileEntryType;
|
||||
}
|
||||
|
||||
void init_din_ReferenceType(struct din_ReferenceType* ReferenceType) {
|
||||
ReferenceType->Id_isUsed = 0u;
|
||||
ReferenceType->Type_isUsed = 0u;
|
||||
ReferenceType->URI_isUsed = 0u;
|
||||
ReferenceType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_RetrievalMethodType(struct din_RetrievalMethodType* RetrievalMethodType) {
|
||||
RetrievalMethodType->Type_isUsed = 0u;
|
||||
RetrievalMethodType->URI_isUsed = 0u;
|
||||
RetrievalMethodType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_X509DataType(struct din_X509DataType* X509DataType) {
|
||||
X509DataType->X509IssuerSerial_isUsed = 0u;
|
||||
X509DataType->X509SKI_isUsed = 0u;
|
||||
X509DataType->X509SubjectName_isUsed = 0u;
|
||||
X509DataType->X509Certificate_isUsed = 0u;
|
||||
X509DataType->X509CRL_isUsed = 0u;
|
||||
X509DataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_PGPDataType(struct din_PGPDataType* PGPDataType) {
|
||||
PGPDataType->choice_1_isUsed = 0u;
|
||||
PGPDataType->choice_2_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SPKIDataType(struct din_SPKIDataType* SPKIDataType) {
|
||||
SPKIDataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SignedInfoType(struct din_SignedInfoType* SignedInfoType) {
|
||||
SignedInfoType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_DC_EVStatusType(struct din_DC_EVStatusType* DC_EVStatusType) {
|
||||
DC_EVStatusType->EVCabinConditioning_isUsed = 0u;
|
||||
DC_EVStatusType->EVRESSConditioning_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SignatureValueType(struct din_SignatureValueType* SignatureValueType) {
|
||||
SignatureValueType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_CertificateChainType(struct din_CertificateChainType* CertificateChainType) {
|
||||
CertificateChainType->SubCertificates_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_DC_EVSEStatusType(struct din_DC_EVSEStatusType* DC_EVSEStatusType) {
|
||||
DC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_PhysicalValueType(struct din_PhysicalValueType* PhysicalValueType) {
|
||||
PhysicalValueType->Unit_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ListOfRootCertificateIDsType(struct din_ListOfRootCertificateIDsType* ListOfRootCertificateIDsType) {
|
||||
ListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_din_PaymentOptionsType(struct din_PaymentOptionsType* PaymentOptionsType) {
|
||||
PaymentOptionsType->PaymentOption.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_din_SelectedServiceListType(struct din_SelectedServiceListType* SelectedServiceListType) {
|
||||
SelectedServiceListType->SelectedService.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_din_AC_EVChargeParameterType(struct din_AC_EVChargeParameterType* AC_EVChargeParameterType) {
|
||||
(void) AC_EVChargeParameterType;
|
||||
}
|
||||
|
||||
void init_din_DC_EVChargeParameterType(struct din_DC_EVChargeParameterType* DC_EVChargeParameterType) {
|
||||
DC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 0u;
|
||||
DC_EVChargeParameterType->EVEnergyCapacity_isUsed = 0u;
|
||||
DC_EVChargeParameterType->EVEnergyRequest_isUsed = 0u;
|
||||
DC_EVChargeParameterType->FullSOC_isUsed = 0u;
|
||||
DC_EVChargeParameterType->BulkSOC_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_EVChargeParameterType(struct din_EVChargeParameterType* EVChargeParameterType) {
|
||||
(void) EVChargeParameterType;
|
||||
}
|
||||
|
||||
void init_din_ChargingProfileType(struct din_ChargingProfileType* ChargingProfileType) {
|
||||
ChargingProfileType->ProfileEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_din_EVSEStatusType(struct din_EVSEStatusType* EVSEStatusType) {
|
||||
(void) EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_din_KeyInfoType(struct din_KeyInfoType* KeyInfoType) {
|
||||
KeyInfoType->Id_isUsed = 0u;
|
||||
KeyInfoType->KeyName_isUsed = 0u;
|
||||
KeyInfoType->KeyValue_isUsed = 0u;
|
||||
KeyInfoType->RetrievalMethod_isUsed = 0u;
|
||||
KeyInfoType->X509Data_isUsed = 0u;
|
||||
KeyInfoType->PGPData_isUsed = 0u;
|
||||
KeyInfoType->SPKIData_isUsed = 0u;
|
||||
KeyInfoType->MgmtData_isUsed = 0u;
|
||||
KeyInfoType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServiceChargeType(struct din_ServiceChargeType* ServiceChargeType) {
|
||||
(void) ServiceChargeType;
|
||||
}
|
||||
|
||||
void init_din_ServiceParameterListType(struct din_ServiceParameterListType* ServiceParameterListType) {
|
||||
ServiceParameterListType->ParameterSet.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_din_SAScheduleListType(struct din_SAScheduleListType* SAScheduleListType) {
|
||||
SAScheduleListType->SAScheduleTuple.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_din_SASchedulesType(struct din_SASchedulesType* SASchedulesType) {
|
||||
(void) SASchedulesType;
|
||||
}
|
||||
|
||||
void init_din_DC_EVPowerDeliveryParameterType(struct din_DC_EVPowerDeliveryParameterType* DC_EVPowerDeliveryParameterType) {
|
||||
DC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_EVPowerDeliveryParameterType(struct din_EVPowerDeliveryParameterType* EVPowerDeliveryParameterType) {
|
||||
(void) EVPowerDeliveryParameterType;
|
||||
}
|
||||
|
||||
void init_din_ObjectType(struct din_ObjectType* ObjectType) {
|
||||
ObjectType->Encoding_isUsed = 0u;
|
||||
ObjectType->Id_isUsed = 0u;
|
||||
ObjectType->MimeType_isUsed = 0u;
|
||||
ObjectType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServiceTagListType(struct din_ServiceTagListType* ServiceTagListType) {
|
||||
(void) ServiceTagListType;
|
||||
}
|
||||
|
||||
void init_din_DC_EVSEChargeParameterType(struct din_DC_EVSEChargeParameterType* DC_EVSEChargeParameterType) {
|
||||
DC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 0u;
|
||||
DC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u;
|
||||
DC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_AC_EVSEChargeParameterType(struct din_AC_EVSEChargeParameterType* AC_EVSEChargeParameterType) {
|
||||
(void) AC_EVSEChargeParameterType;
|
||||
}
|
||||
|
||||
void init_din_EVSEChargeParameterType(struct din_EVSEChargeParameterType* EVSEChargeParameterType) {
|
||||
(void) EVSEChargeParameterType;
|
||||
}
|
||||
|
||||
void init_din_MeterInfoType(struct din_MeterInfoType* MeterInfoType) {
|
||||
MeterInfoType->MeterReading_isUsed = 0u;
|
||||
MeterInfoType->SigMeterReading_isUsed = 0u;
|
||||
MeterInfoType->MeterStatus_isUsed = 0u;
|
||||
MeterInfoType->TMeter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_CertificateInstallationResType(struct din_CertificateInstallationResType* CertificateInstallationResType) {
|
||||
(void) CertificateInstallationResType;
|
||||
}
|
||||
|
||||
void init_din_CableCheckReqType(struct din_CableCheckReqType* CableCheckReqType) {
|
||||
(void) CableCheckReqType;
|
||||
}
|
||||
|
||||
void init_din_CableCheckResType(struct din_CableCheckResType* CableCheckResType) {
|
||||
(void) CableCheckResType;
|
||||
}
|
||||
|
||||
void init_din_PreChargeReqType(struct din_PreChargeReqType* PreChargeReqType) {
|
||||
(void) PreChargeReqType;
|
||||
}
|
||||
|
||||
void init_din_PreChargeResType(struct din_PreChargeResType* PreChargeResType) {
|
||||
(void) PreChargeResType;
|
||||
}
|
||||
|
||||
void init_din_CurrentDemandReqType(struct din_CurrentDemandReqType* CurrentDemandReqType) {
|
||||
CurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u;
|
||||
CurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u;
|
||||
CurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u;
|
||||
CurrentDemandReqType->BulkChargingComplete_isUsed = 0u;
|
||||
CurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u;
|
||||
CurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_CurrentDemandResType(struct din_CurrentDemandResType* CurrentDemandResType) {
|
||||
CurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 0u;
|
||||
CurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 0u;
|
||||
CurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_WeldingDetectionReqType(struct din_WeldingDetectionReqType* WeldingDetectionReqType) {
|
||||
(void) WeldingDetectionReqType;
|
||||
}
|
||||
|
||||
void init_din_WeldingDetectionResType(struct din_WeldingDetectionResType* WeldingDetectionResType) {
|
||||
(void) WeldingDetectionResType;
|
||||
}
|
||||
|
||||
void init_din_SessionSetupReqType(struct din_SessionSetupReqType* SessionSetupReqType) {
|
||||
(void) SessionSetupReqType;
|
||||
}
|
||||
|
||||
void init_din_CertificateInstallationReqType(struct din_CertificateInstallationReqType* CertificateInstallationReqType) {
|
||||
CertificateInstallationReqType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SessionSetupResType(struct din_SessionSetupResType* SessionSetupResType) {
|
||||
SessionSetupResType->DateTimeNow_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServiceDiscoveryReqType(struct din_ServiceDiscoveryReqType* ServiceDiscoveryReqType) {
|
||||
ServiceDiscoveryReqType->ServiceScope_isUsed = 0u;
|
||||
ServiceDiscoveryReqType->ServiceCategory_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServiceDiscoveryResType(struct din_ServiceDiscoveryResType* ServiceDiscoveryResType) {
|
||||
ServiceDiscoveryResType->ServiceList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServiceDetailReqType(struct din_ServiceDetailReqType* ServiceDetailReqType) {
|
||||
(void) ServiceDetailReqType;
|
||||
}
|
||||
|
||||
void init_din_ServiceDetailResType(struct din_ServiceDetailResType* ServiceDetailResType) {
|
||||
ServiceDetailResType->ServiceParameterList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ServicePaymentSelectionReqType(struct din_ServicePaymentSelectionReqType* ServicePaymentSelectionReqType) {
|
||||
(void) ServicePaymentSelectionReqType;
|
||||
}
|
||||
|
||||
void init_din_ServicePaymentSelectionResType(struct din_ServicePaymentSelectionResType* ServicePaymentSelectionResType) {
|
||||
(void) ServicePaymentSelectionResType;
|
||||
}
|
||||
|
||||
void init_din_PaymentDetailsReqType(struct din_PaymentDetailsReqType* PaymentDetailsReqType) {
|
||||
(void) PaymentDetailsReqType;
|
||||
}
|
||||
|
||||
void init_din_PaymentDetailsResType(struct din_PaymentDetailsResType* PaymentDetailsResType) {
|
||||
(void) PaymentDetailsResType;
|
||||
}
|
||||
|
||||
void init_din_ContractAuthenticationReqType(struct din_ContractAuthenticationReqType* ContractAuthenticationReqType) {
|
||||
ContractAuthenticationReqType->Id_isUsed = 0u;
|
||||
ContractAuthenticationReqType->GenChallenge_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ContractAuthenticationResType(struct din_ContractAuthenticationResType* ContractAuthenticationResType) {
|
||||
(void) ContractAuthenticationResType;
|
||||
}
|
||||
|
||||
void init_din_ChargeParameterDiscoveryReqType(struct din_ChargeParameterDiscoveryReqType* ChargeParameterDiscoveryReqType) {
|
||||
ChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ChargeParameterDiscoveryResType(struct din_ChargeParameterDiscoveryResType* ChargeParameterDiscoveryResType) {
|
||||
ChargeParameterDiscoveryResType->SAScheduleList_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->SASchedules_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_PowerDeliveryReqType(struct din_PowerDeliveryReqType* PowerDeliveryReqType) {
|
||||
PowerDeliveryReqType->ChargingProfile_isUsed = 0u;
|
||||
PowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u;
|
||||
PowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_PowerDeliveryResType(struct din_PowerDeliveryResType* PowerDeliveryResType) {
|
||||
PowerDeliveryResType->AC_EVSEStatus_isUsed = 0u;
|
||||
PowerDeliveryResType->DC_EVSEStatus_isUsed = 0u;
|
||||
PowerDeliveryResType->EVSEStatus_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_ChargingStatusReqType(struct din_ChargingStatusReqType* ChargingStatusReqType) {
|
||||
(void) ChargingStatusReqType;
|
||||
}
|
||||
|
||||
void init_din_ChargingStatusResType(struct din_ChargingStatusResType* ChargingStatusResType) {
|
||||
ChargingStatusResType->EVSEMaxCurrent_isUsed = 0u;
|
||||
ChargingStatusResType->MeterInfo_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_MeteringReceiptReqType(struct din_MeteringReceiptReqType* MeteringReceiptReqType) {
|
||||
MeteringReceiptReqType->Id_isUsed = 0u;
|
||||
MeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_MeteringReceiptResType(struct din_MeteringReceiptResType* MeteringReceiptResType) {
|
||||
(void) MeteringReceiptResType;
|
||||
}
|
||||
|
||||
void init_din_SessionStopType(struct din_SessionStopType* SessionStopType) {
|
||||
(void) SessionStopType;
|
||||
}
|
||||
|
||||
void init_din_SessionStopResType(struct din_SessionStopResType* SessionStopResType) {
|
||||
(void) SessionStopResType;
|
||||
}
|
||||
|
||||
void init_din_CertificateUpdateReqType(struct din_CertificateUpdateReqType* CertificateUpdateReqType) {
|
||||
CertificateUpdateReqType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_CertificateUpdateResType(struct din_CertificateUpdateResType* CertificateUpdateResType) {
|
||||
(void) CertificateUpdateResType;
|
||||
}
|
||||
|
||||
void init_din_BodyBaseType(struct din_BodyBaseType* BodyBaseType) {
|
||||
(void) BodyBaseType;
|
||||
}
|
||||
|
||||
void init_din_NotificationType(struct din_NotificationType* NotificationType) {
|
||||
NotificationType->FaultMsg_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_SignatureType(struct din_SignatureType* SignatureType) {
|
||||
SignatureType->Id_isUsed = 0u;
|
||||
SignatureType->KeyInfo_isUsed = 0u;
|
||||
SignatureType->Object_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_MessageHeaderType(struct din_MessageHeaderType* MessageHeaderType) {
|
||||
MessageHeaderType->Notification_isUsed = 0u;
|
||||
MessageHeaderType->Signature_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_BodyType(struct din_BodyType* BodyType) {
|
||||
BodyType->BodyElement_isUsed = 0u;
|
||||
BodyType->CableCheckReq_isUsed = 0u;
|
||||
BodyType->CableCheckRes_isUsed = 0u;
|
||||
BodyType->CertificateInstallationReq_isUsed = 0u;
|
||||
BodyType->CertificateInstallationRes_isUsed = 0u;
|
||||
BodyType->CertificateUpdateReq_isUsed = 0u;
|
||||
BodyType->CertificateUpdateRes_isUsed = 0u;
|
||||
BodyType->ChargeParameterDiscoveryReq_isUsed = 0u;
|
||||
BodyType->ChargeParameterDiscoveryRes_isUsed = 0u;
|
||||
BodyType->ChargingStatusReq_isUsed = 0u;
|
||||
BodyType->ChargingStatusRes_isUsed = 0u;
|
||||
BodyType->ContractAuthenticationReq_isUsed = 0u;
|
||||
BodyType->ContractAuthenticationRes_isUsed = 0u;
|
||||
BodyType->CurrentDemandReq_isUsed = 0u;
|
||||
BodyType->CurrentDemandRes_isUsed = 0u;
|
||||
BodyType->MeteringReceiptReq_isUsed = 0u;
|
||||
BodyType->MeteringReceiptRes_isUsed = 0u;
|
||||
BodyType->PaymentDetailsReq_isUsed = 0u;
|
||||
BodyType->PaymentDetailsRes_isUsed = 0u;
|
||||
BodyType->PowerDeliveryReq_isUsed = 0u;
|
||||
BodyType->PowerDeliveryRes_isUsed = 0u;
|
||||
BodyType->PreChargeReq_isUsed = 0u;
|
||||
BodyType->PreChargeRes_isUsed = 0u;
|
||||
BodyType->ServiceDetailReq_isUsed = 0u;
|
||||
BodyType->ServiceDetailRes_isUsed = 0u;
|
||||
BodyType->ServiceDiscoveryReq_isUsed = 0u;
|
||||
BodyType->ServiceDiscoveryRes_isUsed = 0u;
|
||||
BodyType->ServicePaymentSelectionReq_isUsed = 0u;
|
||||
BodyType->ServicePaymentSelectionRes_isUsed = 0u;
|
||||
BodyType->SessionSetupReq_isUsed = 0u;
|
||||
BodyType->SessionSetupRes_isUsed = 0u;
|
||||
BodyType->SessionStopReq_isUsed = 0u;
|
||||
BodyType->SessionStopRes_isUsed = 0u;
|
||||
BodyType->WeldingDetectionReq_isUsed = 0u;
|
||||
BodyType->WeldingDetectionRes_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_din_V2G_Message(struct din_V2G_Message* V2G_Message) {
|
||||
(void) V2G_Message;
|
||||
}
|
||||
|
||||
|
||||
16703
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/din/din_msgDefDecoder.c
Normal file
16703
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/din/din_msgDefDecoder.c
Normal file
File diff suppressed because it is too large
Load Diff
12662
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/din/din_msgDefEncoder.c
Normal file
12662
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/din/din_msgDefEncoder.c
Normal file
File diff suppressed because it is too large
Load Diff
79
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/exi_v2gtp.c
Normal file
79
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/exi_v2gtp.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file exi_v2gtp.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
|
||||
#include "cbv2g/exi_v2gtp.h"
|
||||
|
||||
|
||||
/* V2G Transport Protocol version */
|
||||
#define V2GTP_VERSION 0x01u
|
||||
#define V2GTP_VERSION_NOT 0xFEu
|
||||
|
||||
|
||||
void V2GTP_WriteHeader(uint8_t* stream_data, uint32_t stream_payload_length)
|
||||
{
|
||||
V2GTP20_WriteHeader(stream_data, stream_payload_length, V2GTP20_SAP_PAYLOAD_ID);
|
||||
}
|
||||
|
||||
void V2GTP20_WriteHeader(uint8_t* stream_data, uint32_t stream_payload_length, uint16_t v2gtp20_payload_id)
|
||||
{
|
||||
/* write version and inverse version */
|
||||
stream_data[0] = V2GTP_VERSION;
|
||||
stream_data[1] = V2GTP_VERSION_NOT;
|
||||
|
||||
/* write payload type */
|
||||
stream_data[2] = (uint8_t)(v2gtp20_payload_id >> 8 & 0xFFu);
|
||||
stream_data[3] = (uint8_t)(v2gtp20_payload_id & 0xFFu);
|
||||
|
||||
/* write payload length */
|
||||
stream_data[4] = (uint8_t)(stream_payload_length >> 24 & 0xFFu);
|
||||
stream_data[5] = (uint8_t)(stream_payload_length >> 16 & 0xFFu);
|
||||
stream_data[6] = (uint8_t)(stream_payload_length >> 8 & 0xFFu);
|
||||
stream_data[7] = (uint8_t)(stream_payload_length & 0xFFu);
|
||||
}
|
||||
|
||||
int V2GTP_ReadHeader(const uint8_t* stream_data, uint32_t* stream_payload_length)
|
||||
{
|
||||
return V2GTP20_ReadHeader(stream_data, stream_payload_length, V2GTP20_SAP_PAYLOAD_ID);
|
||||
}
|
||||
|
||||
int V2GTP20_ReadHeader(const uint8_t* stream_data, uint32_t* stream_payload_length, uint16_t v2gtp20_payload_id)
|
||||
{
|
||||
uint16_t payload_id;
|
||||
|
||||
/* check version and inversion */
|
||||
if ((stream_data[0] != V2GTP_VERSION) || (stream_data[1] != V2GTP_VERSION_NOT))
|
||||
{
|
||||
return V2GTP_ERROR__VERSION_DOES_NOT_MATCH;
|
||||
}
|
||||
|
||||
/* check payload id */
|
||||
payload_id = (stream_data[2] << 8) | stream_data[3];
|
||||
if (payload_id != v2gtp20_payload_id)
|
||||
{
|
||||
return V2GTP_ERROR__PAYLOAD_ID_DOES_NOT_MATCH;
|
||||
}
|
||||
|
||||
/* determine payload length */
|
||||
*stream_payload_length = (stream_data[4] << 24) | (stream_data[5] << 16) | (stream_data[6] << 8) | stream_data[7];
|
||||
|
||||
return V2GTP_ERROR__NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,590 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso2_msgDefDatatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/iso_2/iso2_msgDefDatatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_iso2_exiDocument(struct iso2_exiDocument* exiDoc) {
|
||||
(void) exiDoc;
|
||||
}
|
||||
void init_iso2_CostType(struct iso2_CostType* CostType) {
|
||||
CostType->amountMultiplier_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_TransformType(struct iso2_TransformType* TransformType) {
|
||||
TransformType->ANY_isUsed = 0u;
|
||||
TransformType->XPath_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_IntervalType(struct iso2_IntervalType* IntervalType) {
|
||||
(void) IntervalType;
|
||||
}
|
||||
|
||||
void init_iso2_ConsumptionCostType(struct iso2_ConsumptionCostType* ConsumptionCostType) {
|
||||
ConsumptionCostType->Cost.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_TransformsType(struct iso2_TransformsType* TransformsType) {
|
||||
(void) TransformsType;
|
||||
}
|
||||
|
||||
void init_iso2_DSAKeyValueType(struct iso2_DSAKeyValueType* DSAKeyValueType) {
|
||||
DSAKeyValueType->P_isUsed = 0u;
|
||||
DSAKeyValueType->Q_isUsed = 0u;
|
||||
DSAKeyValueType->G_isUsed = 0u;
|
||||
DSAKeyValueType->J_isUsed = 0u;
|
||||
DSAKeyValueType->Seed_isUsed = 0u;
|
||||
DSAKeyValueType->PgenCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_X509IssuerSerialType(struct iso2_X509IssuerSerialType* X509IssuerSerialType) {
|
||||
(void) X509IssuerSerialType;
|
||||
}
|
||||
|
||||
void init_iso2_RelativeTimeIntervalType(struct iso2_RelativeTimeIntervalType* RelativeTimeIntervalType) {
|
||||
RelativeTimeIntervalType->duration_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PMaxScheduleEntryType(struct iso2_PMaxScheduleEntryType* PMaxScheduleEntryType) {
|
||||
PMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u;
|
||||
PMaxScheduleEntryType->TimeInterval_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_DigestMethodType(struct iso2_DigestMethodType* DigestMethodType) {
|
||||
DigestMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_RSAKeyValueType(struct iso2_RSAKeyValueType* RSAKeyValueType) {
|
||||
(void) RSAKeyValueType;
|
||||
}
|
||||
|
||||
void init_iso2_SalesTariffEntryType(struct iso2_SalesTariffEntryType* SalesTariffEntryType) {
|
||||
SalesTariffEntryType->ConsumptionCost.arrayLen = 0u;
|
||||
SalesTariffEntryType->RelativeTimeInterval_isUsed = 0u;
|
||||
SalesTariffEntryType->TimeInterval_isUsed = 0u;
|
||||
SalesTariffEntryType->EPriceLevel_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_CanonicalizationMethodType(struct iso2_CanonicalizationMethodType* CanonicalizationMethodType) {
|
||||
CanonicalizationMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SignatureMethodType(struct iso2_SignatureMethodType* SignatureMethodType) {
|
||||
SignatureMethodType->HMACOutputLength_isUsed = 0u;
|
||||
SignatureMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_KeyValueType(struct iso2_KeyValueType* KeyValueType) {
|
||||
KeyValueType->DSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->RSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PhysicalValueType(struct iso2_PhysicalValueType* PhysicalValueType) {
|
||||
(void) PhysicalValueType;
|
||||
}
|
||||
|
||||
void init_iso2_ParameterType(struct iso2_ParameterType* ParameterType) {
|
||||
ParameterType->boolValue_isUsed = 0u;
|
||||
ParameterType->byteValue_isUsed = 0u;
|
||||
ParameterType->shortValue_isUsed = 0u;
|
||||
ParameterType->intValue_isUsed = 0u;
|
||||
ParameterType->physicalValue_isUsed = 0u;
|
||||
ParameterType->stringValue_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PMaxScheduleType(struct iso2_PMaxScheduleType* PMaxScheduleType) {
|
||||
PMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ReferenceType(struct iso2_ReferenceType* ReferenceType) {
|
||||
ReferenceType->Id_isUsed = 0u;
|
||||
ReferenceType->Type_isUsed = 0u;
|
||||
ReferenceType->URI_isUsed = 0u;
|
||||
ReferenceType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_RetrievalMethodType(struct iso2_RetrievalMethodType* RetrievalMethodType) {
|
||||
RetrievalMethodType->Type_isUsed = 0u;
|
||||
RetrievalMethodType->URI_isUsed = 0u;
|
||||
RetrievalMethodType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SalesTariffType(struct iso2_SalesTariffType* SalesTariffType) {
|
||||
SalesTariffType->SalesTariffEntry.arrayLen = 0u;
|
||||
SalesTariffType->Id_isUsed = 0u;
|
||||
SalesTariffType->SalesTariffDescription_isUsed = 0u;
|
||||
SalesTariffType->NumEPriceLevels_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_X509DataType(struct iso2_X509DataType* X509DataType) {
|
||||
X509DataType->X509IssuerSerial_isUsed = 0u;
|
||||
X509DataType->X509SKI_isUsed = 0u;
|
||||
X509DataType->X509SubjectName_isUsed = 0u;
|
||||
X509DataType->X509Certificate_isUsed = 0u;
|
||||
X509DataType->X509CRL_isUsed = 0u;
|
||||
X509DataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PGPDataType(struct iso2_PGPDataType* PGPDataType) {
|
||||
PGPDataType->choice_1_isUsed = 0u;
|
||||
PGPDataType->choice_2_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SPKIDataType(struct iso2_SPKIDataType* SPKIDataType) {
|
||||
SPKIDataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SignedInfoType(struct iso2_SignedInfoType* SignedInfoType) {
|
||||
SignedInfoType->Reference.arrayLen = 0u;
|
||||
SignedInfoType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ProfileEntryType(struct iso2_ProfileEntryType* ProfileEntryType) {
|
||||
ProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_DC_EVStatusType(struct iso2_DC_EVStatusType* DC_EVStatusType) {
|
||||
(void) DC_EVStatusType;
|
||||
}
|
||||
|
||||
void init_iso2_ParameterSetType(struct iso2_ParameterSetType* ParameterSetType) {
|
||||
ParameterSetType->Parameter.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SAScheduleTupleType(struct iso2_SAScheduleTupleType* SAScheduleTupleType) {
|
||||
SAScheduleTupleType->SalesTariff_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SelectedServiceType(struct iso2_SelectedServiceType* SelectedServiceType) {
|
||||
SelectedServiceType->ParameterSetID_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ServiceType(struct iso2_ServiceType* ServiceType) {
|
||||
ServiceType->ServiceName_isUsed = 0u;
|
||||
ServiceType->ServiceScope_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SignatureValueType(struct iso2_SignatureValueType* SignatureValueType) {
|
||||
SignatureValueType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SubCertificatesType(struct iso2_SubCertificatesType* SubCertificatesType) {
|
||||
SubCertificatesType->Certificate.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_KeyInfoType(struct iso2_KeyInfoType* KeyInfoType) {
|
||||
KeyInfoType->Id_isUsed = 0u;
|
||||
KeyInfoType->KeyName_isUsed = 0u;
|
||||
KeyInfoType->KeyValue_isUsed = 0u;
|
||||
KeyInfoType->RetrievalMethod_isUsed = 0u;
|
||||
KeyInfoType->X509Data_isUsed = 0u;
|
||||
KeyInfoType->PGPData_isUsed = 0u;
|
||||
KeyInfoType->SPKIData_isUsed = 0u;
|
||||
KeyInfoType->MgmtData_isUsed = 0u;
|
||||
KeyInfoType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ObjectType(struct iso2_ObjectType* ObjectType) {
|
||||
ObjectType->Encoding_isUsed = 0u;
|
||||
ObjectType->Id_isUsed = 0u;
|
||||
ObjectType->MimeType_isUsed = 0u;
|
||||
ObjectType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SupportedEnergyTransferModeType(struct iso2_SupportedEnergyTransferModeType* SupportedEnergyTransferModeType) {
|
||||
SupportedEnergyTransferModeType->EnergyTransferMode.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_CertificateChainType(struct iso2_CertificateChainType* CertificateChainType) {
|
||||
CertificateChainType->Id_isUsed = 0u;
|
||||
CertificateChainType->SubCertificates_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_BodyBaseType(struct iso2_BodyBaseType* BodyBaseType) {
|
||||
(void) BodyBaseType;
|
||||
}
|
||||
|
||||
void init_iso2_NotificationType(struct iso2_NotificationType* NotificationType) {
|
||||
NotificationType->FaultMsg_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_DC_EVSEStatusType(struct iso2_DC_EVSEStatusType* DC_EVSEStatusType) {
|
||||
DC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_EVSEStatusType(struct iso2_EVSEStatusType* EVSEStatusType) {
|
||||
(void) EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_iso2_SelectedServiceListType(struct iso2_SelectedServiceListType* SelectedServiceListType) {
|
||||
SelectedServiceListType->SelectedService.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PaymentOptionListType(struct iso2_PaymentOptionListType* PaymentOptionListType) {
|
||||
PaymentOptionListType->PaymentOption.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SignatureType(struct iso2_SignatureType* SignatureType) {
|
||||
SignatureType->Id_isUsed = 0u;
|
||||
SignatureType->KeyInfo_isUsed = 0u;
|
||||
SignatureType->Object_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ChargingProfileType(struct iso2_ChargingProfileType* ChargingProfileType) {
|
||||
ChargingProfileType->ProfileEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ServiceParameterListType(struct iso2_ServiceParameterListType* ServiceParameterListType) {
|
||||
ServiceParameterListType->ParameterSet.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ListOfRootCertificateIDsType(struct iso2_ListOfRootCertificateIDsType* ListOfRootCertificateIDsType) {
|
||||
ListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_EVChargeParameterType(struct iso2_EVChargeParameterType* EVChargeParameterType) {
|
||||
EVChargeParameterType->DepartureTime_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_AC_EVChargeParameterType(struct iso2_AC_EVChargeParameterType* AC_EVChargeParameterType) {
|
||||
AC_EVChargeParameterType->DepartureTime_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_DC_EVChargeParameterType(struct iso2_DC_EVChargeParameterType* DC_EVChargeParameterType) {
|
||||
DC_EVChargeParameterType->DepartureTime_isUsed = 0u;
|
||||
DC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 0u;
|
||||
DC_EVChargeParameterType->EVEnergyCapacity_isUsed = 0u;
|
||||
DC_EVChargeParameterType->EVEnergyRequest_isUsed = 0u;
|
||||
DC_EVChargeParameterType->FullSOC_isUsed = 0u;
|
||||
DC_EVChargeParameterType->BulkSOC_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_SASchedulesType(struct iso2_SASchedulesType* SASchedulesType) {
|
||||
(void) SASchedulesType;
|
||||
}
|
||||
|
||||
void init_iso2_SAScheduleListType(struct iso2_SAScheduleListType* SAScheduleListType) {
|
||||
SAScheduleListType->SAScheduleTuple.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ChargeServiceType(struct iso2_ChargeServiceType* ChargeServiceType) {
|
||||
ChargeServiceType->ServiceName_isUsed = 0u;
|
||||
ChargeServiceType->ServiceScope_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_EVPowerDeliveryParameterType(struct iso2_EVPowerDeliveryParameterType* EVPowerDeliveryParameterType) {
|
||||
(void) EVPowerDeliveryParameterType;
|
||||
}
|
||||
|
||||
void init_iso2_DC_EVPowerDeliveryParameterType(struct iso2_DC_EVPowerDeliveryParameterType* DC_EVPowerDeliveryParameterType) {
|
||||
DC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ContractSignatureEncryptedPrivateKeyType(struct iso2_ContractSignatureEncryptedPrivateKeyType* ContractSignatureEncryptedPrivateKeyType) {
|
||||
(void) ContractSignatureEncryptedPrivateKeyType;
|
||||
}
|
||||
|
||||
void init_iso2_EVSEChargeParameterType(struct iso2_EVSEChargeParameterType* EVSEChargeParameterType) {
|
||||
(void) EVSEChargeParameterType;
|
||||
}
|
||||
|
||||
void init_iso2_AC_EVSEChargeParameterType(struct iso2_AC_EVSEChargeParameterType* AC_EVSEChargeParameterType) {
|
||||
(void) AC_EVSEChargeParameterType;
|
||||
}
|
||||
|
||||
void init_iso2_DC_EVSEChargeParameterType(struct iso2_DC_EVSEChargeParameterType* DC_EVSEChargeParameterType) {
|
||||
DC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u;
|
||||
DC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ServiceListType(struct iso2_ServiceListType* ServiceListType) {
|
||||
ServiceListType->Service.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_DiffieHellmanPublickeyType(struct iso2_DiffieHellmanPublickeyType* DiffieHellmanPublickeyType) {
|
||||
(void) DiffieHellmanPublickeyType;
|
||||
}
|
||||
|
||||
void init_iso2_EMAIDType(struct iso2_EMAIDType* EMAIDType) {
|
||||
(void) EMAIDType;
|
||||
}
|
||||
|
||||
void init_iso2_AC_EVSEStatusType(struct iso2_AC_EVSEStatusType* AC_EVSEStatusType) {
|
||||
(void) AC_EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_iso2_MeterInfoType(struct iso2_MeterInfoType* MeterInfoType) {
|
||||
MeterInfoType->MeterReading_isUsed = 0u;
|
||||
MeterInfoType->SigMeterReading_isUsed = 0u;
|
||||
MeterInfoType->MeterStatus_isUsed = 0u;
|
||||
MeterInfoType->TMeter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_MessageHeaderType(struct iso2_MessageHeaderType* MessageHeaderType) {
|
||||
MessageHeaderType->Notification_isUsed = 0u;
|
||||
MessageHeaderType->Signature_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PowerDeliveryReqType(struct iso2_PowerDeliveryReqType* PowerDeliveryReqType) {
|
||||
PowerDeliveryReqType->ChargingProfile_isUsed = 0u;
|
||||
PowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u;
|
||||
PowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_CurrentDemandResType(struct iso2_CurrentDemandResType* CurrentDemandResType) {
|
||||
CurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 0u;
|
||||
CurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 0u;
|
||||
CurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 0u;
|
||||
CurrentDemandResType->MeterInfo_isUsed = 0u;
|
||||
CurrentDemandResType->ReceiptRequired_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ChargingStatusResType(struct iso2_ChargingStatusResType* ChargingStatusResType) {
|
||||
ChargingStatusResType->EVSEMaxCurrent_isUsed = 0u;
|
||||
ChargingStatusResType->MeterInfo_isUsed = 0u;
|
||||
ChargingStatusResType->ReceiptRequired_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_AuthorizationReqType(struct iso2_AuthorizationReqType* AuthorizationReqType) {
|
||||
AuthorizationReqType->Id_isUsed = 0u;
|
||||
AuthorizationReqType->GenChallenge_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PreChargeReqType(struct iso2_PreChargeReqType* PreChargeReqType) {
|
||||
(void) PreChargeReqType;
|
||||
}
|
||||
|
||||
void init_iso2_ServiceDetailResType(struct iso2_ServiceDetailResType* ServiceDetailResType) {
|
||||
ServiceDetailResType->ServiceParameterList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PaymentServiceSelectionResType(struct iso2_PaymentServiceSelectionResType* PaymentServiceSelectionResType) {
|
||||
(void) PaymentServiceSelectionResType;
|
||||
}
|
||||
|
||||
void init_iso2_CertificateUpdateReqType(struct iso2_CertificateUpdateReqType* CertificateUpdateReqType) {
|
||||
(void) CertificateUpdateReqType;
|
||||
}
|
||||
|
||||
void init_iso2_SessionSetupResType(struct iso2_SessionSetupResType* SessionSetupResType) {
|
||||
SessionSetupResType->EVSETimeStamp_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_CertificateInstallationReqType(struct iso2_CertificateInstallationReqType* CertificateInstallationReqType) {
|
||||
(void) CertificateInstallationReqType;
|
||||
}
|
||||
|
||||
void init_iso2_CertificateInstallationResType(struct iso2_CertificateInstallationResType* CertificateInstallationResType) {
|
||||
(void) CertificateInstallationResType;
|
||||
}
|
||||
|
||||
void init_iso2_WeldingDetectionResType(struct iso2_WeldingDetectionResType* WeldingDetectionResType) {
|
||||
(void) WeldingDetectionResType;
|
||||
}
|
||||
|
||||
void init_iso2_CurrentDemandReqType(struct iso2_CurrentDemandReqType* CurrentDemandReqType) {
|
||||
CurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u;
|
||||
CurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u;
|
||||
CurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u;
|
||||
CurrentDemandReqType->BulkChargingComplete_isUsed = 0u;
|
||||
CurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u;
|
||||
CurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PreChargeResType(struct iso2_PreChargeResType* PreChargeResType) {
|
||||
(void) PreChargeResType;
|
||||
}
|
||||
|
||||
void init_iso2_CertificateUpdateResType(struct iso2_CertificateUpdateResType* CertificateUpdateResType) {
|
||||
CertificateUpdateResType->RetryCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_MeteringReceiptReqType(struct iso2_MeteringReceiptReqType* MeteringReceiptReqType) {
|
||||
MeteringReceiptReqType->Id_isUsed = 0u;
|
||||
MeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ChargingStatusReqType(struct iso2_ChargingStatusReqType* ChargingStatusReqType) {
|
||||
(void) ChargingStatusReqType;
|
||||
}
|
||||
|
||||
void init_iso2_SessionStopResType(struct iso2_SessionStopResType* SessionStopResType) {
|
||||
(void) SessionStopResType;
|
||||
}
|
||||
|
||||
void init_iso2_ChargeParameterDiscoveryReqType(struct iso2_ChargeParameterDiscoveryReqType* ChargeParameterDiscoveryReqType) {
|
||||
ChargeParameterDiscoveryReqType->MaxEntriesSAScheduleTuple_isUsed = 0u;
|
||||
ChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_CableCheckReqType(struct iso2_CableCheckReqType* CableCheckReqType) {
|
||||
(void) CableCheckReqType;
|
||||
}
|
||||
|
||||
void init_iso2_WeldingDetectionReqType(struct iso2_WeldingDetectionReqType* WeldingDetectionReqType) {
|
||||
(void) WeldingDetectionReqType;
|
||||
}
|
||||
|
||||
void init_iso2_PowerDeliveryResType(struct iso2_PowerDeliveryResType* PowerDeliveryResType) {
|
||||
PowerDeliveryResType->AC_EVSEStatus_isUsed = 0u;
|
||||
PowerDeliveryResType->DC_EVSEStatus_isUsed = 0u;
|
||||
PowerDeliveryResType->EVSEStatus_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ChargeParameterDiscoveryResType(struct iso2_ChargeParameterDiscoveryResType* ChargeParameterDiscoveryResType) {
|
||||
ChargeParameterDiscoveryResType->SAScheduleList_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->SASchedules_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u;
|
||||
ChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_PaymentServiceSelectionReqType(struct iso2_PaymentServiceSelectionReqType* PaymentServiceSelectionReqType) {
|
||||
(void) PaymentServiceSelectionReqType;
|
||||
}
|
||||
|
||||
void init_iso2_MeteringReceiptResType(struct iso2_MeteringReceiptResType* MeteringReceiptResType) {
|
||||
MeteringReceiptResType->AC_EVSEStatus_isUsed = 0u;
|
||||
MeteringReceiptResType->DC_EVSEStatus_isUsed = 0u;
|
||||
MeteringReceiptResType->EVSEStatus_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_CableCheckResType(struct iso2_CableCheckResType* CableCheckResType) {
|
||||
(void) CableCheckResType;
|
||||
}
|
||||
|
||||
void init_iso2_ServiceDiscoveryResType(struct iso2_ServiceDiscoveryResType* ServiceDiscoveryResType) {
|
||||
ServiceDiscoveryResType->ServiceList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_ServiceDetailReqType(struct iso2_ServiceDetailReqType* ServiceDetailReqType) {
|
||||
(void) ServiceDetailReqType;
|
||||
}
|
||||
|
||||
void init_iso2_SessionSetupReqType(struct iso2_SessionSetupReqType* SessionSetupReqType) {
|
||||
(void) SessionSetupReqType;
|
||||
}
|
||||
|
||||
void init_iso2_SessionStopReqType(struct iso2_SessionStopReqType* SessionStopReqType) {
|
||||
(void) SessionStopReqType;
|
||||
}
|
||||
|
||||
void init_iso2_ServiceDiscoveryReqType(struct iso2_ServiceDiscoveryReqType* ServiceDiscoveryReqType) {
|
||||
ServiceDiscoveryReqType->ServiceScope_isUsed = 0u;
|
||||
ServiceDiscoveryReqType->ServiceCategory_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_AuthorizationResType(struct iso2_AuthorizationResType* AuthorizationResType) {
|
||||
(void) AuthorizationResType;
|
||||
}
|
||||
|
||||
void init_iso2_PaymentDetailsReqType(struct iso2_PaymentDetailsReqType* PaymentDetailsReqType) {
|
||||
(void) PaymentDetailsReqType;
|
||||
}
|
||||
|
||||
void init_iso2_PaymentDetailsResType(struct iso2_PaymentDetailsResType* PaymentDetailsResType) {
|
||||
(void) PaymentDetailsResType;
|
||||
}
|
||||
|
||||
void init_iso2_BodyType(struct iso2_BodyType* BodyType) {
|
||||
BodyType->AuthorizationReq_isUsed = 0u;
|
||||
BodyType->AuthorizationRes_isUsed = 0u;
|
||||
BodyType->BodyElement_isUsed = 0u;
|
||||
BodyType->CableCheckReq_isUsed = 0u;
|
||||
BodyType->CableCheckRes_isUsed = 0u;
|
||||
BodyType->CertificateInstallationReq_isUsed = 0u;
|
||||
BodyType->CertificateInstallationRes_isUsed = 0u;
|
||||
BodyType->CertificateUpdateReq_isUsed = 0u;
|
||||
BodyType->CertificateUpdateRes_isUsed = 0u;
|
||||
BodyType->ChargeParameterDiscoveryReq_isUsed = 0u;
|
||||
BodyType->ChargeParameterDiscoveryRes_isUsed = 0u;
|
||||
BodyType->ChargingStatusReq_isUsed = 0u;
|
||||
BodyType->ChargingStatusRes_isUsed = 0u;
|
||||
BodyType->CurrentDemandReq_isUsed = 0u;
|
||||
BodyType->CurrentDemandRes_isUsed = 0u;
|
||||
BodyType->MeteringReceiptReq_isUsed = 0u;
|
||||
BodyType->MeteringReceiptRes_isUsed = 0u;
|
||||
BodyType->PaymentDetailsReq_isUsed = 0u;
|
||||
BodyType->PaymentDetailsRes_isUsed = 0u;
|
||||
BodyType->PaymentServiceSelectionReq_isUsed = 0u;
|
||||
BodyType->PaymentServiceSelectionRes_isUsed = 0u;
|
||||
BodyType->PowerDeliveryReq_isUsed = 0u;
|
||||
BodyType->PowerDeliveryRes_isUsed = 0u;
|
||||
BodyType->PreChargeReq_isUsed = 0u;
|
||||
BodyType->PreChargeRes_isUsed = 0u;
|
||||
BodyType->ServiceDetailReq_isUsed = 0u;
|
||||
BodyType->ServiceDetailRes_isUsed = 0u;
|
||||
BodyType->ServiceDiscoveryReq_isUsed = 0u;
|
||||
BodyType->ServiceDiscoveryRes_isUsed = 0u;
|
||||
BodyType->SessionSetupReq_isUsed = 0u;
|
||||
BodyType->SessionSetupRes_isUsed = 0u;
|
||||
BodyType->SessionStopReq_isUsed = 0u;
|
||||
BodyType->SessionStopRes_isUsed = 0u;
|
||||
BodyType->WeldingDetectionReq_isUsed = 0u;
|
||||
BodyType->WeldingDetectionRes_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso2_V2G_Message(struct iso2_V2G_Message* V2G_Message) {
|
||||
(void) V2G_Message;
|
||||
}
|
||||
|
||||
// init for fragment
|
||||
void init_iso2_exiFragment(struct iso2_exiFragment* exiFrag) {
|
||||
exiFrag->AuthorizationReq_isUsed = 0u;
|
||||
exiFrag->CertificateInstallationReq_isUsed = 0u;
|
||||
exiFrag->CertificateUpdateReq_isUsed = 0u;
|
||||
exiFrag->ContractSignatureCertChain_isUsed = 0u;
|
||||
exiFrag->ContractSignatureEncryptedPrivateKey_isUsed = 0u;
|
||||
exiFrag->DHpublickey_isUsed = 0u;
|
||||
exiFrag->MeteringReceiptReq_isUsed = 0u;
|
||||
exiFrag->SalesTariff_isUsed = 0u;
|
||||
exiFrag->SignedInfo_isUsed = 0u;
|
||||
exiFrag->eMAID_isUsed = 0u;
|
||||
}
|
||||
|
||||
// init for xmldsig fragment
|
||||
void init_iso2_xmldsigFragment(struct iso2_xmldsigFragment* xmldsigFrag) {
|
||||
xmldsigFrag->CanonicalizationMethod_isUsed = 0u;
|
||||
xmldsigFrag->DSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->DigestMethod_isUsed = 0u;
|
||||
xmldsigFrag->KeyInfo_isUsed = 0u;
|
||||
xmldsigFrag->KeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Object_isUsed = 0u;
|
||||
xmldsigFrag->PGPData_isUsed = 0u;
|
||||
xmldsigFrag->RSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Reference_isUsed = 0u;
|
||||
xmldsigFrag->RetrievalMethod_isUsed = 0u;
|
||||
xmldsigFrag->SPKIData_isUsed = 0u;
|
||||
xmldsigFrag->Signature_isUsed = 0u;
|
||||
xmldsigFrag->SignatureMethod_isUsed = 0u;
|
||||
xmldsigFrag->SignatureValue_isUsed = 0u;
|
||||
xmldsigFrag->SignedInfo_isUsed = 0u;
|
||||
xmldsigFrag->Transform_isUsed = 0u;
|
||||
xmldsigFrag->Transforms_isUsed = 0u;
|
||||
xmldsigFrag->X509Data_isUsed = 0u;
|
||||
xmldsigFrag->X509IssuerSerial_isUsed = 0u;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,232 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_ACDP_Datatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/iso_20/iso20_ACDP_Datatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_iso20_acdp_exiDocument(struct iso20_acdp_exiDocument* exiDoc) {
|
||||
exiDoc->ACDP_VehiclePositioningReq_isUsed = 0u;
|
||||
exiDoc->ACDP_VehiclePositioningRes_isUsed = 0u;
|
||||
exiDoc->ACDP_ConnectReq_isUsed = 0u;
|
||||
exiDoc->ACDP_ConnectRes_isUsed = 0u;
|
||||
exiDoc->ACDP_DisconnectReq_isUsed = 0u;
|
||||
exiDoc->ACDP_DisconnectRes_isUsed = 0u;
|
||||
exiDoc->ACDP_SystemStatusReq_isUsed = 0u;
|
||||
exiDoc->ACDP_SystemStatusRes_isUsed = 0u;
|
||||
exiDoc->CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->CLResControlMode_isUsed = 0u;
|
||||
exiDoc->Signature_isUsed = 0u;
|
||||
exiDoc->SignatureValue_isUsed = 0u;
|
||||
exiDoc->SignedInfo_isUsed = 0u;
|
||||
exiDoc->CanonicalizationMethod_isUsed = 0u;
|
||||
exiDoc->SignatureMethod_isUsed = 0u;
|
||||
exiDoc->Reference_isUsed = 0u;
|
||||
exiDoc->Transforms_isUsed = 0u;
|
||||
exiDoc->Transform_isUsed = 0u;
|
||||
exiDoc->DigestMethod_isUsed = 0u;
|
||||
exiDoc->KeyInfo_isUsed = 0u;
|
||||
exiDoc->KeyValue_isUsed = 0u;
|
||||
exiDoc->RetrievalMethod_isUsed = 0u;
|
||||
exiDoc->X509Data_isUsed = 0u;
|
||||
exiDoc->PGPData_isUsed = 0u;
|
||||
exiDoc->SPKIData_isUsed = 0u;
|
||||
exiDoc->Object_isUsed = 0u;
|
||||
exiDoc->Manifest_isUsed = 0u;
|
||||
exiDoc->SignatureProperties_isUsed = 0u;
|
||||
exiDoc->SignatureProperty_isUsed = 0u;
|
||||
exiDoc->DSAKeyValue_isUsed = 0u;
|
||||
exiDoc->RSAKeyValue_isUsed = 0u;
|
||||
}
|
||||
void init_iso20_acdp_TransformType(struct iso20_acdp_TransformType* TransformType) {
|
||||
TransformType->ANY_isUsed = 0u;
|
||||
TransformType->XPath_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_TransformsType(struct iso20_acdp_TransformsType* TransformsType) {
|
||||
(void) TransformsType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_DSAKeyValueType(struct iso20_acdp_DSAKeyValueType* DSAKeyValueType) {
|
||||
DSAKeyValueType->P_isUsed = 0u;
|
||||
DSAKeyValueType->Q_isUsed = 0u;
|
||||
DSAKeyValueType->G_isUsed = 0u;
|
||||
DSAKeyValueType->J_isUsed = 0u;
|
||||
DSAKeyValueType->Seed_isUsed = 0u;
|
||||
DSAKeyValueType->PgenCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_X509IssuerSerialType(struct iso20_acdp_X509IssuerSerialType* X509IssuerSerialType) {
|
||||
(void) X509IssuerSerialType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_DigestMethodType(struct iso20_acdp_DigestMethodType* DigestMethodType) {
|
||||
DigestMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_RSAKeyValueType(struct iso20_acdp_RSAKeyValueType* RSAKeyValueType) {
|
||||
(void) RSAKeyValueType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_CanonicalizationMethodType(struct iso20_acdp_CanonicalizationMethodType* CanonicalizationMethodType) {
|
||||
CanonicalizationMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_SignatureMethodType(struct iso20_acdp_SignatureMethodType* SignatureMethodType) {
|
||||
SignatureMethodType->HMACOutputLength_isUsed = 0u;
|
||||
SignatureMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_KeyValueType(struct iso20_acdp_KeyValueType* KeyValueType) {
|
||||
KeyValueType->DSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->RSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ReferenceType(struct iso20_acdp_ReferenceType* ReferenceType) {
|
||||
ReferenceType->Id_isUsed = 0u;
|
||||
ReferenceType->Type_isUsed = 0u;
|
||||
ReferenceType->URI_isUsed = 0u;
|
||||
ReferenceType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_RetrievalMethodType(struct iso20_acdp_RetrievalMethodType* RetrievalMethodType) {
|
||||
RetrievalMethodType->Type_isUsed = 0u;
|
||||
RetrievalMethodType->URI_isUsed = 0u;
|
||||
RetrievalMethodType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_X509DataType(struct iso20_acdp_X509DataType* X509DataType) {
|
||||
X509DataType->X509IssuerSerial_isUsed = 0u;
|
||||
X509DataType->X509SKI_isUsed = 0u;
|
||||
X509DataType->X509SubjectName_isUsed = 0u;
|
||||
X509DataType->X509Certificate_isUsed = 0u;
|
||||
X509DataType->X509CRL_isUsed = 0u;
|
||||
X509DataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_PGPDataType(struct iso20_acdp_PGPDataType* PGPDataType) {
|
||||
PGPDataType->choice_1_isUsed = 0u;
|
||||
PGPDataType->choice_2_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_SPKIDataType(struct iso20_acdp_SPKIDataType* SPKIDataType) {
|
||||
SPKIDataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_SignedInfoType(struct iso20_acdp_SignedInfoType* SignedInfoType) {
|
||||
SignedInfoType->Reference.arrayLen = 0u;
|
||||
SignedInfoType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_SignatureValueType(struct iso20_acdp_SignatureValueType* SignatureValueType) {
|
||||
SignatureValueType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_KeyInfoType(struct iso20_acdp_KeyInfoType* KeyInfoType) {
|
||||
KeyInfoType->Id_isUsed = 0u;
|
||||
KeyInfoType->KeyName_isUsed = 0u;
|
||||
KeyInfoType->KeyValue_isUsed = 0u;
|
||||
KeyInfoType->RetrievalMethod_isUsed = 0u;
|
||||
KeyInfoType->X509Data_isUsed = 0u;
|
||||
KeyInfoType->PGPData_isUsed = 0u;
|
||||
KeyInfoType->SPKIData_isUsed = 0u;
|
||||
KeyInfoType->MgmtData_isUsed = 0u;
|
||||
KeyInfoType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ObjectType(struct iso20_acdp_ObjectType* ObjectType) {
|
||||
ObjectType->Encoding_isUsed = 0u;
|
||||
ObjectType->Id_isUsed = 0u;
|
||||
ObjectType->MimeType_isUsed = 0u;
|
||||
ObjectType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_SignatureType(struct iso20_acdp_SignatureType* SignatureType) {
|
||||
SignatureType->Id_isUsed = 0u;
|
||||
SignatureType->KeyInfo_isUsed = 0u;
|
||||
SignatureType->Object_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_RationalNumberType(struct iso20_acdp_RationalNumberType* RationalNumberType) {
|
||||
(void) RationalNumberType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_MessageHeaderType(struct iso20_acdp_MessageHeaderType* MessageHeaderType) {
|
||||
MessageHeaderType->Signature_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_SignaturePropertyType(struct iso20_acdp_SignaturePropertyType* SignaturePropertyType) {
|
||||
SignaturePropertyType->Id_isUsed = 0u;
|
||||
SignaturePropertyType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_EVTechnicalStatusType(struct iso20_acdp_EVTechnicalStatusType* EVTechnicalStatusType) {
|
||||
EVTechnicalStatusType->EVImmobilized_isUsed = 0u;
|
||||
EVTechnicalStatusType->EVWLANStrength_isUsed = 0u;
|
||||
EVTechnicalStatusType->EVCPStatus_isUsed = 0u;
|
||||
EVTechnicalStatusType->EVSOC_isUsed = 0u;
|
||||
EVTechnicalStatusType->EVErrorCode_isUsed = 0u;
|
||||
EVTechnicalStatusType->EVTimeout_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ACDP_VehiclePositioningReqType(struct iso20_acdp_ACDP_VehiclePositioningReqType* ACDP_VehiclePositioningReqType) {
|
||||
(void) ACDP_VehiclePositioningReqType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ACDP_VehiclePositioningResType(struct iso20_acdp_ACDP_VehiclePositioningResType* ACDP_VehiclePositioningResType) {
|
||||
(void) ACDP_VehiclePositioningResType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ACDP_ConnectReqType(struct iso20_acdp_ACDP_ConnectReqType* ACDP_ConnectReqType) {
|
||||
(void) ACDP_ConnectReqType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ACDP_ConnectResType(struct iso20_acdp_ACDP_ConnectResType* ACDP_ConnectResType) {
|
||||
(void) ACDP_ConnectResType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ACDP_SystemStatusReqType(struct iso20_acdp_ACDP_SystemStatusReqType* ACDP_SystemStatusReqType) {
|
||||
(void) ACDP_SystemStatusReqType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ACDP_SystemStatusResType(struct iso20_acdp_ACDP_SystemStatusResType* ACDP_SystemStatusResType) {
|
||||
(void) ACDP_SystemStatusResType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_CLReqControlModeType(struct iso20_acdp_CLReqControlModeType* CLReqControlModeType) {
|
||||
(void) CLReqControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_CLResControlModeType(struct iso20_acdp_CLResControlModeType* CLResControlModeType) {
|
||||
(void) CLResControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_ManifestType(struct iso20_acdp_ManifestType* ManifestType) {
|
||||
ManifestType->Reference.arrayLen = 0u;
|
||||
ManifestType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_acdp_SignaturePropertiesType(struct iso20_acdp_SignaturePropertiesType* SignaturePropertiesType) {
|
||||
SignaturePropertiesType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,482 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_AC_Datatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/iso_20/iso20_AC_Datatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_iso20_ac_exiDocument(struct iso20_ac_exiDocument* exiDoc) {
|
||||
exiDoc->AC_ChargeParameterDiscoveryReq_isUsed = 0u;
|
||||
exiDoc->AC_ChargeParameterDiscoveryRes_isUsed = 0u;
|
||||
exiDoc->AC_ChargeLoopReq_isUsed = 0u;
|
||||
exiDoc->AC_ChargeLoopRes_isUsed = 0u;
|
||||
exiDoc->AC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->AC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->BPT_AC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->BPT_AC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->Scheduled_AC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->Scheduled_AC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Scheduled_AC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Scheduled_AC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->Dynamic_AC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->Dynamic_AC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Dynamic_AC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Dynamic_AC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->CLResControlMode_isUsed = 0u;
|
||||
exiDoc->Signature_isUsed = 0u;
|
||||
exiDoc->SignatureValue_isUsed = 0u;
|
||||
exiDoc->SignedInfo_isUsed = 0u;
|
||||
exiDoc->CanonicalizationMethod_isUsed = 0u;
|
||||
exiDoc->SignatureMethod_isUsed = 0u;
|
||||
exiDoc->Reference_isUsed = 0u;
|
||||
exiDoc->Transforms_isUsed = 0u;
|
||||
exiDoc->Transform_isUsed = 0u;
|
||||
exiDoc->DigestMethod_isUsed = 0u;
|
||||
exiDoc->KeyInfo_isUsed = 0u;
|
||||
exiDoc->KeyValue_isUsed = 0u;
|
||||
exiDoc->RetrievalMethod_isUsed = 0u;
|
||||
exiDoc->X509Data_isUsed = 0u;
|
||||
exiDoc->PGPData_isUsed = 0u;
|
||||
exiDoc->SPKIData_isUsed = 0u;
|
||||
exiDoc->Object_isUsed = 0u;
|
||||
exiDoc->Manifest_isUsed = 0u;
|
||||
exiDoc->SignatureProperties_isUsed = 0u;
|
||||
exiDoc->SignatureProperty_isUsed = 0u;
|
||||
exiDoc->DSAKeyValue_isUsed = 0u;
|
||||
exiDoc->RSAKeyValue_isUsed = 0u;
|
||||
}
|
||||
void init_iso20_ac_TransformType(struct iso20_ac_TransformType* TransformType) {
|
||||
TransformType->ANY_isUsed = 0u;
|
||||
TransformType->XPath_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_TransformsType(struct iso20_ac_TransformsType* TransformsType) {
|
||||
(void) TransformsType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_DSAKeyValueType(struct iso20_ac_DSAKeyValueType* DSAKeyValueType) {
|
||||
DSAKeyValueType->P_isUsed = 0u;
|
||||
DSAKeyValueType->Q_isUsed = 0u;
|
||||
DSAKeyValueType->G_isUsed = 0u;
|
||||
DSAKeyValueType->J_isUsed = 0u;
|
||||
DSAKeyValueType->Seed_isUsed = 0u;
|
||||
DSAKeyValueType->PgenCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_X509IssuerSerialType(struct iso20_ac_X509IssuerSerialType* X509IssuerSerialType) {
|
||||
(void) X509IssuerSerialType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_DigestMethodType(struct iso20_ac_DigestMethodType* DigestMethodType) {
|
||||
DigestMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_RSAKeyValueType(struct iso20_ac_RSAKeyValueType* RSAKeyValueType) {
|
||||
(void) RSAKeyValueType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_CanonicalizationMethodType(struct iso20_ac_CanonicalizationMethodType* CanonicalizationMethodType) {
|
||||
CanonicalizationMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_SignatureMethodType(struct iso20_ac_SignatureMethodType* SignatureMethodType) {
|
||||
SignatureMethodType->HMACOutputLength_isUsed = 0u;
|
||||
SignatureMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_KeyValueType(struct iso20_ac_KeyValueType* KeyValueType) {
|
||||
KeyValueType->DSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->RSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_ReferenceType(struct iso20_ac_ReferenceType* ReferenceType) {
|
||||
ReferenceType->Id_isUsed = 0u;
|
||||
ReferenceType->Type_isUsed = 0u;
|
||||
ReferenceType->URI_isUsed = 0u;
|
||||
ReferenceType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_RetrievalMethodType(struct iso20_ac_RetrievalMethodType* RetrievalMethodType) {
|
||||
RetrievalMethodType->Type_isUsed = 0u;
|
||||
RetrievalMethodType->URI_isUsed = 0u;
|
||||
RetrievalMethodType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_X509DataType(struct iso20_ac_X509DataType* X509DataType) {
|
||||
X509DataType->X509IssuerSerial_isUsed = 0u;
|
||||
X509DataType->X509SKI_isUsed = 0u;
|
||||
X509DataType->X509SubjectName_isUsed = 0u;
|
||||
X509DataType->X509Certificate_isUsed = 0u;
|
||||
X509DataType->X509CRL_isUsed = 0u;
|
||||
X509DataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_PGPDataType(struct iso20_ac_PGPDataType* PGPDataType) {
|
||||
PGPDataType->choice_1_isUsed = 0u;
|
||||
PGPDataType->choice_2_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_SPKIDataType(struct iso20_ac_SPKIDataType* SPKIDataType) {
|
||||
SPKIDataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_SignedInfoType(struct iso20_ac_SignedInfoType* SignedInfoType) {
|
||||
SignedInfoType->Reference.arrayLen = 0u;
|
||||
SignedInfoType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_SignatureValueType(struct iso20_ac_SignatureValueType* SignatureValueType) {
|
||||
SignatureValueType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_KeyInfoType(struct iso20_ac_KeyInfoType* KeyInfoType) {
|
||||
KeyInfoType->Id_isUsed = 0u;
|
||||
KeyInfoType->KeyName_isUsed = 0u;
|
||||
KeyInfoType->KeyValue_isUsed = 0u;
|
||||
KeyInfoType->RetrievalMethod_isUsed = 0u;
|
||||
KeyInfoType->X509Data_isUsed = 0u;
|
||||
KeyInfoType->PGPData_isUsed = 0u;
|
||||
KeyInfoType->SPKIData_isUsed = 0u;
|
||||
KeyInfoType->MgmtData_isUsed = 0u;
|
||||
KeyInfoType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_ObjectType(struct iso20_ac_ObjectType* ObjectType) {
|
||||
ObjectType->Encoding_isUsed = 0u;
|
||||
ObjectType->Id_isUsed = 0u;
|
||||
ObjectType->MimeType_isUsed = 0u;
|
||||
ObjectType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_RationalNumberType(struct iso20_ac_RationalNumberType* RationalNumberType) {
|
||||
(void) RationalNumberType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_DetailedCostType(struct iso20_ac_DetailedCostType* DetailedCostType) {
|
||||
(void) DetailedCostType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_SignatureType(struct iso20_ac_SignatureType* SignatureType) {
|
||||
SignatureType->Id_isUsed = 0u;
|
||||
SignatureType->KeyInfo_isUsed = 0u;
|
||||
SignatureType->Object_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_DetailedTaxType(struct iso20_ac_DetailedTaxType* DetailedTaxType) {
|
||||
(void) DetailedTaxType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_MessageHeaderType(struct iso20_ac_MessageHeaderType* MessageHeaderType) {
|
||||
MessageHeaderType->Signature_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_SignaturePropertyType(struct iso20_ac_SignaturePropertyType* SignaturePropertyType) {
|
||||
SignaturePropertyType->Id_isUsed = 0u;
|
||||
SignaturePropertyType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_AC_CPDReqEnergyTransferModeType(struct iso20_ac_AC_CPDReqEnergyTransferModeType* AC_CPDReqEnergyTransferModeType) {
|
||||
AC_CPDReqEnergyTransferModeType->EVMaximumChargePower_L2_isUsed = 0u;
|
||||
AC_CPDReqEnergyTransferModeType->EVMaximumChargePower_L3_isUsed = 0u;
|
||||
AC_CPDReqEnergyTransferModeType->EVMinimumChargePower_L2_isUsed = 0u;
|
||||
AC_CPDReqEnergyTransferModeType->EVMinimumChargePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_DisplayParametersType(struct iso20_ac_DisplayParametersType* DisplayParametersType) {
|
||||
DisplayParametersType->PresentSOC_isUsed = 0u;
|
||||
DisplayParametersType->MinimumSOC_isUsed = 0u;
|
||||
DisplayParametersType->TargetSOC_isUsed = 0u;
|
||||
DisplayParametersType->MaximumSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToMinimumSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToTargetSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToMaximumSOC_isUsed = 0u;
|
||||
DisplayParametersType->ChargingComplete_isUsed = 0u;
|
||||
DisplayParametersType->BatteryEnergyCapacity_isUsed = 0u;
|
||||
DisplayParametersType->InletHot_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_AC_CPDResEnergyTransferModeType(struct iso20_ac_AC_CPDResEnergyTransferModeType* AC_CPDResEnergyTransferModeType) {
|
||||
AC_CPDResEnergyTransferModeType->EVSEMaximumChargePower_L2_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->EVSEMaximumChargePower_L3_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->EVSEMinimumChargePower_L2_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->EVSEMinimumChargePower_L3_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->MaximumPowerAsymmetry_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->EVSEPowerRampLimitation_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->EVSEPresentActivePower_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->EVSEPresentActivePower_L2_isUsed = 0u;
|
||||
AC_CPDResEnergyTransferModeType->EVSEPresentActivePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_EVSEStatusType(struct iso20_ac_EVSEStatusType* EVSEStatusType) {
|
||||
(void) EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_Dynamic_AC_CLReqControlModeType(struct iso20_ac_Dynamic_AC_CLReqControlModeType* Dynamic_AC_CLReqControlModeType) {
|
||||
Dynamic_AC_CLReqControlModeType->DepartureTime_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVMaximumChargePower_L2_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVMaximumChargePower_L3_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVMinimumChargePower_L2_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVMinimumChargePower_L3_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVPresentActivePower_L2_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVPresentActivePower_L3_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVPresentReactivePower_L2_isUsed = 0u;
|
||||
Dynamic_AC_CLReqControlModeType->EVPresentReactivePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_Scheduled_AC_CLReqControlModeType(struct iso20_ac_Scheduled_AC_CLReqControlModeType* Scheduled_AC_CLReqControlModeType) {
|
||||
Scheduled_AC_CLReqControlModeType->EVTargetEnergyRequest_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMaximumEnergyRequest_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMinimumEnergyRequest_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMaximumChargePower_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMaximumChargePower_L2_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMaximumChargePower_L3_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMinimumChargePower_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMinimumChargePower_L2_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVMinimumChargePower_L3_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVPresentActivePower_L2_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVPresentActivePower_L3_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVPresentReactivePower_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVPresentReactivePower_L2_isUsed = 0u;
|
||||
Scheduled_AC_CLReqControlModeType->EVPresentReactivePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_CLReqControlModeType(struct iso20_ac_CLReqControlModeType* CLReqControlModeType) {
|
||||
(void) CLReqControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_MeterInfoType(struct iso20_ac_MeterInfoType* MeterInfoType) {
|
||||
MeterInfoType->BPT_DischargedEnergyReadingWh_isUsed = 0u;
|
||||
MeterInfoType->CapacitiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->BPT_InductiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->MeterSignature_isUsed = 0u;
|
||||
MeterInfoType->MeterStatus_isUsed = 0u;
|
||||
MeterInfoType->MeterTimestamp_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_ReceiptType(struct iso20_ac_ReceiptType* ReceiptType) {
|
||||
ReceiptType->TaxCosts.arrayLen = 0u;
|
||||
ReceiptType->EnergyCosts_isUsed = 0u;
|
||||
ReceiptType->OccupancyCosts_isUsed = 0u;
|
||||
ReceiptType->AdditionalServicesCosts_isUsed = 0u;
|
||||
ReceiptType->OverstayCosts_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_Scheduled_AC_CLResControlModeType(struct iso20_ac_Scheduled_AC_CLResControlModeType* Scheduled_AC_CLResControlModeType) {
|
||||
Scheduled_AC_CLResControlModeType->EVSETargetActivePower_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSETargetActivePower_L2_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSETargetActivePower_L3_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSETargetReactivePower_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSETargetReactivePower_L2_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSETargetReactivePower_L3_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSEPresentActivePower_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSEPresentActivePower_L2_isUsed = 0u;
|
||||
Scheduled_AC_CLResControlModeType->EVSEPresentActivePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_Dynamic_AC_CLResControlModeType(struct iso20_ac_Dynamic_AC_CLResControlModeType* Dynamic_AC_CLResControlModeType) {
|
||||
Dynamic_AC_CLResControlModeType->DepartureTime_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->MinimumSOC_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->TargetSOC_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->AckMaxDelay_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSETargetActivePower_L2_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSETargetActivePower_L3_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSETargetReactivePower_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSETargetReactivePower_L2_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSETargetReactivePower_L3_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSEPresentActivePower_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSEPresentActivePower_L2_isUsed = 0u;
|
||||
Dynamic_AC_CLResControlModeType->EVSEPresentActivePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_CLResControlModeType(struct iso20_ac_CLResControlModeType* CLResControlModeType) {
|
||||
(void) CLResControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_ac_AC_ChargeParameterDiscoveryReqType(struct iso20_ac_AC_ChargeParameterDiscoveryReqType* AC_ChargeParameterDiscoveryReqType) {
|
||||
AC_ChargeParameterDiscoveryReqType->AC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
AC_ChargeParameterDiscoveryReqType->BPT_AC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_AC_ChargeParameterDiscoveryResType(struct iso20_ac_AC_ChargeParameterDiscoveryResType* AC_ChargeParameterDiscoveryResType) {
|
||||
AC_ChargeParameterDiscoveryResType->AC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
AC_ChargeParameterDiscoveryResType->BPT_AC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_AC_ChargeLoopReqType(struct iso20_ac_AC_ChargeLoopReqType* AC_ChargeLoopReqType) {
|
||||
AC_ChargeLoopReqType->DisplayParameters_isUsed = 0u;
|
||||
AC_ChargeLoopReqType->BPT_Dynamic_AC_CLReqControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopReqType->BPT_Scheduled_AC_CLReqControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopReqType->CLReqControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopReqType->Dynamic_AC_CLReqControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopReqType->Scheduled_AC_CLReqControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_AC_ChargeLoopResType(struct iso20_ac_AC_ChargeLoopResType* AC_ChargeLoopResType) {
|
||||
AC_ChargeLoopResType->EVSEStatus_isUsed = 0u;
|
||||
AC_ChargeLoopResType->MeterInfo_isUsed = 0u;
|
||||
AC_ChargeLoopResType->Receipt_isUsed = 0u;
|
||||
AC_ChargeLoopResType->EVSETargetFrequency_isUsed = 0u;
|
||||
AC_ChargeLoopResType->BPT_Dynamic_AC_CLResControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopResType->BPT_Scheduled_AC_CLResControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopResType->CLResControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopResType->Dynamic_AC_CLResControlMode_isUsed = 0u;
|
||||
AC_ChargeLoopResType->Scheduled_AC_CLResControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_BPT_AC_CPDReqEnergyTransferModeType(struct iso20_ac_BPT_AC_CPDReqEnergyTransferModeType* BPT_AC_CPDReqEnergyTransferModeType) {
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMaximumChargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMaximumChargePower_L3_isUsed = 0u;
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMinimumChargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMinimumChargePower_L3_isUsed = 0u;
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMaximumDischargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMaximumDischargePower_L3_isUsed = 0u;
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMinimumDischargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDReqEnergyTransferModeType->EVMinimumDischargePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_BPT_AC_CPDResEnergyTransferModeType(struct iso20_ac_BPT_AC_CPDResEnergyTransferModeType* BPT_AC_CPDResEnergyTransferModeType) {
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMaximumChargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMaximumChargePower_L3_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMinimumChargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMinimumChargePower_L3_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->MaximumPowerAsymmetry_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEPowerRampLimitation_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEPresentActivePower_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEPresentActivePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEPresentActivePower_L3_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMaximumDischargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMaximumDischargePower_L3_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMinimumDischargePower_L2_isUsed = 0u;
|
||||
BPT_AC_CPDResEnergyTransferModeType->EVSEMinimumDischargePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_BPT_Scheduled_AC_CLReqControlModeType(struct iso20_ac_BPT_Scheduled_AC_CLReqControlModeType* BPT_Scheduled_AC_CLReqControlModeType) {
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVTargetEnergyRequest_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMaximumEnergyRequest_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMinimumEnergyRequest_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMaximumChargePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMaximumChargePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMaximumChargePower_L3_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMinimumChargePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMinimumChargePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMinimumChargePower_L3_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVPresentActivePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVPresentActivePower_L3_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVPresentReactivePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVPresentReactivePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVPresentReactivePower_L3_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMaximumDischargePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMaximumDischargePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMaximumDischargePower_L3_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMinimumDischargePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMinimumDischargePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLReqControlModeType->EVMinimumDischargePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_BPT_Scheduled_AC_CLResControlModeType(struct iso20_ac_BPT_Scheduled_AC_CLResControlModeType* BPT_Scheduled_AC_CLResControlModeType) {
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSETargetActivePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSETargetActivePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSETargetActivePower_L3_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSETargetReactivePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSETargetReactivePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSETargetReactivePower_L3_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSEPresentActivePower_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSEPresentActivePower_L2_isUsed = 0u;
|
||||
BPT_Scheduled_AC_CLResControlModeType->EVSEPresentActivePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_BPT_Dynamic_AC_CLReqControlModeType(struct iso20_ac_BPT_Dynamic_AC_CLReqControlModeType* BPT_Dynamic_AC_CLReqControlModeType) {
|
||||
BPT_Dynamic_AC_CLReqControlModeType->DepartureTime_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMaximumChargePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMaximumChargePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMinimumChargePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMinimumChargePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVPresentActivePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVPresentActivePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVPresentReactivePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVPresentReactivePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMaximumDischargePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMaximumDischargePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMinimumDischargePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMinimumDischargePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMaximumV2XEnergyRequest_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLReqControlModeType->EVMinimumV2XEnergyRequest_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_BPT_Dynamic_AC_CLResControlModeType(struct iso20_ac_BPT_Dynamic_AC_CLResControlModeType* BPT_Dynamic_AC_CLResControlModeType) {
|
||||
BPT_Dynamic_AC_CLResControlModeType->DepartureTime_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->MinimumSOC_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->TargetSOC_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->AckMaxDelay_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSETargetActivePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSETargetActivePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSETargetReactivePower_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSETargetReactivePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSETargetReactivePower_L3_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSEPresentActivePower_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSEPresentActivePower_L2_isUsed = 0u;
|
||||
BPT_Dynamic_AC_CLResControlModeType->EVSEPresentActivePower_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_ManifestType(struct iso20_ac_ManifestType* ManifestType) {
|
||||
ManifestType->Reference.arrayLen = 0u;
|
||||
ManifestType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ac_SignaturePropertiesType(struct iso20_ac_SignaturePropertiesType* SignaturePropertiesType) {
|
||||
SignaturePropertiesType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
// init for fragment
|
||||
void init_iso20_ac_exiFragment(struct iso20_ac_exiFragment* exiFrag) {
|
||||
exiFrag->AC_ChargeParameterDiscoveryRes_isUsed = 0u;
|
||||
exiFrag->SignedInfo_isUsed = 0u;
|
||||
}
|
||||
|
||||
// init for xmldsig fragment
|
||||
void init_iso20_ac_xmldsigFragment(struct iso20_ac_xmldsigFragment* xmldsigFrag) {
|
||||
xmldsigFrag->CanonicalizationMethod_isUsed = 0u;
|
||||
xmldsigFrag->DSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->DigestMethod_isUsed = 0u;
|
||||
xmldsigFrag->KeyInfo_isUsed = 0u;
|
||||
xmldsigFrag->KeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Manifest_isUsed = 0u;
|
||||
xmldsigFrag->Object_isUsed = 0u;
|
||||
xmldsigFrag->PGPData_isUsed = 0u;
|
||||
xmldsigFrag->RSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Reference_isUsed = 0u;
|
||||
xmldsigFrag->RetrievalMethod_isUsed = 0u;
|
||||
xmldsigFrag->SPKIData_isUsed = 0u;
|
||||
xmldsigFrag->Signature_isUsed = 0u;
|
||||
xmldsigFrag->SignatureMethod_isUsed = 0u;
|
||||
xmldsigFrag->SignatureProperties_isUsed = 0u;
|
||||
xmldsigFrag->SignatureProperty_isUsed = 0u;
|
||||
xmldsigFrag->SignatureValue_isUsed = 0u;
|
||||
xmldsigFrag->SignedInfo_isUsed = 0u;
|
||||
xmldsigFrag->Transform_isUsed = 0u;
|
||||
xmldsigFrag->Transforms_isUsed = 0u;
|
||||
xmldsigFrag->X509Data_isUsed = 0u;
|
||||
xmldsigFrag->X509IssuerSerial_isUsed = 0u;
|
||||
}
|
||||
|
||||
|
||||
18097
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_AC_Decoder.c
Normal file
18097
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_AC_Decoder.c
Normal file
File diff suppressed because it is too large
Load Diff
17494
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_AC_Encoder.c
Normal file
17494
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_AC_Encoder.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,665 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_CommonMessages_Datatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/iso_20/iso20_CommonMessages_Datatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_iso20_exiDocument(struct iso20_exiDocument* exiDoc) {
|
||||
exiDoc->SessionSetupReq_isUsed = 0u;
|
||||
exiDoc->SessionSetupRes_isUsed = 0u;
|
||||
exiDoc->AuthorizationSetupReq_isUsed = 0u;
|
||||
exiDoc->AuthorizationSetupRes_isUsed = 0u;
|
||||
exiDoc->AuthorizationReq_isUsed = 0u;
|
||||
exiDoc->AuthorizationRes_isUsed = 0u;
|
||||
exiDoc->ServiceDiscoveryReq_isUsed = 0u;
|
||||
exiDoc->ServiceDiscoveryRes_isUsed = 0u;
|
||||
exiDoc->ServiceDetailReq_isUsed = 0u;
|
||||
exiDoc->ServiceDetailRes_isUsed = 0u;
|
||||
exiDoc->ServiceSelectionReq_isUsed = 0u;
|
||||
exiDoc->ServiceSelectionRes_isUsed = 0u;
|
||||
exiDoc->ScheduleExchangeReq_isUsed = 0u;
|
||||
exiDoc->ScheduleExchangeRes_isUsed = 0u;
|
||||
exiDoc->PowerDeliveryReq_isUsed = 0u;
|
||||
exiDoc->PowerDeliveryRes_isUsed = 0u;
|
||||
exiDoc->MeteringConfirmationReq_isUsed = 0u;
|
||||
exiDoc->MeteringConfirmationRes_isUsed = 0u;
|
||||
exiDoc->SessionStopReq_isUsed = 0u;
|
||||
exiDoc->SessionStopRes_isUsed = 0u;
|
||||
exiDoc->CertificateInstallationReq_isUsed = 0u;
|
||||
exiDoc->CertificateInstallationRes_isUsed = 0u;
|
||||
exiDoc->VehicleCheckInReq_isUsed = 0u;
|
||||
exiDoc->VehicleCheckInRes_isUsed = 0u;
|
||||
exiDoc->VehicleCheckOutReq_isUsed = 0u;
|
||||
exiDoc->VehicleCheckOutRes_isUsed = 0u;
|
||||
exiDoc->SignedInstallationData_isUsed = 0u;
|
||||
exiDoc->SignedMeteringData_isUsed = 0u;
|
||||
exiDoc->CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->CLResControlMode_isUsed = 0u;
|
||||
exiDoc->Signature_isUsed = 0u;
|
||||
exiDoc->SignatureValue_isUsed = 0u;
|
||||
exiDoc->SignedInfo_isUsed = 0u;
|
||||
exiDoc->CanonicalizationMethod_isUsed = 0u;
|
||||
exiDoc->SignatureMethod_isUsed = 0u;
|
||||
exiDoc->Reference_isUsed = 0u;
|
||||
exiDoc->Transforms_isUsed = 0u;
|
||||
exiDoc->Transform_isUsed = 0u;
|
||||
exiDoc->DigestMethod_isUsed = 0u;
|
||||
exiDoc->KeyInfo_isUsed = 0u;
|
||||
exiDoc->KeyValue_isUsed = 0u;
|
||||
exiDoc->RetrievalMethod_isUsed = 0u;
|
||||
exiDoc->X509Data_isUsed = 0u;
|
||||
exiDoc->PGPData_isUsed = 0u;
|
||||
exiDoc->SPKIData_isUsed = 0u;
|
||||
exiDoc->Object_isUsed = 0u;
|
||||
exiDoc->Manifest_isUsed = 0u;
|
||||
exiDoc->SignatureProperties_isUsed = 0u;
|
||||
exiDoc->SignatureProperty_isUsed = 0u;
|
||||
exiDoc->DSAKeyValue_isUsed = 0u;
|
||||
exiDoc->RSAKeyValue_isUsed = 0u;
|
||||
}
|
||||
void init_iso20_TransformType(struct iso20_TransformType* TransformType) {
|
||||
TransformType->ANY_isUsed = 0u;
|
||||
TransformType->XPath_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PowerScheduleEntryType(struct iso20_PowerScheduleEntryType* PowerScheduleEntryType) {
|
||||
PowerScheduleEntryType->Power_L2_isUsed = 0u;
|
||||
PowerScheduleEntryType->Power_L3_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVPriceRuleType(struct iso20_EVPriceRuleType* EVPriceRuleType) {
|
||||
(void) EVPriceRuleType;
|
||||
}
|
||||
|
||||
void init_iso20_TransformsType(struct iso20_TransformsType* TransformsType) {
|
||||
(void) TransformsType;
|
||||
}
|
||||
|
||||
void init_iso20_DSAKeyValueType(struct iso20_DSAKeyValueType* DSAKeyValueType) {
|
||||
DSAKeyValueType->P_isUsed = 0u;
|
||||
DSAKeyValueType->Q_isUsed = 0u;
|
||||
DSAKeyValueType->G_isUsed = 0u;
|
||||
DSAKeyValueType->J_isUsed = 0u;
|
||||
DSAKeyValueType->Seed_isUsed = 0u;
|
||||
DSAKeyValueType->PgenCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_X509IssuerSerialType(struct iso20_X509IssuerSerialType* X509IssuerSerialType) {
|
||||
(void) X509IssuerSerialType;
|
||||
}
|
||||
|
||||
void init_iso20_EVPowerScheduleEntryType(struct iso20_EVPowerScheduleEntryType* EVPowerScheduleEntryType) {
|
||||
(void) EVPowerScheduleEntryType;
|
||||
}
|
||||
|
||||
void init_iso20_EVPriceRuleStackType(struct iso20_EVPriceRuleStackType* EVPriceRuleStackType) {
|
||||
EVPriceRuleStackType->EVPriceRule.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_DigestMethodType(struct iso20_DigestMethodType* DigestMethodType) {
|
||||
DigestMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_RSAKeyValueType(struct iso20_RSAKeyValueType* RSAKeyValueType) {
|
||||
(void) RSAKeyValueType;
|
||||
}
|
||||
|
||||
void init_iso20_PriceRuleType(struct iso20_PriceRuleType* PriceRuleType) {
|
||||
PriceRuleType->ParkingFee_isUsed = 0u;
|
||||
PriceRuleType->ParkingFeePeriod_isUsed = 0u;
|
||||
PriceRuleType->CarbonDioxideEmission_isUsed = 0u;
|
||||
PriceRuleType->RenewableGenerationPercentage_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PowerScheduleEntryListType(struct iso20_PowerScheduleEntryListType* PowerScheduleEntryListType) {
|
||||
PowerScheduleEntryListType->PowerScheduleEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_CanonicalizationMethodType(struct iso20_CanonicalizationMethodType* CanonicalizationMethodType) {
|
||||
CanonicalizationMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_TaxRuleType(struct iso20_TaxRuleType* TaxRuleType) {
|
||||
TaxRuleType->TaxRuleName_isUsed = 0u;
|
||||
TaxRuleType->TaxIncludedInPrice_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PriceRuleStackType(struct iso20_PriceRuleStackType* PriceRuleStackType) {
|
||||
PriceRuleStackType->PriceRule.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_AdditionalServiceType(struct iso20_AdditionalServiceType* AdditionalServiceType) {
|
||||
(void) AdditionalServiceType;
|
||||
}
|
||||
|
||||
void init_iso20_PriceLevelScheduleEntryType(struct iso20_PriceLevelScheduleEntryType* PriceLevelScheduleEntryType) {
|
||||
(void) PriceLevelScheduleEntryType;
|
||||
}
|
||||
|
||||
void init_iso20_PowerScheduleType(struct iso20_PowerScheduleType* PowerScheduleType) {
|
||||
PowerScheduleType->AvailableEnergy_isUsed = 0u;
|
||||
PowerScheduleType->PowerTolerance_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SignatureMethodType(struct iso20_SignatureMethodType* SignatureMethodType) {
|
||||
SignatureMethodType->HMACOutputLength_isUsed = 0u;
|
||||
SignatureMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_KeyValueType(struct iso20_KeyValueType* KeyValueType) {
|
||||
KeyValueType->DSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->RSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVPowerScheduleEntryListType(struct iso20_EVPowerScheduleEntryListType* EVPowerScheduleEntryListType) {
|
||||
EVPowerScheduleEntryListType->EVPowerScheduleEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ReferenceType(struct iso20_ReferenceType* ReferenceType) {
|
||||
ReferenceType->Id_isUsed = 0u;
|
||||
ReferenceType->Type_isUsed = 0u;
|
||||
ReferenceType->URI_isUsed = 0u;
|
||||
ReferenceType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_RetrievalMethodType(struct iso20_RetrievalMethodType* RetrievalMethodType) {
|
||||
RetrievalMethodType->Type_isUsed = 0u;
|
||||
RetrievalMethodType->URI_isUsed = 0u;
|
||||
RetrievalMethodType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_OverstayRuleType(struct iso20_OverstayRuleType* OverstayRuleType) {
|
||||
OverstayRuleType->OverstayRuleDescription_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_X509DataType(struct iso20_X509DataType* X509DataType) {
|
||||
X509DataType->X509IssuerSerial_isUsed = 0u;
|
||||
X509DataType->X509SKI_isUsed = 0u;
|
||||
X509DataType->X509SubjectName_isUsed = 0u;
|
||||
X509DataType->X509Certificate_isUsed = 0u;
|
||||
X509DataType->X509CRL_isUsed = 0u;
|
||||
X509DataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVPriceRuleStackListType(struct iso20_EVPriceRuleStackListType* EVPriceRuleStackListType) {
|
||||
EVPriceRuleStackListType->EVPriceRuleStack.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PGPDataType(struct iso20_PGPDataType* PGPDataType) {
|
||||
PGPDataType->choice_1_isUsed = 0u;
|
||||
PGPDataType->choice_2_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_RationalNumberType(struct iso20_RationalNumberType* RationalNumberType) {
|
||||
(void) RationalNumberType;
|
||||
}
|
||||
|
||||
void init_iso20_SPKIDataType(struct iso20_SPKIDataType* SPKIDataType) {
|
||||
SPKIDataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SignedInfoType(struct iso20_SignedInfoType* SignedInfoType) {
|
||||
SignedInfoType->Reference.arrayLen = 0u;
|
||||
SignedInfoType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVPowerScheduleType(struct iso20_EVPowerScheduleType* EVPowerScheduleType) {
|
||||
(void) EVPowerScheduleType;
|
||||
}
|
||||
|
||||
void init_iso20_SignatureValueType(struct iso20_SignatureValueType* SignatureValueType) {
|
||||
SignatureValueType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SubCertificatesType(struct iso20_SubCertificatesType* SubCertificatesType) {
|
||||
SubCertificatesType->Certificate.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ParameterType(struct iso20_ParameterType* ParameterType) {
|
||||
ParameterType->boolValue_isUsed = 0u;
|
||||
ParameterType->byteValue_isUsed = 0u;
|
||||
ParameterType->shortValue_isUsed = 0u;
|
||||
ParameterType->intValue_isUsed = 0u;
|
||||
ParameterType->rationalNumber_isUsed = 0u;
|
||||
ParameterType->finiteString_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVAbsolutePriceScheduleType(struct iso20_EVAbsolutePriceScheduleType* EVAbsolutePriceScheduleType) {
|
||||
(void) EVAbsolutePriceScheduleType;
|
||||
}
|
||||
|
||||
void init_iso20_ChargingScheduleType(struct iso20_ChargingScheduleType* ChargingScheduleType) {
|
||||
ChargingScheduleType->AbsolutePriceSchedule_isUsed = 0u;
|
||||
ChargingScheduleType->PriceLevelSchedule_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_DetailedCostType(struct iso20_DetailedCostType* DetailedCostType) {
|
||||
(void) DetailedCostType;
|
||||
}
|
||||
|
||||
void init_iso20_KeyInfoType(struct iso20_KeyInfoType* KeyInfoType) {
|
||||
KeyInfoType->Id_isUsed = 0u;
|
||||
KeyInfoType->KeyName_isUsed = 0u;
|
||||
KeyInfoType->KeyValue_isUsed = 0u;
|
||||
KeyInfoType->RetrievalMethod_isUsed = 0u;
|
||||
KeyInfoType->X509Data_isUsed = 0u;
|
||||
KeyInfoType->PGPData_isUsed = 0u;
|
||||
KeyInfoType->SPKIData_isUsed = 0u;
|
||||
KeyInfoType->MgmtData_isUsed = 0u;
|
||||
KeyInfoType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ObjectType(struct iso20_ObjectType* ObjectType) {
|
||||
ObjectType->Encoding_isUsed = 0u;
|
||||
ObjectType->Id_isUsed = 0u;
|
||||
ObjectType->MimeType_isUsed = 0u;
|
||||
ObjectType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PriceLevelScheduleEntryListType(struct iso20_PriceLevelScheduleEntryListType* PriceLevelScheduleEntryListType) {
|
||||
PriceLevelScheduleEntryListType->PriceLevelScheduleEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_DetailedTaxType(struct iso20_DetailedTaxType* DetailedTaxType) {
|
||||
(void) DetailedTaxType;
|
||||
}
|
||||
|
||||
void init_iso20_TaxRuleListType(struct iso20_TaxRuleListType* TaxRuleListType) {
|
||||
TaxRuleListType->TaxRule.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PriceRuleStackListType(struct iso20_PriceRuleStackListType* PriceRuleStackListType) {
|
||||
PriceRuleStackListType->PriceRuleStack.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_OverstayRuleListType(struct iso20_OverstayRuleListType* OverstayRuleListType) {
|
||||
OverstayRuleListType->OverstayRule.arrayLen = 0u;
|
||||
OverstayRuleListType->OverstayTimeThreshold_isUsed = 0u;
|
||||
OverstayRuleListType->OverstayPowerThreshold_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_AdditionalServiceListType(struct iso20_AdditionalServiceListType* AdditionalServiceListType) {
|
||||
AdditionalServiceListType->AdditionalService.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceType(struct iso20_ServiceType* ServiceType) {
|
||||
(void) ServiceType;
|
||||
}
|
||||
|
||||
void init_iso20_ParameterSetType(struct iso20_ParameterSetType* ParameterSetType) {
|
||||
ParameterSetType->Parameter.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ScheduleTupleType(struct iso20_ScheduleTupleType* ScheduleTupleType) {
|
||||
ScheduleTupleType->DischargingSchedule_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SupportedProvidersListType(struct iso20_SupportedProvidersListType* SupportedProvidersListType) {
|
||||
SupportedProvidersListType->ProviderID.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ContractCertificateChainType(struct iso20_ContractCertificateChainType* ContractCertificateChainType) {
|
||||
(void) ContractCertificateChainType;
|
||||
}
|
||||
|
||||
void init_iso20_Dynamic_EVPPTControlModeType(struct iso20_Dynamic_EVPPTControlModeType* Dynamic_EVPPTControlModeType) {
|
||||
(void) Dynamic_EVPPTControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_MeterInfoType(struct iso20_MeterInfoType* MeterInfoType) {
|
||||
MeterInfoType->BPT_DischargedEnergyReadingWh_isUsed = 0u;
|
||||
MeterInfoType->CapacitiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->BPT_InductiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->MeterSignature_isUsed = 0u;
|
||||
MeterInfoType->MeterStatus_isUsed = 0u;
|
||||
MeterInfoType->MeterTimestamp_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SignatureType(struct iso20_SignatureType* SignatureType) {
|
||||
SignatureType->Id_isUsed = 0u;
|
||||
SignatureType->KeyInfo_isUsed = 0u;
|
||||
SignatureType->Object_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_Scheduled_EVPPTControlModeType(struct iso20_Scheduled_EVPPTControlModeType* Scheduled_EVPPTControlModeType) {
|
||||
Scheduled_EVPPTControlModeType->PowerToleranceAcceptance_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ReceiptType(struct iso20_ReceiptType* ReceiptType) {
|
||||
ReceiptType->TaxCosts.arrayLen = 0u;
|
||||
ReceiptType->EnergyCosts_isUsed = 0u;
|
||||
ReceiptType->OccupancyCosts_isUsed = 0u;
|
||||
ReceiptType->AdditionalServicesCosts_isUsed = 0u;
|
||||
ReceiptType->OverstayCosts_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_AbsolutePriceScheduleType(struct iso20_AbsolutePriceScheduleType* AbsolutePriceScheduleType) {
|
||||
AbsolutePriceScheduleType->Id_isUsed = 0u;
|
||||
AbsolutePriceScheduleType->PriceScheduleDescription_isUsed = 0u;
|
||||
AbsolutePriceScheduleType->MinimumCost_isUsed = 0u;
|
||||
AbsolutePriceScheduleType->MaximumCost_isUsed = 0u;
|
||||
AbsolutePriceScheduleType->TaxRules_isUsed = 0u;
|
||||
AbsolutePriceScheduleType->OverstayRules_isUsed = 0u;
|
||||
AbsolutePriceScheduleType->AdditionalSelectedServices_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVPowerProfileEntryListType(struct iso20_EVPowerProfileEntryListType* EVPowerProfileEntryListType) {
|
||||
EVPowerProfileEntryListType->EVPowerProfileEntry.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_Dynamic_SMDTControlModeType(struct iso20_Dynamic_SMDTControlModeType* Dynamic_SMDTControlModeType) {
|
||||
(void) Dynamic_SMDTControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_EVEnergyOfferType(struct iso20_EVEnergyOfferType* EVEnergyOfferType) {
|
||||
(void) EVEnergyOfferType;
|
||||
}
|
||||
|
||||
void init_iso20_PriceLevelScheduleType(struct iso20_PriceLevelScheduleType* PriceLevelScheduleType) {
|
||||
PriceLevelScheduleType->Id_isUsed = 0u;
|
||||
PriceLevelScheduleType->PriceScheduleDescription_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_Scheduled_SMDTControlModeType(struct iso20_Scheduled_SMDTControlModeType* Scheduled_SMDTControlModeType) {
|
||||
(void) Scheduled_SMDTControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_MessageHeaderType(struct iso20_MessageHeaderType* MessageHeaderType) {
|
||||
MessageHeaderType->Signature_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SignaturePropertyType(struct iso20_SignaturePropertyType* SignaturePropertyType) {
|
||||
SignaturePropertyType->Id_isUsed = 0u;
|
||||
SignaturePropertyType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceIDListType(struct iso20_ServiceIDListType* ServiceIDListType) {
|
||||
ServiceIDListType->ServiceID.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SelectedServiceType(struct iso20_SelectedServiceType* SelectedServiceType) {
|
||||
(void) SelectedServiceType;
|
||||
}
|
||||
|
||||
void init_iso20_SignedMeteringDataType(struct iso20_SignedMeteringDataType* SignedMeteringDataType) {
|
||||
SignedMeteringDataType->Receipt_isUsed = 0u;
|
||||
SignedMeteringDataType->Dynamic_SMDTControlMode_isUsed = 0u;
|
||||
SignedMeteringDataType->Scheduled_SMDTControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SignedCertificateChainType(struct iso20_SignedCertificateChainType* SignedCertificateChainType) {
|
||||
SignedCertificateChainType->SubCertificates_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EIM_AReqAuthorizationModeType(struct iso20_EIM_AReqAuthorizationModeType* EIM_AReqAuthorizationModeType) {
|
||||
(void) EIM_AReqAuthorizationModeType;
|
||||
}
|
||||
|
||||
void init_iso20_SelectedServiceListType(struct iso20_SelectedServiceListType* SelectedServiceListType) {
|
||||
SelectedServiceListType->SelectedService.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_Dynamic_SEReqControlModeType(struct iso20_Dynamic_SEReqControlModeType* Dynamic_SEReqControlModeType) {
|
||||
Dynamic_SEReqControlModeType->MinimumSOC_isUsed = 0u;
|
||||
Dynamic_SEReqControlModeType->TargetSOC_isUsed = 0u;
|
||||
Dynamic_SEReqControlModeType->EVMaximumV2XEnergyRequest_isUsed = 0u;
|
||||
Dynamic_SEReqControlModeType->EVMinimumV2XEnergyRequest_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVSEStatusType(struct iso20_EVSEStatusType* EVSEStatusType) {
|
||||
(void) EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_iso20_ListOfRootCertificateIDsType(struct iso20_ListOfRootCertificateIDsType* ListOfRootCertificateIDsType) {
|
||||
ListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PnC_AReqAuthorizationModeType(struct iso20_PnC_AReqAuthorizationModeType* PnC_AReqAuthorizationModeType) {
|
||||
(void) PnC_AReqAuthorizationModeType;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceListType(struct iso20_ServiceListType* ServiceListType) {
|
||||
ServiceListType->Service.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceParameterListType(struct iso20_ServiceParameterListType* ServiceParameterListType) {
|
||||
ServiceParameterListType->ParameterSet.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_Scheduled_SEReqControlModeType(struct iso20_Scheduled_SEReqControlModeType* Scheduled_SEReqControlModeType) {
|
||||
Scheduled_SEReqControlModeType->DepartureTime_isUsed = 0u;
|
||||
Scheduled_SEReqControlModeType->EVTargetEnergyRequest_isUsed = 0u;
|
||||
Scheduled_SEReqControlModeType->EVMaximumEnergyRequest_isUsed = 0u;
|
||||
Scheduled_SEReqControlModeType->EVMinimumEnergyRequest_isUsed = 0u;
|
||||
Scheduled_SEReqControlModeType->EVEnergyOffer_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EVPowerProfileType(struct iso20_EVPowerProfileType* EVPowerProfileType) {
|
||||
EVPowerProfileType->Dynamic_EVPPTControlMode_isUsed = 0u;
|
||||
EVPowerProfileType->Scheduled_EVPPTControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_CertificateChainType(struct iso20_CertificateChainType* CertificateChainType) {
|
||||
CertificateChainType->SubCertificates_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EIM_ASResAuthorizationModeType(struct iso20_EIM_ASResAuthorizationModeType* EIM_ASResAuthorizationModeType) {
|
||||
(void) EIM_ASResAuthorizationModeType;
|
||||
}
|
||||
|
||||
void init_iso20_Dynamic_SEResControlModeType(struct iso20_Dynamic_SEResControlModeType* Dynamic_SEResControlModeType) {
|
||||
Dynamic_SEResControlModeType->DepartureTime_isUsed = 0u;
|
||||
Dynamic_SEResControlModeType->MinimumSOC_isUsed = 0u;
|
||||
Dynamic_SEResControlModeType->TargetSOC_isUsed = 0u;
|
||||
Dynamic_SEResControlModeType->AbsolutePriceSchedule_isUsed = 0u;
|
||||
Dynamic_SEResControlModeType->PriceLevelSchedule_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_EMAIDListType(struct iso20_EMAIDListType* EMAIDListType) {
|
||||
EMAIDListType->EMAID.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SignedInstallationDataType(struct iso20_SignedInstallationDataType* SignedInstallationDataType) {
|
||||
SignedInstallationDataType->SECP521_EncryptedPrivateKey_isUsed = 0u;
|
||||
SignedInstallationDataType->X448_EncryptedPrivateKey_isUsed = 0u;
|
||||
SignedInstallationDataType->TPM_EncryptedPrivateKey_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PnC_ASResAuthorizationModeType(struct iso20_PnC_ASResAuthorizationModeType* PnC_ASResAuthorizationModeType) {
|
||||
PnC_ASResAuthorizationModeType->SupportedProviders_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_Scheduled_SEResControlModeType(struct iso20_Scheduled_SEResControlModeType* Scheduled_SEResControlModeType) {
|
||||
Scheduled_SEResControlModeType->ScheduleTuple.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SessionSetupReqType(struct iso20_SessionSetupReqType* SessionSetupReqType) {
|
||||
(void) SessionSetupReqType;
|
||||
}
|
||||
|
||||
void init_iso20_SessionSetupResType(struct iso20_SessionSetupResType* SessionSetupResType) {
|
||||
(void) SessionSetupResType;
|
||||
}
|
||||
|
||||
void init_iso20_AuthorizationSetupReqType(struct iso20_AuthorizationSetupReqType* AuthorizationSetupReqType) {
|
||||
(void) AuthorizationSetupReqType;
|
||||
}
|
||||
|
||||
void init_iso20_AuthorizationSetupResType(struct iso20_AuthorizationSetupResType* AuthorizationSetupResType) {
|
||||
AuthorizationSetupResType->AuthorizationServices.arrayLen = 0u;
|
||||
AuthorizationSetupResType->EIM_ASResAuthorizationMode_isUsed = 0u;
|
||||
AuthorizationSetupResType->PnC_ASResAuthorizationMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_AuthorizationReqType(struct iso20_AuthorizationReqType* AuthorizationReqType) {
|
||||
AuthorizationReqType->EIM_AReqAuthorizationMode_isUsed = 0u;
|
||||
AuthorizationReqType->PnC_AReqAuthorizationMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_AuthorizationResType(struct iso20_AuthorizationResType* AuthorizationResType) {
|
||||
(void) AuthorizationResType;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceDiscoveryReqType(struct iso20_ServiceDiscoveryReqType* ServiceDiscoveryReqType) {
|
||||
ServiceDiscoveryReqType->SupportedServiceIDs_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceDiscoveryResType(struct iso20_ServiceDiscoveryResType* ServiceDiscoveryResType) {
|
||||
ServiceDiscoveryResType->VASList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceDetailReqType(struct iso20_ServiceDetailReqType* ServiceDetailReqType) {
|
||||
(void) ServiceDetailReqType;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceDetailResType(struct iso20_ServiceDetailResType* ServiceDetailResType) {
|
||||
(void) ServiceDetailResType;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceSelectionReqType(struct iso20_ServiceSelectionReqType* ServiceSelectionReqType) {
|
||||
ServiceSelectionReqType->SelectedVASList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ServiceSelectionResType(struct iso20_ServiceSelectionResType* ServiceSelectionResType) {
|
||||
(void) ServiceSelectionResType;
|
||||
}
|
||||
|
||||
void init_iso20_ScheduleExchangeReqType(struct iso20_ScheduleExchangeReqType* ScheduleExchangeReqType) {
|
||||
ScheduleExchangeReqType->Dynamic_SEReqControlMode_isUsed = 0u;
|
||||
ScheduleExchangeReqType->Scheduled_SEReqControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_ScheduleExchangeResType(struct iso20_ScheduleExchangeResType* ScheduleExchangeResType) {
|
||||
ScheduleExchangeResType->GoToPause_isUsed = 0u;
|
||||
ScheduleExchangeResType->Dynamic_SEResControlMode_isUsed = 0u;
|
||||
ScheduleExchangeResType->Scheduled_SEResControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PowerDeliveryReqType(struct iso20_PowerDeliveryReqType* PowerDeliveryReqType) {
|
||||
PowerDeliveryReqType->EVPowerProfile_isUsed = 0u;
|
||||
PowerDeliveryReqType->BPT_ChannelSelection_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_PowerDeliveryResType(struct iso20_PowerDeliveryResType* PowerDeliveryResType) {
|
||||
PowerDeliveryResType->EVSEStatus_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_MeteringConfirmationReqType(struct iso20_MeteringConfirmationReqType* MeteringConfirmationReqType) {
|
||||
(void) MeteringConfirmationReqType;
|
||||
}
|
||||
|
||||
void init_iso20_MeteringConfirmationResType(struct iso20_MeteringConfirmationResType* MeteringConfirmationResType) {
|
||||
(void) MeteringConfirmationResType;
|
||||
}
|
||||
|
||||
void init_iso20_SessionStopReqType(struct iso20_SessionStopReqType* SessionStopReqType) {
|
||||
SessionStopReqType->EVTerminationCode_isUsed = 0u;
|
||||
SessionStopReqType->EVTerminationExplanation_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SessionStopResType(struct iso20_SessionStopResType* SessionStopResType) {
|
||||
(void) SessionStopResType;
|
||||
}
|
||||
|
||||
void init_iso20_CertificateInstallationReqType(struct iso20_CertificateInstallationReqType* CertificateInstallationReqType) {
|
||||
CertificateInstallationReqType->PrioritizedEMAIDs_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_CertificateInstallationResType(struct iso20_CertificateInstallationResType* CertificateInstallationResType) {
|
||||
(void) CertificateInstallationResType;
|
||||
}
|
||||
|
||||
void init_iso20_VehicleCheckInReqType(struct iso20_VehicleCheckInReqType* VehicleCheckInReqType) {
|
||||
VehicleCheckInReqType->VehicleFrame_isUsed = 0u;
|
||||
VehicleCheckInReqType->DeviceOffset_isUsed = 0u;
|
||||
VehicleCheckInReqType->VehicleTravel_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_VehicleCheckInResType(struct iso20_VehicleCheckInResType* VehicleCheckInResType) {
|
||||
VehicleCheckInResType->ParkingSpace_isUsed = 0u;
|
||||
VehicleCheckInResType->DeviceLocation_isUsed = 0u;
|
||||
VehicleCheckInResType->TargetDistance_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_VehicleCheckOutReqType(struct iso20_VehicleCheckOutReqType* VehicleCheckOutReqType) {
|
||||
(void) VehicleCheckOutReqType;
|
||||
}
|
||||
|
||||
void init_iso20_VehicleCheckOutResType(struct iso20_VehicleCheckOutResType* VehicleCheckOutResType) {
|
||||
(void) VehicleCheckOutResType;
|
||||
}
|
||||
|
||||
void init_iso20_CLReqControlModeType(struct iso20_CLReqControlModeType* CLReqControlModeType) {
|
||||
(void) CLReqControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_CLResControlModeType(struct iso20_CLResControlModeType* CLResControlModeType) {
|
||||
(void) CLResControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_ManifestType(struct iso20_ManifestType* ManifestType) {
|
||||
ManifestType->Reference.arrayLen = 0u;
|
||||
ManifestType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_SignaturePropertiesType(struct iso20_SignaturePropertiesType* SignaturePropertiesType) {
|
||||
SignaturePropertiesType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
// init for fragment
|
||||
void init_iso20_exiFragment(struct iso20_exiFragment* exiFrag) {
|
||||
exiFrag->AbsolutePriceSchedule_isUsed = 0u;
|
||||
exiFrag->CertificateInstallationReq_isUsed = 0u;
|
||||
exiFrag->MeteringConfirmationReq_isUsed = 0u;
|
||||
exiFrag->PnC_AReqAuthorizationMode_isUsed = 0u;
|
||||
exiFrag->SignedInfo_isUsed = 0u;
|
||||
exiFrag->SignedInstallationData_isUsed = 0u;
|
||||
}
|
||||
|
||||
// init for xmldsig fragment
|
||||
void init_iso20_xmldsigFragment(struct iso20_xmldsigFragment* xmldsigFrag) {
|
||||
xmldsigFrag->CanonicalizationMethod_isUsed = 0u;
|
||||
xmldsigFrag->DSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->DigestMethod_isUsed = 0u;
|
||||
xmldsigFrag->KeyInfo_isUsed = 0u;
|
||||
xmldsigFrag->KeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Manifest_isUsed = 0u;
|
||||
xmldsigFrag->Object_isUsed = 0u;
|
||||
xmldsigFrag->PGPData_isUsed = 0u;
|
||||
xmldsigFrag->RSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Reference_isUsed = 0u;
|
||||
xmldsigFrag->RetrievalMethod_isUsed = 0u;
|
||||
xmldsigFrag->SPKIData_isUsed = 0u;
|
||||
xmldsigFrag->Signature_isUsed = 0u;
|
||||
xmldsigFrag->SignatureMethod_isUsed = 0u;
|
||||
xmldsigFrag->SignatureProperties_isUsed = 0u;
|
||||
xmldsigFrag->SignatureProperty_isUsed = 0u;
|
||||
xmldsigFrag->SignatureValue_isUsed = 0u;
|
||||
xmldsigFrag->SignedInfo_isUsed = 0u;
|
||||
xmldsigFrag->Transform_isUsed = 0u;
|
||||
xmldsigFrag->Transforms_isUsed = 0u;
|
||||
xmldsigFrag->X509Data_isUsed = 0u;
|
||||
xmldsigFrag->X509IssuerSerial_isUsed = 0u;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,424 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_DC_Datatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/iso_20/iso20_DC_Datatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_iso20_dc_exiDocument(struct iso20_dc_exiDocument* exiDoc) {
|
||||
exiDoc->DC_ChargeParameterDiscoveryReq_isUsed = 0u;
|
||||
exiDoc->DC_ChargeParameterDiscoveryRes_isUsed = 0u;
|
||||
exiDoc->DC_CableCheckReq_isUsed = 0u;
|
||||
exiDoc->DC_CableCheckRes_isUsed = 0u;
|
||||
exiDoc->DC_PreChargeReq_isUsed = 0u;
|
||||
exiDoc->DC_PreChargeRes_isUsed = 0u;
|
||||
exiDoc->DC_ChargeLoopReq_isUsed = 0u;
|
||||
exiDoc->DC_ChargeLoopRes_isUsed = 0u;
|
||||
exiDoc->DC_WeldingDetectionReq_isUsed = 0u;
|
||||
exiDoc->DC_WeldingDetectionRes_isUsed = 0u;
|
||||
exiDoc->DC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->DC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->BPT_DC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->BPT_DC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
exiDoc->Scheduled_DC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->Scheduled_DC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Scheduled_DC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Scheduled_DC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->Dynamic_DC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->Dynamic_DC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Dynamic_DC_CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->BPT_Dynamic_DC_CLResControlMode_isUsed = 0u;
|
||||
exiDoc->CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->CLResControlMode_isUsed = 0u;
|
||||
exiDoc->Signature_isUsed = 0u;
|
||||
exiDoc->SignatureValue_isUsed = 0u;
|
||||
exiDoc->SignedInfo_isUsed = 0u;
|
||||
exiDoc->CanonicalizationMethod_isUsed = 0u;
|
||||
exiDoc->SignatureMethod_isUsed = 0u;
|
||||
exiDoc->Reference_isUsed = 0u;
|
||||
exiDoc->Transforms_isUsed = 0u;
|
||||
exiDoc->Transform_isUsed = 0u;
|
||||
exiDoc->DigestMethod_isUsed = 0u;
|
||||
exiDoc->KeyInfo_isUsed = 0u;
|
||||
exiDoc->KeyValue_isUsed = 0u;
|
||||
exiDoc->RetrievalMethod_isUsed = 0u;
|
||||
exiDoc->X509Data_isUsed = 0u;
|
||||
exiDoc->PGPData_isUsed = 0u;
|
||||
exiDoc->SPKIData_isUsed = 0u;
|
||||
exiDoc->Object_isUsed = 0u;
|
||||
exiDoc->Manifest_isUsed = 0u;
|
||||
exiDoc->SignatureProperties_isUsed = 0u;
|
||||
exiDoc->SignatureProperty_isUsed = 0u;
|
||||
exiDoc->DSAKeyValue_isUsed = 0u;
|
||||
exiDoc->RSAKeyValue_isUsed = 0u;
|
||||
}
|
||||
void init_iso20_dc_TransformType(struct iso20_dc_TransformType* TransformType) {
|
||||
TransformType->ANY_isUsed = 0u;
|
||||
TransformType->XPath_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_TransformsType(struct iso20_dc_TransformsType* TransformsType) {
|
||||
(void) TransformsType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DSAKeyValueType(struct iso20_dc_DSAKeyValueType* DSAKeyValueType) {
|
||||
DSAKeyValueType->P_isUsed = 0u;
|
||||
DSAKeyValueType->Q_isUsed = 0u;
|
||||
DSAKeyValueType->G_isUsed = 0u;
|
||||
DSAKeyValueType->J_isUsed = 0u;
|
||||
DSAKeyValueType->Seed_isUsed = 0u;
|
||||
DSAKeyValueType->PgenCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_X509IssuerSerialType(struct iso20_dc_X509IssuerSerialType* X509IssuerSerialType) {
|
||||
(void) X509IssuerSerialType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DigestMethodType(struct iso20_dc_DigestMethodType* DigestMethodType) {
|
||||
DigestMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_RSAKeyValueType(struct iso20_dc_RSAKeyValueType* RSAKeyValueType) {
|
||||
(void) RSAKeyValueType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_CanonicalizationMethodType(struct iso20_dc_CanonicalizationMethodType* CanonicalizationMethodType) {
|
||||
CanonicalizationMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_SignatureMethodType(struct iso20_dc_SignatureMethodType* SignatureMethodType) {
|
||||
SignatureMethodType->HMACOutputLength_isUsed = 0u;
|
||||
SignatureMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_KeyValueType(struct iso20_dc_KeyValueType* KeyValueType) {
|
||||
KeyValueType->DSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->RSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_ReferenceType(struct iso20_dc_ReferenceType* ReferenceType) {
|
||||
ReferenceType->Id_isUsed = 0u;
|
||||
ReferenceType->Type_isUsed = 0u;
|
||||
ReferenceType->URI_isUsed = 0u;
|
||||
ReferenceType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_RetrievalMethodType(struct iso20_dc_RetrievalMethodType* RetrievalMethodType) {
|
||||
RetrievalMethodType->Type_isUsed = 0u;
|
||||
RetrievalMethodType->URI_isUsed = 0u;
|
||||
RetrievalMethodType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_X509DataType(struct iso20_dc_X509DataType* X509DataType) {
|
||||
X509DataType->X509IssuerSerial_isUsed = 0u;
|
||||
X509DataType->X509SKI_isUsed = 0u;
|
||||
X509DataType->X509SubjectName_isUsed = 0u;
|
||||
X509DataType->X509Certificate_isUsed = 0u;
|
||||
X509DataType->X509CRL_isUsed = 0u;
|
||||
X509DataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_PGPDataType(struct iso20_dc_PGPDataType* PGPDataType) {
|
||||
PGPDataType->choice_1_isUsed = 0u;
|
||||
PGPDataType->choice_2_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_SPKIDataType(struct iso20_dc_SPKIDataType* SPKIDataType) {
|
||||
SPKIDataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_SignedInfoType(struct iso20_dc_SignedInfoType* SignedInfoType) {
|
||||
SignedInfoType->Reference.arrayLen = 0u;
|
||||
SignedInfoType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_SignatureValueType(struct iso20_dc_SignatureValueType* SignatureValueType) {
|
||||
SignatureValueType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_KeyInfoType(struct iso20_dc_KeyInfoType* KeyInfoType) {
|
||||
KeyInfoType->Id_isUsed = 0u;
|
||||
KeyInfoType->KeyName_isUsed = 0u;
|
||||
KeyInfoType->KeyValue_isUsed = 0u;
|
||||
KeyInfoType->RetrievalMethod_isUsed = 0u;
|
||||
KeyInfoType->X509Data_isUsed = 0u;
|
||||
KeyInfoType->PGPData_isUsed = 0u;
|
||||
KeyInfoType->SPKIData_isUsed = 0u;
|
||||
KeyInfoType->MgmtData_isUsed = 0u;
|
||||
KeyInfoType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_ObjectType(struct iso20_dc_ObjectType* ObjectType) {
|
||||
ObjectType->Encoding_isUsed = 0u;
|
||||
ObjectType->Id_isUsed = 0u;
|
||||
ObjectType->MimeType_isUsed = 0u;
|
||||
ObjectType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_RationalNumberType(struct iso20_dc_RationalNumberType* RationalNumberType) {
|
||||
(void) RationalNumberType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DetailedCostType(struct iso20_dc_DetailedCostType* DetailedCostType) {
|
||||
(void) DetailedCostType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_SignatureType(struct iso20_dc_SignatureType* SignatureType) {
|
||||
SignatureType->Id_isUsed = 0u;
|
||||
SignatureType->KeyInfo_isUsed = 0u;
|
||||
SignatureType->Object_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DetailedTaxType(struct iso20_dc_DetailedTaxType* DetailedTaxType) {
|
||||
(void) DetailedTaxType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_MessageHeaderType(struct iso20_dc_MessageHeaderType* MessageHeaderType) {
|
||||
MessageHeaderType->Signature_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_SignaturePropertyType(struct iso20_dc_SignaturePropertyType* SignaturePropertyType) {
|
||||
SignaturePropertyType->Id_isUsed = 0u;
|
||||
SignaturePropertyType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_CPDReqEnergyTransferModeType(struct iso20_dc_DC_CPDReqEnergyTransferModeType* DC_CPDReqEnergyTransferModeType) {
|
||||
DC_CPDReqEnergyTransferModeType->TargetSOC_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DisplayParametersType(struct iso20_dc_DisplayParametersType* DisplayParametersType) {
|
||||
DisplayParametersType->PresentSOC_isUsed = 0u;
|
||||
DisplayParametersType->MinimumSOC_isUsed = 0u;
|
||||
DisplayParametersType->TargetSOC_isUsed = 0u;
|
||||
DisplayParametersType->MaximumSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToMinimumSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToTargetSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToMaximumSOC_isUsed = 0u;
|
||||
DisplayParametersType->ChargingComplete_isUsed = 0u;
|
||||
DisplayParametersType->BatteryEnergyCapacity_isUsed = 0u;
|
||||
DisplayParametersType->InletHot_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_CPDResEnergyTransferModeType(struct iso20_dc_DC_CPDResEnergyTransferModeType* DC_CPDResEnergyTransferModeType) {
|
||||
DC_CPDResEnergyTransferModeType->EVSEPowerRampLimitation_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_EVSEStatusType(struct iso20_dc_EVSEStatusType* EVSEStatusType) {
|
||||
(void) EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_MeterInfoType(struct iso20_dc_MeterInfoType* MeterInfoType) {
|
||||
MeterInfoType->BPT_DischargedEnergyReadingWh_isUsed = 0u;
|
||||
MeterInfoType->CapacitiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->BPT_InductiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->MeterSignature_isUsed = 0u;
|
||||
MeterInfoType->MeterStatus_isUsed = 0u;
|
||||
MeterInfoType->MeterTimestamp_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_Dynamic_DC_CLReqControlModeType(struct iso20_dc_Dynamic_DC_CLReqControlModeType* Dynamic_DC_CLReqControlModeType) {
|
||||
Dynamic_DC_CLReqControlModeType->DepartureTime_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_Scheduled_DC_CLReqControlModeType(struct iso20_dc_Scheduled_DC_CLReqControlModeType* Scheduled_DC_CLReqControlModeType) {
|
||||
Scheduled_DC_CLReqControlModeType->EVTargetEnergyRequest_isUsed = 0u;
|
||||
Scheduled_DC_CLReqControlModeType->EVMaximumEnergyRequest_isUsed = 0u;
|
||||
Scheduled_DC_CLReqControlModeType->EVMinimumEnergyRequest_isUsed = 0u;
|
||||
Scheduled_DC_CLReqControlModeType->EVMaximumChargePower_isUsed = 0u;
|
||||
Scheduled_DC_CLReqControlModeType->EVMinimumChargePower_isUsed = 0u;
|
||||
Scheduled_DC_CLReqControlModeType->EVMaximumChargeCurrent_isUsed = 0u;
|
||||
Scheduled_DC_CLReqControlModeType->EVMaximumVoltage_isUsed = 0u;
|
||||
Scheduled_DC_CLReqControlModeType->EVMinimumVoltage_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_CLReqControlModeType(struct iso20_dc_CLReqControlModeType* CLReqControlModeType) {
|
||||
(void) CLReqControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_ReceiptType(struct iso20_dc_ReceiptType* ReceiptType) {
|
||||
ReceiptType->TaxCosts.arrayLen = 0u;
|
||||
ReceiptType->EnergyCosts_isUsed = 0u;
|
||||
ReceiptType->OccupancyCosts_isUsed = 0u;
|
||||
ReceiptType->AdditionalServicesCosts_isUsed = 0u;
|
||||
ReceiptType->OverstayCosts_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_Dynamic_DC_CLResControlModeType(struct iso20_dc_Dynamic_DC_CLResControlModeType* Dynamic_DC_CLResControlModeType) {
|
||||
Dynamic_DC_CLResControlModeType->DepartureTime_isUsed = 0u;
|
||||
Dynamic_DC_CLResControlModeType->MinimumSOC_isUsed = 0u;
|
||||
Dynamic_DC_CLResControlModeType->TargetSOC_isUsed = 0u;
|
||||
Dynamic_DC_CLResControlModeType->AckMaxDelay_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_Scheduled_DC_CLResControlModeType(struct iso20_dc_Scheduled_DC_CLResControlModeType* Scheduled_DC_CLResControlModeType) {
|
||||
Scheduled_DC_CLResControlModeType->EVSEMaximumChargePower_isUsed = 0u;
|
||||
Scheduled_DC_CLResControlModeType->EVSEMinimumChargePower_isUsed = 0u;
|
||||
Scheduled_DC_CLResControlModeType->EVSEMaximumChargeCurrent_isUsed = 0u;
|
||||
Scheduled_DC_CLResControlModeType->EVSEMaximumVoltage_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_CLResControlModeType(struct iso20_dc_CLResControlModeType* CLResControlModeType) {
|
||||
(void) CLResControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_ChargeParameterDiscoveryReqType(struct iso20_dc_DC_ChargeParameterDiscoveryReqType* DC_ChargeParameterDiscoveryReqType) {
|
||||
DC_ChargeParameterDiscoveryReqType->BPT_DC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
DC_ChargeParameterDiscoveryReqType->DC_CPDReqEnergyTransferMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_ChargeParameterDiscoveryResType(struct iso20_dc_DC_ChargeParameterDiscoveryResType* DC_ChargeParameterDiscoveryResType) {
|
||||
DC_ChargeParameterDiscoveryResType->BPT_DC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
DC_ChargeParameterDiscoveryResType->DC_CPDResEnergyTransferMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_CableCheckReqType(struct iso20_dc_DC_CableCheckReqType* DC_CableCheckReqType) {
|
||||
(void) DC_CableCheckReqType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_CableCheckResType(struct iso20_dc_DC_CableCheckResType* DC_CableCheckResType) {
|
||||
(void) DC_CableCheckResType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_PreChargeReqType(struct iso20_dc_DC_PreChargeReqType* DC_PreChargeReqType) {
|
||||
(void) DC_PreChargeReqType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_PreChargeResType(struct iso20_dc_DC_PreChargeResType* DC_PreChargeResType) {
|
||||
(void) DC_PreChargeResType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_ChargeLoopReqType(struct iso20_dc_DC_ChargeLoopReqType* DC_ChargeLoopReqType) {
|
||||
DC_ChargeLoopReqType->DisplayParameters_isUsed = 0u;
|
||||
DC_ChargeLoopReqType->BPT_Dynamic_DC_CLReqControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopReqType->BPT_Scheduled_DC_CLReqControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopReqType->CLReqControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopReqType->Dynamic_DC_CLReqControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopReqType->Scheduled_DC_CLReqControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_ChargeLoopResType(struct iso20_dc_DC_ChargeLoopResType* DC_ChargeLoopResType) {
|
||||
DC_ChargeLoopResType->EVSEStatus_isUsed = 0u;
|
||||
DC_ChargeLoopResType->MeterInfo_isUsed = 0u;
|
||||
DC_ChargeLoopResType->Receipt_isUsed = 0u;
|
||||
DC_ChargeLoopResType->BPT_Dynamic_DC_CLResControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopResType->BPT_Scheduled_DC_CLResControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopResType->CLResControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopResType->Dynamic_DC_CLResControlMode_isUsed = 0u;
|
||||
DC_ChargeLoopResType->Scheduled_DC_CLResControlMode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_WeldingDetectionReqType(struct iso20_dc_DC_WeldingDetectionReqType* DC_WeldingDetectionReqType) {
|
||||
(void) DC_WeldingDetectionReqType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_DC_WeldingDetectionResType(struct iso20_dc_DC_WeldingDetectionResType* DC_WeldingDetectionResType) {
|
||||
(void) DC_WeldingDetectionResType;
|
||||
}
|
||||
|
||||
void init_iso20_dc_BPT_DC_CPDReqEnergyTransferModeType(struct iso20_dc_BPT_DC_CPDReqEnergyTransferModeType* BPT_DC_CPDReqEnergyTransferModeType) {
|
||||
BPT_DC_CPDReqEnergyTransferModeType->TargetSOC_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_BPT_DC_CPDResEnergyTransferModeType(struct iso20_dc_BPT_DC_CPDResEnergyTransferModeType* BPT_DC_CPDResEnergyTransferModeType) {
|
||||
BPT_DC_CPDResEnergyTransferModeType->EVSEPowerRampLimitation_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_BPT_Scheduled_DC_CLReqControlModeType(struct iso20_dc_BPT_Scheduled_DC_CLReqControlModeType* BPT_Scheduled_DC_CLReqControlModeType) {
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVTargetEnergyRequest_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMaximumEnergyRequest_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMinimumEnergyRequest_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMaximumChargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMinimumChargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMaximumChargeCurrent_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMaximumVoltage_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMinimumVoltage_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMaximumDischargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMinimumDischargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLReqControlModeType->EVMaximumDischargeCurrent_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_BPT_Scheduled_DC_CLResControlModeType(struct iso20_dc_BPT_Scheduled_DC_CLResControlModeType* BPT_Scheduled_DC_CLResControlModeType) {
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMaximumChargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMinimumChargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMaximumChargeCurrent_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMaximumVoltage_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMaximumDischargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMinimumDischargePower_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMaximumDischargeCurrent_isUsed = 0u;
|
||||
BPT_Scheduled_DC_CLResControlModeType->EVSEMinimumVoltage_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_BPT_Dynamic_DC_CLReqControlModeType(struct iso20_dc_BPT_Dynamic_DC_CLReqControlModeType* BPT_Dynamic_DC_CLReqControlModeType) {
|
||||
BPT_Dynamic_DC_CLReqControlModeType->DepartureTime_isUsed = 0u;
|
||||
BPT_Dynamic_DC_CLReqControlModeType->EVMaximumV2XEnergyRequest_isUsed = 0u;
|
||||
BPT_Dynamic_DC_CLReqControlModeType->EVMinimumV2XEnergyRequest_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_BPT_Dynamic_DC_CLResControlModeType(struct iso20_dc_BPT_Dynamic_DC_CLResControlModeType* BPT_Dynamic_DC_CLResControlModeType) {
|
||||
BPT_Dynamic_DC_CLResControlModeType->DepartureTime_isUsed = 0u;
|
||||
BPT_Dynamic_DC_CLResControlModeType->MinimumSOC_isUsed = 0u;
|
||||
BPT_Dynamic_DC_CLResControlModeType->TargetSOC_isUsed = 0u;
|
||||
BPT_Dynamic_DC_CLResControlModeType->AckMaxDelay_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_ManifestType(struct iso20_dc_ManifestType* ManifestType) {
|
||||
ManifestType->Reference.arrayLen = 0u;
|
||||
ManifestType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_dc_SignaturePropertiesType(struct iso20_dc_SignaturePropertiesType* SignaturePropertiesType) {
|
||||
SignaturePropertiesType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
// init for fragment
|
||||
void init_iso20_dc_exiFragment(struct iso20_dc_exiFragment* exiFrag) {
|
||||
exiFrag->DC_ChargeParameterDiscoveryRes_isUsed = 0u;
|
||||
exiFrag->SignedInfo_isUsed = 0u;
|
||||
}
|
||||
|
||||
// init for xmldsig fragment
|
||||
void init_iso20_dc_xmldsigFragment(struct iso20_dc_xmldsigFragment* xmldsigFrag) {
|
||||
xmldsigFrag->CanonicalizationMethod_isUsed = 0u;
|
||||
xmldsigFrag->DSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->DigestMethod_isUsed = 0u;
|
||||
xmldsigFrag->KeyInfo_isUsed = 0u;
|
||||
xmldsigFrag->KeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Manifest_isUsed = 0u;
|
||||
xmldsigFrag->Object_isUsed = 0u;
|
||||
xmldsigFrag->PGPData_isUsed = 0u;
|
||||
xmldsigFrag->RSAKeyValue_isUsed = 0u;
|
||||
xmldsigFrag->Reference_isUsed = 0u;
|
||||
xmldsigFrag->RetrievalMethod_isUsed = 0u;
|
||||
xmldsigFrag->SPKIData_isUsed = 0u;
|
||||
xmldsigFrag->Signature_isUsed = 0u;
|
||||
xmldsigFrag->SignatureMethod_isUsed = 0u;
|
||||
xmldsigFrag->SignatureProperties_isUsed = 0u;
|
||||
xmldsigFrag->SignatureProperty_isUsed = 0u;
|
||||
xmldsigFrag->SignatureValue_isUsed = 0u;
|
||||
xmldsigFrag->SignedInfo_isUsed = 0u;
|
||||
xmldsigFrag->Transform_isUsed = 0u;
|
||||
xmldsigFrag->Transforms_isUsed = 0u;
|
||||
xmldsigFrag->X509Data_isUsed = 0u;
|
||||
xmldsigFrag->X509IssuerSerial_isUsed = 0u;
|
||||
}
|
||||
|
||||
|
||||
14751
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_DC_Decoder.c
Normal file
14751
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_DC_Decoder.c
Normal file
File diff suppressed because it is too large
Load Diff
12854
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_DC_Encoder.c
Normal file
12854
tools/EVerest-main/lib/everest/cbv2g/lib/cbv2g/iso_20/iso20_DC_Encoder.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,406 @@
|
||||
/* SPDX-License-Identifier: Apache-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2022 - 2023 chargebyte GmbH
|
||||
* Copyright (C) 2022 - 2023 Contributors to EVerest
|
||||
*/
|
||||
|
||||
/*****************************************************
|
||||
*
|
||||
* @author
|
||||
* @version
|
||||
*
|
||||
* The Code is generated! Changes may be overwritten.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* @file iso20_WPT_Datatypes.c
|
||||
* @brief Description goes here
|
||||
*
|
||||
**/
|
||||
#include "cbv2g/iso_20/iso20_WPT_Datatypes.h"
|
||||
|
||||
|
||||
|
||||
// root elements of EXI doc
|
||||
void init_iso20_wpt_exiDocument(struct iso20_wpt_exiDocument* exiDoc) {
|
||||
exiDoc->WPT_FinePositioningSetupReq_isUsed = 0u;
|
||||
exiDoc->WPT_FinePositioningSetupRes_isUsed = 0u;
|
||||
exiDoc->WPT_FinePositioningReq_isUsed = 0u;
|
||||
exiDoc->WPT_FinePositioningRes_isUsed = 0u;
|
||||
exiDoc->WPT_PairingReq_isUsed = 0u;
|
||||
exiDoc->WPT_PairingRes_isUsed = 0u;
|
||||
exiDoc->WPT_ChargeParameterDiscoveryReq_isUsed = 0u;
|
||||
exiDoc->WPT_ChargeParameterDiscoveryRes_isUsed = 0u;
|
||||
exiDoc->WPT_AlignmentCheckReq_isUsed = 0u;
|
||||
exiDoc->WPT_AlignmentCheckRes_isUsed = 0u;
|
||||
exiDoc->WPT_ChargeLoopReq_isUsed = 0u;
|
||||
exiDoc->WPT_ChargeLoopRes_isUsed = 0u;
|
||||
exiDoc->CLReqControlMode_isUsed = 0u;
|
||||
exiDoc->CLResControlMode_isUsed = 0u;
|
||||
exiDoc->Signature_isUsed = 0u;
|
||||
exiDoc->SignatureValue_isUsed = 0u;
|
||||
exiDoc->SignedInfo_isUsed = 0u;
|
||||
exiDoc->CanonicalizationMethod_isUsed = 0u;
|
||||
exiDoc->SignatureMethod_isUsed = 0u;
|
||||
exiDoc->Reference_isUsed = 0u;
|
||||
exiDoc->Transforms_isUsed = 0u;
|
||||
exiDoc->Transform_isUsed = 0u;
|
||||
exiDoc->DigestMethod_isUsed = 0u;
|
||||
exiDoc->KeyInfo_isUsed = 0u;
|
||||
exiDoc->KeyValue_isUsed = 0u;
|
||||
exiDoc->RetrievalMethod_isUsed = 0u;
|
||||
exiDoc->X509Data_isUsed = 0u;
|
||||
exiDoc->PGPData_isUsed = 0u;
|
||||
exiDoc->SPKIData_isUsed = 0u;
|
||||
exiDoc->Object_isUsed = 0u;
|
||||
exiDoc->Manifest_isUsed = 0u;
|
||||
exiDoc->SignatureProperties_isUsed = 0u;
|
||||
exiDoc->SignatureProperty_isUsed = 0u;
|
||||
exiDoc->DSAKeyValue_isUsed = 0u;
|
||||
exiDoc->RSAKeyValue_isUsed = 0u;
|
||||
}
|
||||
void init_iso20_wpt_TransformType(struct iso20_wpt_TransformType* TransformType) {
|
||||
TransformType->ANY_isUsed = 0u;
|
||||
TransformType->XPath_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_RxRSSIType(struct iso20_wpt_WPT_LF_RxRSSIType* WPT_LF_RxRSSIType) {
|
||||
(void) WPT_LF_RxRSSIType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_TransformsType(struct iso20_wpt_TransformsType* TransformsType) {
|
||||
(void) TransformsType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_DSAKeyValueType(struct iso20_wpt_DSAKeyValueType* DSAKeyValueType) {
|
||||
DSAKeyValueType->P_isUsed = 0u;
|
||||
DSAKeyValueType->Q_isUsed = 0u;
|
||||
DSAKeyValueType->G_isUsed = 0u;
|
||||
DSAKeyValueType->J_isUsed = 0u;
|
||||
DSAKeyValueType->Seed_isUsed = 0u;
|
||||
DSAKeyValueType->PgenCounter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_X509IssuerSerialType(struct iso20_wpt_X509IssuerSerialType* X509IssuerSerialType) {
|
||||
(void) X509IssuerSerialType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_DigestMethodType(struct iso20_wpt_DigestMethodType* DigestMethodType) {
|
||||
DigestMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_RSAKeyValueType(struct iso20_wpt_RSAKeyValueType* RSAKeyValueType) {
|
||||
(void) RSAKeyValueType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_RxRSSIListType(struct iso20_wpt_WPT_LF_RxRSSIListType* WPT_LF_RxRSSIListType) {
|
||||
(void) WPT_LF_RxRSSIListType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_CanonicalizationMethodType(struct iso20_wpt_CanonicalizationMethodType* CanonicalizationMethodType) {
|
||||
CanonicalizationMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_TxRxPulseOrderType(struct iso20_wpt_WPT_TxRxPulseOrderType* WPT_TxRxPulseOrderType) {
|
||||
(void) WPT_TxRxPulseOrderType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_TxDataType(struct iso20_wpt_WPT_LF_TxDataType* WPT_LF_TxDataType) {
|
||||
(void) WPT_LF_TxDataType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_RxDataType(struct iso20_wpt_WPT_LF_RxDataType* WPT_LF_RxDataType) {
|
||||
(void) WPT_LF_RxDataType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_SignatureMethodType(struct iso20_wpt_SignatureMethodType* SignatureMethodType) {
|
||||
SignatureMethodType->HMACOutputLength_isUsed = 0u;
|
||||
SignatureMethodType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_KeyValueType(struct iso20_wpt_KeyValueType* KeyValueType) {
|
||||
KeyValueType->DSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->RSAKeyValue_isUsed = 0u;
|
||||
KeyValueType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_CoordinateXYZType(struct iso20_wpt_WPT_CoordinateXYZType* WPT_CoordinateXYZType) {
|
||||
(void) WPT_CoordinateXYZType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_ReferenceType(struct iso20_wpt_ReferenceType* ReferenceType) {
|
||||
ReferenceType->Id_isUsed = 0u;
|
||||
ReferenceType->Type_isUsed = 0u;
|
||||
ReferenceType->URI_isUsed = 0u;
|
||||
ReferenceType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_RetrievalMethodType(struct iso20_wpt_RetrievalMethodType* RetrievalMethodType) {
|
||||
RetrievalMethodType->Type_isUsed = 0u;
|
||||
RetrievalMethodType->URI_isUsed = 0u;
|
||||
RetrievalMethodType->Transforms_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_X509DataType(struct iso20_wpt_X509DataType* X509DataType) {
|
||||
X509DataType->X509IssuerSerial_isUsed = 0u;
|
||||
X509DataType->X509SKI_isUsed = 0u;
|
||||
X509DataType->X509SubjectName_isUsed = 0u;
|
||||
X509DataType->X509Certificate_isUsed = 0u;
|
||||
X509DataType->X509CRL_isUsed = 0u;
|
||||
X509DataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_PGPDataType(struct iso20_wpt_PGPDataType* PGPDataType) {
|
||||
PGPDataType->choice_1_isUsed = 0u;
|
||||
PGPDataType->choice_2_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_SPKIDataType(struct iso20_wpt_SPKIDataType* SPKIDataType) {
|
||||
SPKIDataType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_SignedInfoType(struct iso20_wpt_SignedInfoType* SignedInfoType) {
|
||||
SignedInfoType->Reference.arrayLen = 0u;
|
||||
SignedInfoType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_SignatureValueType(struct iso20_wpt_SignatureValueType* SignatureValueType) {
|
||||
SignatureValueType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_RationalNumberType(struct iso20_wpt_RationalNumberType* RationalNumberType) {
|
||||
(void) RationalNumberType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_TxDataListType(struct iso20_wpt_WPT_LF_TxDataListType* WPT_LF_TxDataListType) {
|
||||
(void) WPT_LF_TxDataListType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_KeyInfoType(struct iso20_wpt_KeyInfoType* KeyInfoType) {
|
||||
KeyInfoType->Id_isUsed = 0u;
|
||||
KeyInfoType->KeyName_isUsed = 0u;
|
||||
KeyInfoType->KeyValue_isUsed = 0u;
|
||||
KeyInfoType->RetrievalMethod_isUsed = 0u;
|
||||
KeyInfoType->X509Data_isUsed = 0u;
|
||||
KeyInfoType->PGPData_isUsed = 0u;
|
||||
KeyInfoType->SPKIData_isUsed = 0u;
|
||||
KeyInfoType->MgmtData_isUsed = 0u;
|
||||
KeyInfoType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_TxRxSpecDataType(struct iso20_wpt_WPT_TxRxSpecDataType* WPT_TxRxSpecDataType) {
|
||||
(void) WPT_TxRxSpecDataType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_RxDataListType(struct iso20_wpt_WPT_LF_RxDataListType* WPT_LF_RxDataListType) {
|
||||
(void) WPT_LF_RxDataListType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_ObjectType(struct iso20_wpt_ObjectType* ObjectType) {
|
||||
ObjectType->Encoding_isUsed = 0u;
|
||||
ObjectType->Id_isUsed = 0u;
|
||||
ObjectType->MimeType_isUsed = 0u;
|
||||
ObjectType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_TxRxPackageSpecDataType(struct iso20_wpt_WPT_TxRxPackageSpecDataType* WPT_TxRxPackageSpecDataType) {
|
||||
WPT_TxRxPackageSpecDataType->PulseSequenceOrder.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_TransmitterDataType(struct iso20_wpt_WPT_LF_TransmitterDataType* WPT_LF_TransmitterDataType) {
|
||||
WPT_LF_TransmitterDataType->TxSpecData.arrayLen = 0u;
|
||||
WPT_LF_TransmitterDataType->TxPackageSpecData_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_AlternativeSECCType(struct iso20_wpt_AlternativeSECCType* AlternativeSECCType) {
|
||||
AlternativeSECCType->SSID_isUsed = 0u;
|
||||
AlternativeSECCType->BSSID_isUsed = 0u;
|
||||
AlternativeSECCType->IPAddress_isUsed = 0u;
|
||||
AlternativeSECCType->Port_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_ReceiverDataType(struct iso20_wpt_WPT_LF_ReceiverDataType* WPT_LF_ReceiverDataType) {
|
||||
WPT_LF_ReceiverDataType->RxSpecData.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_DataPackageType(struct iso20_wpt_WPT_LF_DataPackageType* WPT_LF_DataPackageType) {
|
||||
WPT_LF_DataPackageType->LF_TxData_isUsed = 0u;
|
||||
WPT_LF_DataPackageType->LF_RxData_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_DetailedCostType(struct iso20_wpt_DetailedCostType* DetailedCostType) {
|
||||
(void) DetailedCostType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_SignatureType(struct iso20_wpt_SignatureType* SignatureType) {
|
||||
SignatureType->Id_isUsed = 0u;
|
||||
SignatureType->KeyInfo_isUsed = 0u;
|
||||
SignatureType->Object_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_DetailedTaxType(struct iso20_wpt_DetailedTaxType* DetailedTaxType) {
|
||||
(void) DetailedTaxType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_MessageHeaderType(struct iso20_wpt_MessageHeaderType* MessageHeaderType) {
|
||||
MessageHeaderType->Signature_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_SignaturePropertyType(struct iso20_wpt_SignaturePropertyType* SignaturePropertyType) {
|
||||
SignaturePropertyType->Id_isUsed = 0u;
|
||||
SignaturePropertyType->ANY_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_DisplayParametersType(struct iso20_wpt_DisplayParametersType* DisplayParametersType) {
|
||||
DisplayParametersType->PresentSOC_isUsed = 0u;
|
||||
DisplayParametersType->MinimumSOC_isUsed = 0u;
|
||||
DisplayParametersType->TargetSOC_isUsed = 0u;
|
||||
DisplayParametersType->MaximumSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToMinimumSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToTargetSOC_isUsed = 0u;
|
||||
DisplayParametersType->RemainingTimeToMaximumSOC_isUsed = 0u;
|
||||
DisplayParametersType->ChargingComplete_isUsed = 0u;
|
||||
DisplayParametersType->BatteryEnergyCapacity_isUsed = 0u;
|
||||
DisplayParametersType->InletHot_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_FinePositioningMethodListType(struct iso20_wpt_WPT_FinePositioningMethodListType* WPT_FinePositioningMethodListType) {
|
||||
WPT_FinePositioningMethodListType->WPT_FinePositioningMethod.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_EVSEStatusType(struct iso20_wpt_EVSEStatusType* EVSEStatusType) {
|
||||
(void) EVSEStatusType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_PairingMethodListType(struct iso20_wpt_WPT_PairingMethodListType* WPT_PairingMethodListType) {
|
||||
WPT_PairingMethodListType->WPT_PairingMethod.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_MeterInfoType(struct iso20_wpt_MeterInfoType* MeterInfoType) {
|
||||
MeterInfoType->BPT_DischargedEnergyReadingWh_isUsed = 0u;
|
||||
MeterInfoType->CapacitiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->BPT_InductiveEnergyReadingVARh_isUsed = 0u;
|
||||
MeterInfoType->MeterSignature_isUsed = 0u;
|
||||
MeterInfoType->MeterStatus_isUsed = 0u;
|
||||
MeterInfoType->MeterTimestamp_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_AlignmentCheckMethodListType(struct iso20_wpt_WPT_AlignmentCheckMethodListType* WPT_AlignmentCheckMethodListType) {
|
||||
WPT_AlignmentCheckMethodListType->WPT_AlignmentCheckMethod.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_DataPackageListType(struct iso20_wpt_WPT_LF_DataPackageListType* WPT_LF_DataPackageListType) {
|
||||
(void) WPT_LF_DataPackageListType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_AlternativeSECCListType(struct iso20_wpt_AlternativeSECCListType* AlternativeSECCListType) {
|
||||
AlternativeSECCListType->AlternativeSECC.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_ReceiptType(struct iso20_wpt_ReceiptType* ReceiptType) {
|
||||
ReceiptType->TaxCosts.arrayLen = 0u;
|
||||
ReceiptType->EnergyCosts_isUsed = 0u;
|
||||
ReceiptType->OccupancyCosts_isUsed = 0u;
|
||||
ReceiptType->AdditionalServicesCosts_isUsed = 0u;
|
||||
ReceiptType->OverstayCosts_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_LF_SystemSetupDataType(struct iso20_wpt_WPT_LF_SystemSetupDataType* WPT_LF_SystemSetupDataType) {
|
||||
WPT_LF_SystemSetupDataType->LF_TransmitterSetupData_isUsed = 0u;
|
||||
WPT_LF_SystemSetupDataType->LF_ReceiverSetupData_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_EVPCPowerControlParameterType(struct iso20_wpt_WPT_EVPCPowerControlParameterType* WPT_EVPCPowerControlParameterType) {
|
||||
(void) WPT_EVPCPowerControlParameterType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_SPCPowerControlParameterType(struct iso20_wpt_WPT_SPCPowerControlParameterType* WPT_SPCPowerControlParameterType) {
|
||||
(void) WPT_SPCPowerControlParameterType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_FinePositioningSetupReqType(struct iso20_wpt_WPT_FinePositioningSetupReqType* WPT_FinePositioningSetupReqType) {
|
||||
WPT_FinePositioningSetupReqType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_FinePositioningSetupReqType->LF_SystemSetupData_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_FinePositioningSetupResType(struct iso20_wpt_WPT_FinePositioningSetupResType* WPT_FinePositioningSetupResType) {
|
||||
WPT_FinePositioningSetupResType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_FinePositioningSetupResType->LF_SystemSetupData_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_FinePositioningReqType(struct iso20_wpt_WPT_FinePositioningReqType* WPT_FinePositioningReqType) {
|
||||
WPT_FinePositioningReqType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_FinePositioningReqType->WPT_LF_DataPackageList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_FinePositioningResType(struct iso20_wpt_WPT_FinePositioningResType* WPT_FinePositioningResType) {
|
||||
WPT_FinePositioningResType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_FinePositioningResType->WPT_LF_DataPackageList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_PairingReqType(struct iso20_wpt_WPT_PairingReqType* WPT_PairingReqType) {
|
||||
WPT_PairingReqType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_PairingReqType->ObservedIDCode_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_PairingResType(struct iso20_wpt_WPT_PairingResType* WPT_PairingResType) {
|
||||
WPT_PairingResType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_PairingResType->ObservedIDCode_isUsed = 0u;
|
||||
WPT_PairingResType->AlternativeSECCList_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_ChargeParameterDiscoveryReqType(struct iso20_wpt_WPT_ChargeParameterDiscoveryReqType* WPT_ChargeParameterDiscoveryReqType) {
|
||||
WPT_ChargeParameterDiscoveryReqType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_ChargeParameterDiscoveryResType(struct iso20_wpt_WPT_ChargeParameterDiscoveryResType* WPT_ChargeParameterDiscoveryResType) {
|
||||
WPT_ChargeParameterDiscoveryResType->SDManufacturerSpecificDataContainer.arrayLen = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_AlignmentCheckReqType(struct iso20_wpt_WPT_AlignmentCheckReqType* WPT_AlignmentCheckReqType) {
|
||||
WPT_AlignmentCheckReqType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_AlignmentCheckReqType->TargetCoilCurrent_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_AlignmentCheckResType(struct iso20_wpt_WPT_AlignmentCheckResType* WPT_AlignmentCheckResType) {
|
||||
WPT_AlignmentCheckResType->VendorSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_AlignmentCheckResType->PowerTransmitted_isUsed = 0u;
|
||||
WPT_AlignmentCheckResType->SupplyDeviceCurrent_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_ChargeLoopReqType(struct iso20_wpt_WPT_ChargeLoopReqType* WPT_ChargeLoopReqType) {
|
||||
WPT_ChargeLoopReqType->ManufacturerSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_ChargeLoopReqType->DisplayParameters_isUsed = 0u;
|
||||
WPT_ChargeLoopReqType->EVPCOperatingFrequency_isUsed = 0u;
|
||||
WPT_ChargeLoopReqType->EVPCPowerControlParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_WPT_ChargeLoopResType(struct iso20_wpt_WPT_ChargeLoopResType* WPT_ChargeLoopResType) {
|
||||
WPT_ChargeLoopResType->ManufacturerSpecificDataContainer.arrayLen = 0u;
|
||||
WPT_ChargeLoopResType->EVSEStatus_isUsed = 0u;
|
||||
WPT_ChargeLoopResType->MeterInfo_isUsed = 0u;
|
||||
WPT_ChargeLoopResType->Receipt_isUsed = 0u;
|
||||
WPT_ChargeLoopResType->SDPowerInput_isUsed = 0u;
|
||||
WPT_ChargeLoopResType->SPCOperatingFrequency_isUsed = 0u;
|
||||
WPT_ChargeLoopResType->SPCPowerControlParameter_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_CLReqControlModeType(struct iso20_wpt_CLReqControlModeType* CLReqControlModeType) {
|
||||
(void) CLReqControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_CLResControlModeType(struct iso20_wpt_CLResControlModeType* CLResControlModeType) {
|
||||
(void) CLResControlModeType;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_ManifestType(struct iso20_wpt_ManifestType* ManifestType) {
|
||||
ManifestType->Reference.arrayLen = 0u;
|
||||
ManifestType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
void init_iso20_wpt_SignaturePropertiesType(struct iso20_wpt_SignaturePropertiesType* SignaturePropertiesType) {
|
||||
SignaturePropertiesType->Id_isUsed = 0u;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
64
tools/EVerest-main/lib/everest/cbv2g/tests/BUILD.bazel
Normal file
64
tools/EVerest-main/lib/everest/cbv2g/tests/BUILD.bazel
Normal file
@@ -0,0 +1,64 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
|
||||
load("//third-party/bazel/toolchains:defs.bzl", "CROSS_TEST_INCOMPATIBLE")
|
||||
|
||||
cc_library(
|
||||
name = "test_utilities",
|
||||
srcs = ["test_utils/codec.cpp"],
|
||||
hdrs = ["test_utils/include/test_utils/codec.hpp"],
|
||||
includes = ["test_utils/include"],
|
||||
deps = [
|
||||
"//lib/everest/cbv2g:din",
|
||||
"//lib/everest/cbv2g:iso2",
|
||||
"//lib/everest/cbv2g:iso20",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "test_app_handshake",
|
||||
srcs = ["app_handshake/app_handshake.cpp"],
|
||||
target_compatible_with = CROSS_TEST_INCOMPATIBLE,
|
||||
deps = [
|
||||
":test_utilities",
|
||||
"@catch2//:catch2_main",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "test_session_setup",
|
||||
srcs = ["din/session_setup.cpp"],
|
||||
target_compatible_with = CROSS_TEST_INCOMPATIBLE,
|
||||
deps = [
|
||||
":test_utilities",
|
||||
"@catch2//:catch2_main",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "test_service_discovery",
|
||||
srcs = ["din/service_discovery.cpp"],
|
||||
target_compatible_with = CROSS_TEST_INCOMPATIBLE,
|
||||
deps = [
|
||||
":test_utilities",
|
||||
"@catch2//:catch2_main",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "test_ac_charge_loop",
|
||||
srcs = ["iso20/ac_charge_loop.cpp"],
|
||||
target_compatible_with = CROSS_TEST_INCOMPATIBLE,
|
||||
deps = [
|
||||
":test_utilities",
|
||||
"@catch2//:catch2_main",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "test_dc_charge_loop",
|
||||
srcs = ["iso20/dc_charge_loop.cpp"],
|
||||
target_compatible_with = CROSS_TEST_INCOMPATIBLE,
|
||||
deps = [
|
||||
":test_utilities",
|
||||
"@catch2//:catch2_main",
|
||||
],
|
||||
)
|
||||
19
tools/EVerest-main/lib/everest/cbv2g/tests/CMakeLists.txt
Normal file
19
tools/EVerest-main/lib/everest/cbv2g/tests/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.4.0 # or a later release
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)
|
||||
include(Catch)
|
||||
|
||||
# source helper functions and library
|
||||
add_subdirectory(test_utils)
|
||||
|
||||
add_subdirectory(app_handshake)
|
||||
add_subdirectory(din)
|
||||
add_subdirectory(iso20)
|
||||
@@ -0,0 +1 @@
|
||||
add_codec_test(app_handshake)
|
||||
@@ -0,0 +1,60 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <cbv2g/app_handshake/appHand_Datatypes.h>
|
||||
#include <cbv2g/app_handshake/appHand_Decoder.h>
|
||||
|
||||
#include "test_utils/codec.hpp"
|
||||
|
||||
SCENARIO("Encode and decode app protocol request messages") {
|
||||
|
||||
GIVEN("Decode an AppProtocolReq document") {
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x00, 0xf3, 0xab, 0x93, 0x71, 0xd3, 0x4b, 0x9b, 0x79, 0xd3, 0x9b, 0xa3,
|
||||
0x21, 0xd3, 0x4b, 0x9b, 0x79, 0xd1, 0x89, 0xa9, 0x89, 0x89, 0xc1, 0xd1, 0x69,
|
||||
0x91, 0x81, 0xd2, 0x0a, 0x18, 0x01, 0x00, 0x00, 0x04, 0x00, 0x40};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<appHand_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
REQUIRE(request.supportedAppProtocolReq_isUsed == 1);
|
||||
|
||||
REQUIRE(request.supportedAppProtocolReq.AppProtocol.arrayLen == 1);
|
||||
|
||||
const auto& ap = request.supportedAppProtocolReq.AppProtocol.array[0];
|
||||
|
||||
REQUIRE(ap.VersionNumberMajor == 1);
|
||||
REQUIRE(ap.VersionNumberMinor == 0);
|
||||
REQUIRE(ap.SchemaID == 1);
|
||||
REQUIRE(ap.Priority == 1);
|
||||
|
||||
const auto protocol_namespace = std::string(ap.ProtocolNamespace.characters);
|
||||
REQUIRE(protocol_namespace == "urn:iso:std:iso:15118:-20:AC");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SCENARIO("Encode and decode app protocol response messages") {
|
||||
|
||||
GIVEN("Decode an AppProtocolRes document") {
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x40, 0x00, 0x40};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<appHand_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& response = result.value;
|
||||
|
||||
REQUIRE(response.supportedAppProtocolRes_isUsed == 1);
|
||||
|
||||
REQUIRE(response.supportedAppProtocolRes.ResponseCode == appHand_responseCodeType_OK_SuccessfulNegotiation);
|
||||
REQUIRE(response.supportedAppProtocolRes.SchemaID_isUsed == true);
|
||||
REQUIRE(response.supportedAppProtocolRes.SchemaID == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
add_codec_test(session_setup)
|
||||
add_codec_test(service_discovery)
|
||||
@@ -0,0 +1,214 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <cbv2g/din/din_msgDefDecoder.h>
|
||||
#include <cbv2g/din/din_msgDefEncoder.h>
|
||||
|
||||
#include "test_utils/codec.hpp"
|
||||
|
||||
SCENARIO("Encode and decode a DIN70121 service discovery message") {
|
||||
|
||||
// Exi Stream: 809a0211d63f74d2297ac9119400
|
||||
// XML:
|
||||
// <ns7:V2G_Message>
|
||||
// <ns7:Header>
|
||||
// <ns8:SessionID>4758FDD348A5EB24</ns8:SessionID>
|
||||
// </ns7:Header>
|
||||
// <ns7:Body>
|
||||
// <ns5:ServiceDiscoveryReq>
|
||||
// <ns5:ServiceCategory>EVCharging</ns5:ServiceCategory>
|
||||
// </ns5:ServiceDiscoveryReq>
|
||||
// </ns7:Body>
|
||||
// </ns7:V2G_Message>
|
||||
|
||||
GIVEN("Good case - Encode a ServiceDiscoveryReq document") {
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x11, 0xd6, 0x3f, 0x74, 0xd2, 0x29, 0x7a, 0xc9, 0x11, 0x94, 0x00};
|
||||
|
||||
din_exiDocument request;
|
||||
init_din_exiDocument(&request);
|
||||
|
||||
init_din_MessageHeaderType(&request.V2G_Message.Header);
|
||||
|
||||
auto& header = request.V2G_Message.Header;
|
||||
header.SessionID.bytesLen = din_sessionIDType_BYTES_SIZE;
|
||||
|
||||
// copy the session id into the header
|
||||
const auto session_id = std::array<uint8_t, 8>{0x47, 0x58, 0xFD, 0xD3, 0x48, 0xA5, 0xEB, 0x24};
|
||||
std::copy(session_id.begin(), session_id.end(), header.SessionID.bytes);
|
||||
|
||||
init_din_BodyType(&request.V2G_Message.Body);
|
||||
auto& body = request.V2G_Message.Body;
|
||||
|
||||
// set the ServiceDiscoveryReqType
|
||||
init_din_ServiceDiscoveryReqType(&body.ServiceDiscoveryReq);
|
||||
body.ServiceDiscoveryReq_isUsed = true;
|
||||
|
||||
// set the service category
|
||||
body.ServiceDiscoveryReq.ServiceScope_isUsed = false;
|
||||
body.ServiceDiscoveryReq.ServiceCategory_isUsed = true;
|
||||
body.ServiceDiscoveryReq.ServiceCategory = din_serviceCategoryType_EVCharging;
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(request, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode a ServiceDiscoveryReq document") {
|
||||
|
||||
auto expected_session_id = std::vector<uint8_t>{0x47, 0x58, 0xFD, 0xD3, 0x48, 0xA5, 0xEB, 0x24};
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x11, 0xd6, 0x3f, 0x74, 0xd2, 0x29, 0x7a, 0xc9, 0x11, 0x94, 0x00};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<din_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
// Check Header
|
||||
const auto& header = request.V2G_Message.Header;
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == expected_session_id);
|
||||
REQUIRE(header.Notification_isUsed == false);
|
||||
REQUIRE(header.Signature_isUsed == false);
|
||||
|
||||
// Check Body
|
||||
const auto& body = request.V2G_Message.Body;
|
||||
REQUIRE(body.ServiceDiscoveryReq_isUsed == true);
|
||||
|
||||
const auto& serviceDiscoveryReq = body.ServiceDiscoveryReq;
|
||||
REQUIRE(serviceDiscoveryReq.ServiceScope_isUsed == false);
|
||||
REQUIRE(serviceDiscoveryReq.ServiceCategory_isUsed == true);
|
||||
}
|
||||
}
|
||||
|
||||
// EXI stream: 809a0211d63f74d2297ac911a00120024100c4
|
||||
// XML:
|
||||
// <ns7:V2G_Message>
|
||||
// <ns7:Header>
|
||||
// <ns8:SessionID>4758FDD348A5EB24</ns8:SessionID>
|
||||
// </ns7:Header>
|
||||
// <ns7:Body>
|
||||
// <ns5:ServiceDiscoveryRes>
|
||||
// <ns5:ResponseCode>OK</ns5:ResponseCode>
|
||||
// <ns5:PaymentOptions>
|
||||
// <ns6:PaymentOption>ExternalPayment</ns6:PaymentOption>
|
||||
// </ns5:PaymentOptions>
|
||||
// <ns5:ChargeService>
|
||||
// <ns6:ServiceTag>
|
||||
// <ns6:ServiceID>1</ns6:ServiceID>
|
||||
// <ns6:ServiceCategory>EVCharging</ns6:ServiceCategory>
|
||||
// </ns6:ServiceTag>
|
||||
// <ns6:FreeService>false</ns6:FreeService>
|
||||
// <ns6:EnergyTransferType>DC_extended</ns6:EnergyTransferType>
|
||||
// </ns5:ChargeService>
|
||||
// </ns5:ServiceDiscoveryRes>
|
||||
// </ns7:Body>
|
||||
// </ns7:V2G_Message>
|
||||
|
||||
GIVEN("Good case - Encode an ServiceDiscoveryRes document") {
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x11, 0xd6, 0x3f, 0x74, 0xd2, 0x29, 0x7a,
|
||||
0xc9, 0x11, 0xa0, 0x01, 0x20, 0x02, 0x41, 0x00, 0xc4};
|
||||
|
||||
din_exiDocument request;
|
||||
init_din_exiDocument(&request);
|
||||
|
||||
init_din_MessageHeaderType(&request.V2G_Message.Header);
|
||||
|
||||
auto& header = request.V2G_Message.Header;
|
||||
header.SessionID.bytesLen = din_sessionIDType_BYTES_SIZE;
|
||||
|
||||
// copy the session id into the header
|
||||
const auto session_id = std::array<uint8_t, 8>{0x47, 0x58, 0xFD, 0xD3, 0x48, 0xA5, 0xEB, 0x24};
|
||||
std::copy(session_id.begin(), session_id.end(), header.SessionID.bytes);
|
||||
|
||||
init_din_BodyType(&request.V2G_Message.Body);
|
||||
auto& body = request.V2G_Message.Body;
|
||||
|
||||
// set the ServiceDiscoveryResType
|
||||
init_din_ServiceDiscoveryResType(&body.ServiceDiscoveryRes);
|
||||
body.ServiceDiscoveryRes_isUsed = true;
|
||||
|
||||
// set the response code
|
||||
body.ServiceDiscoveryRes.ResponseCode = din_responseCodeType_OK;
|
||||
|
||||
// set the payment options
|
||||
auto& paymentOptions = body.ServiceDiscoveryRes.PaymentOptions;
|
||||
paymentOptions.PaymentOption.arrayLen = 1;
|
||||
const auto givenPaymentOptions = std::array<din_paymentOptionType, 1>{din_paymentOptionType_ExternalPayment};
|
||||
std::copy(givenPaymentOptions.begin(), givenPaymentOptions.end(), paymentOptions.PaymentOption.array);
|
||||
|
||||
// set the charge service
|
||||
auto& chargeService = body.ServiceDiscoveryRes.ChargeService;
|
||||
chargeService.ServiceTag.ServiceID = 1;
|
||||
chargeService.ServiceTag.ServiceName_isUsed = false;
|
||||
chargeService.ServiceTag.ServiceScope_isUsed = false;
|
||||
chargeService.ServiceTag.ServiceCategory = din_serviceCategoryType_EVCharging;
|
||||
chargeService.FreeService = false;
|
||||
chargeService.EnergyTransferType = din_EVSESupportedEnergyTransferType_DC_extended;
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(request, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode an ServiceDiscoveryRes document") {
|
||||
auto expected_session_id = std::vector<uint8_t>{0x47, 0x58, 0xFD, 0xD3, 0x48, 0xA5, 0xEB, 0x24};
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x11, 0xd6, 0x3f, 0x74, 0xd2, 0x29, 0x7a,
|
||||
0xc9, 0x11, 0xa0, 0x01, 0x20, 0x02, 0x41, 0x00, 0xc4};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<din_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
// Check Header
|
||||
const auto& header = request.V2G_Message.Header;
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == expected_session_id);
|
||||
REQUIRE(header.Notification_isUsed == false);
|
||||
REQUIRE(header.Signature_isUsed == false);
|
||||
|
||||
// Check Body
|
||||
const auto& body = request.V2G_Message.Body;
|
||||
REQUIRE(body.ServiceDiscoveryRes_isUsed == true);
|
||||
|
||||
const auto& serviceDiscoveryRes = body.ServiceDiscoveryRes;
|
||||
|
||||
// check the response code
|
||||
REQUIRE(serviceDiscoveryRes.ResponseCode == din_responseCodeType_OK);
|
||||
|
||||
// check the payment options
|
||||
const auto expectedPaymentOptions =
|
||||
std::vector<din_paymentOptionType>{din_paymentOptionType_ExternalPayment};
|
||||
REQUIRE(serviceDiscoveryRes.PaymentOptions.PaymentOption.arrayLen == 1);
|
||||
const auto& paymentOptionsArray = serviceDiscoveryRes.PaymentOptions.PaymentOption.array;
|
||||
REQUIRE(paymentOptionsArray[0] == expectedPaymentOptions.at(0));
|
||||
|
||||
// check the charge service
|
||||
const auto& chargeService = body.ServiceDiscoveryRes.ChargeService;
|
||||
|
||||
// service tag
|
||||
REQUIRE(chargeService.ServiceTag.ServiceID == 1);
|
||||
REQUIRE(chargeService.ServiceTag.ServiceName_isUsed == false);
|
||||
REQUIRE(chargeService.ServiceTag.ServiceScope_isUsed == false);
|
||||
REQUIRE(chargeService.ServiceTag.ServiceCategory == din_serviceCategoryType_EVCharging);
|
||||
REQUIRE(chargeService.FreeService == false);
|
||||
REQUIRE(chargeService.EnergyTransferType == din_EVSESupportedEnergyTransferType_DC_extended);
|
||||
}
|
||||
}
|
||||
}
|
||||
186
tools/EVerest-main/lib/everest/cbv2g/tests/din/session_setup.cpp
Normal file
186
tools/EVerest-main/lib/everest/cbv2g/tests/din/session_setup.cpp
Normal file
@@ -0,0 +1,186 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <cbv2g/din/din_msgDefDecoder.h>
|
||||
#include <cbv2g/din/din_msgDefEncoder.h>
|
||||
|
||||
#include "test_utils/codec.hpp"
|
||||
|
||||
SCENARIO("Encode and decode DIN70121 session setup message") {
|
||||
|
||||
// Exi Stream: 809a02000000000000000011d01a121dc983cd6000
|
||||
// XML:
|
||||
// <ns7:V2G_Message>
|
||||
// <ns7:Header>
|
||||
// <ns8:SessionID>0000000000000000</ns8:SessionID>
|
||||
// </ns7:Header>
|
||||
// <ns7:Body>
|
||||
// <ns5:SessionSetupReq>
|
||||
// <ns5:EVCCID>84877260F358</ns5:EVCCID>
|
||||
// </ns5:SessionSetupReq>
|
||||
// </ns7:Body>
|
||||
// </ns7:V2G_Message>
|
||||
|
||||
GIVEN("Good case - Encode an SessionSetupReq document") {
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x11, 0xd0, 0x1a, 0x12, 0x1d, 0xc9, 0x83, 0xcd, 0x60, 0x00};
|
||||
|
||||
din_exiDocument request;
|
||||
init_din_exiDocument(&request);
|
||||
|
||||
init_din_MessageHeaderType(&request.V2G_Message.Header);
|
||||
|
||||
auto& header = request.V2G_Message.Header;
|
||||
header.SessionID.bytesLen = din_sessionIDType_BYTES_SIZE;
|
||||
const auto session_id = std::vector<uint8_t>(8, 0);
|
||||
std::copy(session_id.begin(), session_id.end(), header.SessionID.bytes);
|
||||
|
||||
init_din_BodyType(&request.V2G_Message.Body);
|
||||
auto& body = request.V2G_Message.Body;
|
||||
init_din_SessionSetupReqType(&body.SessionSetupReq);
|
||||
body.SessionSetupReq_isUsed = true;
|
||||
const auto evccid = std::array<uint8_t, 8>{0x84, 0x87, 0x72, 0x60, 0xF3, 0x58, 0x00, 0x00};
|
||||
std::copy(evccid.begin(), evccid.end(), body.SessionSetupReq.EVCCID.bytes);
|
||||
body.SessionSetupReq.EVCCID.bytesLen = 6;
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(request, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode an SessionSetupReq document") {
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x11, 0xd0, 0x1a, 0x12, 0x1d, 0xc9, 0x83, 0xcd, 0x60, 0x00};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<din_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
// Check Header
|
||||
auto& header = request.V2G_Message.Header;
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == std::vector<uint8_t>({0, 0, 0, 0, 0, 0, 0, 0}));
|
||||
REQUIRE(header.Notification_isUsed == false);
|
||||
REQUIRE(header.Signature_isUsed == false);
|
||||
|
||||
// Check Body
|
||||
REQUIRE(request.V2G_Message.Body.SessionSetupReq_isUsed == true);
|
||||
|
||||
auto& session_setup_req = request.V2G_Message.Body.SessionSetupReq;
|
||||
|
||||
const auto evccid = std::vector<uint8_t>(std::begin(session_setup_req.EVCCID.bytes),
|
||||
std::end(session_setup_req.EVCCID.bytes));
|
||||
REQUIRE(evccid == std::vector<uint8_t>({0x84, 0x87, 0x72, 0x60, 0xF3, 0x58, 0x00, 0x00}));
|
||||
|
||||
REQUIRE(session_setup_req.EVCCID.bytesLen == 6);
|
||||
}
|
||||
}
|
||||
|
||||
// EXI stream: 809a0211d63f74d2297ac911e0201526a2698d8017da353360c0
|
||||
// XML:
|
||||
// <ns7:V2G_Message>
|
||||
// <ns7:Header>
|
||||
// <ns8:SessionID>4758FDD348A5EB24</ns8:SessionID>
|
||||
// </ns7:Header>
|
||||
// <ns7:Body>
|
||||
// <ns5:SessionSetupRes>
|
||||
// <ns5:ResponseCode>OK_NewSessionEstablished</ns5:ResponseCode>
|
||||
// <ns5:EVSEID>49A89A6360</ns5:EVSEID>
|
||||
// <ns5:DateTimeNow>1667918014</ns5:EVSETimeStamp>
|
||||
// </ns5:SessionSetupRes>
|
||||
// </ns7:Body>
|
||||
// </ns7:V2G_Message>
|
||||
|
||||
GIVEN("Good case - Encode an SessionSetupRes document") {
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x11, 0xd6, 0x3f, 0x74, 0xd2, 0x29, 0x7a, 0xc9, 0x11, 0xe0,
|
||||
0x20, 0x15, 0x26, 0xa2, 0x69, 0x8d, 0x80, 0x17, 0xda, 0x35, 0x33, 0x60, 0xc0};
|
||||
|
||||
din_exiDocument request;
|
||||
init_din_exiDocument(&request);
|
||||
|
||||
init_din_MessageHeaderType(&request.V2G_Message.Header);
|
||||
|
||||
auto& header = request.V2G_Message.Header;
|
||||
header.SessionID.bytesLen = din_sessionIDType_BYTES_SIZE;
|
||||
const auto session_id = std::array<uint8_t, 8>{0x47, 0x58, 0xFD, 0xD3, 0x48, 0xA5, 0xEB, 0x24};
|
||||
std::copy(session_id.begin(), session_id.end(), header.SessionID.bytes);
|
||||
|
||||
init_din_BodyType(&request.V2G_Message.Body);
|
||||
auto& body = request.V2G_Message.Body;
|
||||
init_din_SessionSetupResType(&body.SessionSetupRes);
|
||||
body.SessionSetupRes_isUsed = true;
|
||||
|
||||
// set the response code
|
||||
body.SessionSetupRes.ResponseCode = din_responseCodeType_OK_NewSessionEstablished;
|
||||
|
||||
// set the EVSE ID
|
||||
const auto evse_id = std::array<uint8_t, 5>{0x49, 0xA8, 0x9A, 0x63, 0x60};
|
||||
std::copy(evse_id.begin(), evse_id.end(), body.SessionSetupRes.EVSEID.bytes);
|
||||
body.SessionSetupRes.EVSEID.bytesLen = evse_id.size();
|
||||
|
||||
// set the EVSE timestamp
|
||||
body.SessionSetupRes.DateTimeNow_isUsed = true;
|
||||
body.SessionSetupRes.DateTimeNow = 1667918014;
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(request, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode an SessionSetupRes document") {
|
||||
|
||||
const auto expected_session_id = std::vector<uint8_t>{0x47, 0x58, 0xFD, 0xD3, 0x48, 0xA5, 0xEB, 0x24};
|
||||
uint8_t doc_raw[] = {0x80, 0x9a, 0x02, 0x11, 0xd6, 0x3f, 0x74, 0xd2, 0x29, 0x7a, 0xc9, 0x11, 0xe0,
|
||||
0x20, 0x15, 0x26, 0xa2, 0x69, 0x8d, 0x80, 0x17, 0xda, 0x35, 0x33, 0x60, 0xc0};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<din_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
// Check Header
|
||||
auto& header = request.V2G_Message.Header;
|
||||
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == expected_session_id);
|
||||
REQUIRE(header.Notification_isUsed == false);
|
||||
REQUIRE(header.Signature_isUsed == false);
|
||||
|
||||
// Check Body
|
||||
REQUIRE(request.V2G_Message.Body.SessionSetupRes_isUsed == true);
|
||||
const auto& session_setup_res = request.V2G_Message.Body.SessionSetupRes;
|
||||
|
||||
// check the response code
|
||||
REQUIRE(session_setup_res.ResponseCode == din_responseCodeType_OK_NewSessionEstablished);
|
||||
|
||||
// check the EVSE ID
|
||||
REQUIRE(session_setup_res.EVSEID.bytesLen == 5);
|
||||
const auto evse_id =
|
||||
std::vector<uint8_t>(std::begin(session_setup_res.EVSEID.bytes),
|
||||
std::begin(session_setup_res.EVSEID.bytes) + session_setup_res.EVSEID.bytesLen);
|
||||
REQUIRE(evse_id == std::vector<uint8_t>({0x49, 0xA8, 0x9A, 0x63, 0x60}));
|
||||
|
||||
// check the EVSE timestamp
|
||||
REQUIRE(session_setup_res.DateTimeNow_isUsed == true);
|
||||
REQUIRE(session_setup_res.DateTimeNow == 1667918014);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
add_codec_test(ac_charge_loop)
|
||||
add_codec_test(dc_charge_loop)
|
||||
@@ -0,0 +1,167 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include <cbv2g/iso_20/iso20_AC_Decoder.h>
|
||||
#include <cbv2g/iso_20/iso20_AC_Encoder.h>
|
||||
|
||||
#include "test_utils/codec.hpp"
|
||||
|
||||
// Exi Stream: 8008041e9869d6a61dc1ef895b9b4a8062832418640096
|
||||
// XML:
|
||||
// <AC_ChargeLoopReq>
|
||||
// <Header>
|
||||
// <SessionID>3D30D3AD4C3B83DF</SessionID>
|
||||
// <TimeStamp>1695358101</TimeStamp>
|
||||
// </Header>
|
||||
// <MeterInfoRequested>false</MeterInfoRequested>
|
||||
// <BPT_Scheduled_AC_CLReqControlMode>
|
||||
// <EVPresentActivePower>
|
||||
// <Exponent>3</Exponent>
|
||||
// <Value>200</Value>
|
||||
// </EVPresentActivePower>
|
||||
// </BPT_Scheduled_AC_CLReqControlMode>
|
||||
// </AC_ChargeLoopReq>
|
||||
|
||||
// Exi Stream: 800c041e9869d6a61dc1ef895b9b4a8062005900
|
||||
// XML:
|
||||
// <AC_ChargeLoopRes>
|
||||
// <Header>
|
||||
// <SessionID>3D30D3AD4C3B83DF</SessionID>
|
||||
// <TimeStamp>1695358101</TimeStamp>
|
||||
// </Header>
|
||||
// <ResponseCode>OK</ResponseCode>
|
||||
// <BPT_Scheduled_AC_CLResControlMode/>
|
||||
// </AC_ChargeLoopRes>
|
||||
|
||||
static void setup_header(struct iso20_ac_MessageHeaderType* header,
|
||||
const std::array<uint8_t, iso20_ac_sessionIDType_BYTES_SIZE>& session_id, uint64_t timestamp) {
|
||||
init_iso20_ac_MessageHeaderType(header);
|
||||
header->SessionID.bytesLen = iso20_ac_sessionIDType_BYTES_SIZE;
|
||||
std::copy(session_id.begin(), session_id.end(), header->SessionID.bytes);
|
||||
header->TimeStamp = timestamp;
|
||||
}
|
||||
|
||||
SCENARIO("Encode and decode ISO15118-20 AC charge loop message") {
|
||||
|
||||
GIVEN("Good case - Encode correct bpt control (AcChargeLoopReq)") {
|
||||
uint8_t doc_raw[] = {0x80, 0x08, 0x04, 0x1e, 0x98, 0x69, 0xd6, 0xa6, 0x1d, 0xc1, 0xef, 0x89,
|
||||
0x5b, 0x9b, 0x4a, 0x80, 0x62, 0x83, 0x24, 0x18, 0x64, 0x00, 0x96};
|
||||
|
||||
iso20_ac_exiDocument request;
|
||||
init_iso20_ac_exiDocument(&request);
|
||||
|
||||
request.AC_ChargeLoopReq_isUsed = true;
|
||||
init_iso20_ac_AC_ChargeLoopReqType(&request.AC_ChargeLoopReq);
|
||||
|
||||
const auto session_id =
|
||||
std::array<uint8_t, iso20_ac_sessionIDType_BYTES_SIZE>{0x3D, 0x30, 0xD3, 0xAD, 0x4C, 0x3B, 0x83, 0xDF};
|
||||
const uint64_t timestamp = 1695358101;
|
||||
setup_header(&request.AC_ChargeLoopReq.Header, session_id, timestamp);
|
||||
|
||||
auto& charge_loop = request.AC_ChargeLoopReq;
|
||||
|
||||
charge_loop.MeterInfoRequested = false;
|
||||
|
||||
charge_loop.BPT_Scheduled_AC_CLReqControlMode_isUsed = true;
|
||||
init_iso20_ac_BPT_Scheduled_AC_CLReqControlModeType(&charge_loop.BPT_Scheduled_AC_CLReqControlMode);
|
||||
charge_loop.BPT_Scheduled_AC_CLReqControlMode.EVPresentActivePower = {3, 200};
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(request, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Encode correct bpt control (AcChargeLoopRes)") {
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x0c, 0x04, 0x1e, 0x98, 0x69, 0xd6, 0xa6, 0x1d, 0xc1,
|
||||
0xef, 0x89, 0x5b, 0x9b, 0x4a, 0x80, 0x62, 0x00, 0x59, 0x00};
|
||||
|
||||
iso20_ac_exiDocument response;
|
||||
init_iso20_ac_exiDocument(&response);
|
||||
|
||||
response.AC_ChargeLoopRes_isUsed = true;
|
||||
init_iso20_ac_AC_ChargeLoopResType(&response.AC_ChargeLoopRes);
|
||||
|
||||
const auto session_id =
|
||||
std::array<uint8_t, iso20_ac_sessionIDType_BYTES_SIZE>{0x3D, 0x30, 0xD3, 0xAD, 0x4C, 0x3B, 0x83, 0xDF};
|
||||
const uint64_t timestamp = 1695358101;
|
||||
setup_header(&response.AC_ChargeLoopRes.Header, session_id, timestamp);
|
||||
|
||||
auto& charge_loop = response.AC_ChargeLoopRes;
|
||||
charge_loop.ResponseCode = iso20_ac_responseCodeType_OK;
|
||||
charge_loop.BPT_Scheduled_AC_CLResControlMode_isUsed = true;
|
||||
charge_loop.BPT_Scheduled_AC_CLResControlMode = {};
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(response, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode correct bpt control (AcChargeLoopReq)") {
|
||||
const auto expected_session_id = std::vector<uint8_t>{0x3D, 0x30, 0xD3, 0xAD, 0x4C, 0x3B, 0x83, 0xDF};
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x08, 0x04, 0x1e, 0x98, 0x69, 0xd6, 0xa6, 0x1d, 0xc1, 0xef, 0x89,
|
||||
0x5b, 0x9b, 0x4a, 0x80, 0x62, 0x83, 0x24, 0x18, 0x64, 0x00, 0x96};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<iso20_ac_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
REQUIRE(request.AC_ChargeLoopReq_isUsed == true);
|
||||
// Check Header
|
||||
const auto& header = request.AC_ChargeLoopReq.Header;
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == expected_session_id);
|
||||
|
||||
REQUIRE(header.TimeStamp == 1695358101);
|
||||
|
||||
// Check Body
|
||||
const auto& charge_loop = request.AC_ChargeLoopReq;
|
||||
REQUIRE(charge_loop.MeterInfoRequested == false);
|
||||
|
||||
REQUIRE(charge_loop.BPT_Scheduled_AC_CLReqControlMode_isUsed == true);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_AC_CLReqControlMode.EVPresentActivePower.Exponent == 3);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_AC_CLReqControlMode.EVPresentActivePower.Value == 200);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode correct bpt control (AcChargeLoopRes)") {
|
||||
|
||||
const auto expected_session_id = std::vector<uint8_t>{0x3D, 0x30, 0xD3, 0xAD, 0x4C, 0x3B, 0x83, 0xDF};
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x0c, 0x04, 0x1e, 0x98, 0x69, 0xd6, 0xa6, 0x1d, 0xc1,
|
||||
0xef, 0x89, 0x5b, 0x9b, 0x4a, 0x80, 0x62, 0x00, 0x59, 0x00};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<iso20_ac_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
REQUIRE(request.AC_ChargeLoopRes_isUsed == true);
|
||||
// Check Header
|
||||
const auto& header = request.AC_ChargeLoopRes.Header;
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == expected_session_id);
|
||||
|
||||
REQUIRE(header.TimeStamp == 1695358101);
|
||||
|
||||
// Check Body
|
||||
const auto& charge_loop = request.AC_ChargeLoopRes;
|
||||
REQUIRE(charge_loop.ResponseCode == iso20_ac_responseCodeType_OK);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_AC_CLResControlMode_isUsed == true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include <cbv2g/iso_20/iso20_DC_Decoder.h>
|
||||
#include <cbv2g/iso_20/iso20_DC_Encoder.h>
|
||||
|
||||
#include "test_utils/codec.hpp"
|
||||
|
||||
// Exi Stream: 8034042d166f29fb80ea560aebdbfb3062810012006164000a02002400c800
|
||||
// XML:
|
||||
// <DC_ChargeLoopReq>
|
||||
// <Header>
|
||||
// <SessionID>5A2CDE53F701D4AC</SessionID>
|
||||
// <TimeStamp>1718607534</TimeStamp>
|
||||
// </Header>
|
||||
// <MeterInfoRequested>false</MeterInfoRequested>
|
||||
// <EVPresentVoltage>
|
||||
// <Exponent>0</Exponent>
|
||||
// <Value>400</Value>
|
||||
// </EVPresentVoltage>
|
||||
// <BPT_Scheduled_DC_CLReqControlMode>
|
||||
// <EVTargetCurrent>
|
||||
// <Exponent>0</Exponent>
|
||||
// <Value>20</Value>
|
||||
// </EVTargetCurrent>
|
||||
// <EVTargetVoltage>
|
||||
// <Exponent>0</Exponent>
|
||||
// <Value>400</Value>
|
||||
// </EVTargetVoltage>
|
||||
// </BPT_Scheduled_DC_CLReqControlMode>
|
||||
// </DC_ChargeLoopReq>
|
||||
|
||||
// Exi Stream: 8038042d166f29fb80ea560b7bdbfb30620063f0680781fc2807c22230
|
||||
// XML:
|
||||
// <DC_ChargeLoopRes>
|
||||
// <Header>
|
||||
// <SessionID>5A2CDE53F701D4AC</SessionID>
|
||||
// <TimeStamp>1718607543</TimeStamp>
|
||||
// </Header>
|
||||
// <ResponseCode>OK</ ResponseCode>
|
||||
// <EVSEPresentCurrent>
|
||||
// <Exponent>-2</Exponent>
|
||||
// <Value>2000</Value>
|
||||
// </EVSEPresentCurrent>
|
||||
// <EVSEPresentVoltage>
|
||||
// <Exponent>-1</Exponent >
|
||||
// <Value>4000</Value >
|
||||
// </EVSEPresentVoltage>
|
||||
// <EVSEPowerLimitAchieved>true</EVSEPowerLimitAchieved>
|
||||
// <EVSECurrentLimitAchieved>true</EVSECurrentLimitAchieved>
|
||||
// <EVSEVoltageLimitAchieved>true</EVSEVoltageLimitAchieved>
|
||||
// <BPT_Scheduled_DC_CLResControlMode/>
|
||||
// </ DC_ChargeLoopRes>
|
||||
|
||||
static void setup_header(struct iso20_dc_MessageHeaderType* header,
|
||||
const std::array<uint8_t, iso20_dc_sessionIDType_BYTES_SIZE>& session_id, uint64_t timestamp) {
|
||||
init_iso20_dc_MessageHeaderType(header);
|
||||
header->SessionID.bytesLen = iso20_dc_sessionIDType_BYTES_SIZE;
|
||||
std::copy(session_id.begin(), session_id.end(), header->SessionID.bytes);
|
||||
header->TimeStamp = timestamp;
|
||||
}
|
||||
|
||||
SCENARIO("Encode and decode ISO15118-20 DC charge loop message") {
|
||||
|
||||
GIVEN("Good case - Encode correct bpt control (DcChargeLoopReq)") {
|
||||
uint8_t doc_raw[] = {0x80, 0x34, 0x04, 0x2d, 0x16, 0x6f, 0x29, 0xfb, 0x80, 0xea, 0x56,
|
||||
0x0a, 0xeb, 0xdb, 0xfb, 0x30, 0x62, 0x81, 0x00, 0x12, 0x00, 0x61,
|
||||
0x64, 0x00, 0x0a, 0x02, 0x00, 0x24, 0x00, 0xc8, 0x00};
|
||||
|
||||
iso20_dc_exiDocument request;
|
||||
init_iso20_dc_exiDocument(&request);
|
||||
|
||||
request.DC_ChargeLoopReq_isUsed = true;
|
||||
init_iso20_dc_DC_ChargeLoopReqType(&request.DC_ChargeLoopReq);
|
||||
|
||||
const auto session_id =
|
||||
std::array<uint8_t, iso20_dc_sessionIDType_BYTES_SIZE>{0x5A, 0x2C, 0xDE, 0x53, 0xF7, 0x01, 0xD4, 0xAC};
|
||||
uint64_t timestamp = 1718607534;
|
||||
setup_header(&request.DC_ChargeLoopReq.Header, session_id, timestamp);
|
||||
|
||||
auto& charge_loop = request.DC_ChargeLoopReq;
|
||||
|
||||
charge_loop.MeterInfoRequested = false;
|
||||
charge_loop.EVPresentVoltage = {0, 400};
|
||||
|
||||
charge_loop.BPT_Scheduled_DC_CLReqControlMode_isUsed = true;
|
||||
init_iso20_dc_BPT_Scheduled_DC_CLReqControlModeType(&charge_loop.BPT_Scheduled_DC_CLReqControlMode);
|
||||
charge_loop.BPT_Scheduled_DC_CLReqControlMode.EVTargetCurrent = {0, 20};
|
||||
charge_loop.BPT_Scheduled_DC_CLReqControlMode.EVTargetVoltage = {0, 400};
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(request, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Encode correct bpt control (DcChargeLoopRes)") {
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x38, 0x04, 0x2d, 0x16, 0x6f, 0x29, 0xfb, 0x80, 0xea, 0x56, 0x0b, 0x7b, 0xdb, 0xfb,
|
||||
0x30, 0x62, 0x00, 0x63, 0xf0, 0x68, 0x07, 0x81, 0xfc, 0x28, 0x07, 0xc2, 0x22, 0x30};
|
||||
|
||||
iso20_dc_exiDocument response;
|
||||
init_iso20_dc_exiDocument(&response);
|
||||
|
||||
response.DC_ChargeLoopRes_isUsed = true;
|
||||
init_iso20_dc_DC_ChargeLoopResType(&response.DC_ChargeLoopRes);
|
||||
|
||||
const auto session_id =
|
||||
std::array<uint8_t, iso20_dc_sessionIDType_BYTES_SIZE>{0x5A, 0x2C, 0xDE, 0x53, 0xF7, 0x01, 0xD4, 0xAC};
|
||||
uint64_t timestamp = 1718607543;
|
||||
setup_header(&response.DC_ChargeLoopReq.Header, session_id, timestamp);
|
||||
|
||||
auto& charge_loop = response.DC_ChargeLoopRes;
|
||||
|
||||
charge_loop.ResponseCode = iso20_dc_responseCodeType_OK;
|
||||
charge_loop.EVSEPresentCurrent = {-2, 2000};
|
||||
charge_loop.EVSEPresentVoltage = {-1, 4000};
|
||||
charge_loop.EVSEPowerLimitAchieved = true;
|
||||
charge_loop.EVSECurrentLimitAchieved = true;
|
||||
charge_loop.EVSEVoltageLimitAchieved = true;
|
||||
|
||||
charge_loop.BPT_Scheduled_DC_CLResControlMode_isUsed = true;
|
||||
charge_loop.BPT_Scheduled_DC_CLResControlMode = {};
|
||||
|
||||
THEN("It should be encoded succussfully") {
|
||||
const auto result = test_utils::encode_and_compare(response, doc_raw, sizeof(doc_raw));
|
||||
|
||||
REQUIRE(result.encoding_successful);
|
||||
REQUIRE(result.bitstream_match);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode correct bpt control (DcChargeLoopReq)") {
|
||||
const auto expected_session_id = std::vector<uint8_t>{0x5A, 0x2C, 0xDE, 0x53, 0xF7, 0x01, 0xD4, 0xAC};
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x34, 0x04, 0x2d, 0x16, 0x6f, 0x29, 0xfb, 0x80, 0xea, 0x56,
|
||||
0x0a, 0xeb, 0xdb, 0xfb, 0x30, 0x62, 0x81, 0x00, 0x12, 0x00, 0x61,
|
||||
0x64, 0x00, 0x0a, 0x02, 0x00, 0x24, 0x00, 0xc8, 0x00};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<iso20_dc_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
REQUIRE(request.DC_ChargeLoopReq_isUsed == true);
|
||||
// Check Header
|
||||
const auto& header = request.DC_ChargeLoopReq.Header;
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == expected_session_id);
|
||||
|
||||
REQUIRE(header.TimeStamp == 1718607534);
|
||||
|
||||
// Check Body
|
||||
const auto& charge_loop = request.DC_ChargeLoopReq;
|
||||
REQUIRE(charge_loop.MeterInfoRequested == false);
|
||||
REQUIRE(charge_loop.EVPresentVoltage.Exponent == 0);
|
||||
REQUIRE(charge_loop.EVPresentVoltage.Value == 400);
|
||||
|
||||
REQUIRE(charge_loop.BPT_Scheduled_DC_CLReqControlMode_isUsed == true);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_DC_CLReqControlMode.EVTargetCurrent.Exponent == 0);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_DC_CLReqControlMode.EVTargetCurrent.Value == 20);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_DC_CLReqControlMode.EVTargetVoltage.Exponent == 0);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_DC_CLReqControlMode.EVTargetVoltage.Value == 400);
|
||||
}
|
||||
}
|
||||
|
||||
GIVEN("Good case - Decode correct bpt control (DcChargeLoopRes)") {
|
||||
|
||||
const auto expected_session_id = std::vector<uint8_t>{0x5A, 0x2C, 0xDE, 0x53, 0xF7, 0x01, 0xD4, 0xAC};
|
||||
|
||||
uint8_t doc_raw[] = {0x80, 0x38, 0x04, 0x2d, 0x16, 0x6f, 0x29, 0xfb, 0x80, 0xea, 0x56, 0x0b, 0x7b, 0xdb, 0xfb,
|
||||
0x30, 0x62, 0x00, 0x63, 0xf0, 0x68, 0x07, 0x81, 0xfc, 0x28, 0x07, 0xc2, 0x22, 0x30};
|
||||
|
||||
THEN("It should be decoded succussfully") {
|
||||
const auto result = test_utils::decode<iso20_dc_exiDocument>(doc_raw, sizeof(doc_raw));
|
||||
REQUIRE(result.decoding_successful);
|
||||
|
||||
const auto& request = result.value;
|
||||
|
||||
REQUIRE(request.DC_ChargeLoopRes_isUsed == true);
|
||||
// Check Header
|
||||
const auto& header = request.DC_ChargeLoopRes.Header;
|
||||
const auto session_id =
|
||||
std::vector<uint8_t>(std::begin(header.SessionID.bytes), std::end(header.SessionID.bytes));
|
||||
REQUIRE(session_id == expected_session_id);
|
||||
|
||||
REQUIRE(header.TimeStamp == 1718607543);
|
||||
|
||||
// Check Body
|
||||
const auto& charge_loop = request.DC_ChargeLoopRes;
|
||||
REQUIRE(charge_loop.ResponseCode == iso20_dc_responseCodeType_OK);
|
||||
REQUIRE(charge_loop.EVSEPresentCurrent.Exponent == -2);
|
||||
REQUIRE(charge_loop.EVSEPresentCurrent.Value == 2000);
|
||||
REQUIRE(charge_loop.EVSEPresentVoltage.Exponent == -1);
|
||||
REQUIRE(charge_loop.EVSEPresentVoltage.Value == 4000);
|
||||
REQUIRE(charge_loop.EVSEPowerLimitAchieved == true);
|
||||
REQUIRE(charge_loop.EVSECurrentLimitAchieved == true);
|
||||
REQUIRE(charge_loop.EVSEVoltageLimitAchieved == true);
|
||||
REQUIRE(charge_loop.BPT_Scheduled_DC_CLResControlMode_isUsed == true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
add_library(test_utilities OBJECT codec.cpp)
|
||||
target_link_libraries(test_utilities
|
||||
PUBLIC
|
||||
cbv2g::din
|
||||
cbv2g::iso2
|
||||
cbv2g::iso20
|
||||
)
|
||||
|
||||
target_include_directories(test_utilities
|
||||
PUBLIC
|
||||
include
|
||||
)
|
||||
|
||||
function(add_codec_test CPP_FILE)
|
||||
set(TEST_TARGET_NAME test_${CPP_FILE})
|
||||
add_executable(${TEST_TARGET_NAME} ${CPP_FILE}.cpp)
|
||||
|
||||
target_link_libraries(${TEST_TARGET_NAME}
|
||||
PRIVATE
|
||||
test_utilities
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
|
||||
catch_discover_tests(${TEST_TARGET_NAME})
|
||||
endfunction()
|
||||
102
tools/EVerest-main/lib/everest/cbv2g/tests/test_utils/codec.cpp
Normal file
102
tools/EVerest-main/lib/everest/cbv2g/tests/test_utils/codec.cpp
Normal file
@@ -0,0 +1,102 @@
|
||||
#include "test_utils/codec.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <cbv2g/app_handshake/appHand_Decoder.h>
|
||||
#include <cbv2g/app_handshake/appHand_Encoder.h>
|
||||
|
||||
#include <cbv2g/din/din_msgDefDecoder.h>
|
||||
#include <cbv2g/din/din_msgDefEncoder.h>
|
||||
|
||||
#include <cbv2g/iso_20/iso20_AC_Decoder.h>
|
||||
#include <cbv2g/iso_20/iso20_AC_Encoder.h>
|
||||
#include <cbv2g/iso_20/iso20_DC_Decoder.h>
|
||||
#include <cbv2g/iso_20/iso20_DC_Encoder.h>
|
||||
|
||||
namespace test_utils {
|
||||
|
||||
template <typename DocType>
|
||||
static EncodingResult encode(int (*encode_func)(exi_bitstream_t*, DocType*), const DocType& request,
|
||||
const uint8_t* compare_data, std::size_t length) {
|
||||
// FIXME (aw): what general size to take here?
|
||||
uint8_t stream[256] = {};
|
||||
exi_bitstream_t exi_stream_in;
|
||||
size_t pos1 = 0;
|
||||
|
||||
exi_bitstream_init(&exi_stream_in, stream, sizeof(stream), pos1, nullptr);
|
||||
|
||||
if (0 != encode_func(&exi_stream_in, const_cast<DocType*>(&request))) {
|
||||
return {false, false};
|
||||
}
|
||||
|
||||
const auto encoded_stream = std::vector<uint8_t>(stream, stream + exi_bitstream_get_length(&exi_stream_in));
|
||||
|
||||
const auto expected_exi_stream = std::vector<uint8_t>(compare_data, compare_data + length);
|
||||
|
||||
return {true, encoded_stream == expected_exi_stream};
|
||||
}
|
||||
|
||||
template <typename DocType>
|
||||
DecodingResult<DocType> decode(int (*decode_func)(exi_bitstream_t*, DocType*), const uint8_t* raw_data,
|
||||
std::size_t length) {
|
||||
exi_bitstream_t exi_stream_in;
|
||||
size_t pos1 = 0;
|
||||
|
||||
exi_bitstream_init(&exi_stream_in, const_cast<uint8_t*>(raw_data), length, pos1, nullptr);
|
||||
|
||||
DecodingResult<DocType> result;
|
||||
result.decoding_successful = (decode_func(&exi_stream_in, &result.value) == 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// app handshake
|
||||
//
|
||||
template <>
|
||||
EncodingResult encode_and_compare(const appHand_exiDocument& request, const uint8_t* compare_data, std::size_t length) {
|
||||
return encode(&encode_appHand_exiDocument, request, compare_data, length);
|
||||
}
|
||||
|
||||
template <> DecodingResult<appHand_exiDocument> decode(const uint8_t* raw_data, std::size_t length) {
|
||||
return decode(&decode_appHand_exiDocument, raw_data, length);
|
||||
}
|
||||
|
||||
//
|
||||
// din
|
||||
//
|
||||
template <>
|
||||
EncodingResult encode_and_compare(const din_exiDocument& request, const uint8_t* compare_data, std::size_t length) {
|
||||
return encode(&encode_din_exiDocument, request, compare_data, length);
|
||||
}
|
||||
|
||||
template <> DecodingResult<din_exiDocument> decode(const uint8_t* raw_data, std::size_t length) {
|
||||
return decode(&decode_din_exiDocument, raw_data, length);
|
||||
}
|
||||
|
||||
//
|
||||
// iso20 ac
|
||||
//
|
||||
template <>
|
||||
EncodingResult encode_and_compare(const iso20_ac_exiDocument& request, const uint8_t* compare_data,
|
||||
std::size_t length) {
|
||||
return encode(&encode_iso20_ac_exiDocument, request, compare_data, length);
|
||||
}
|
||||
|
||||
template <> DecodingResult<iso20_ac_exiDocument> decode(const uint8_t* raw_data, std::size_t length) {
|
||||
return decode(&decode_iso20_ac_exiDocument, raw_data, length);
|
||||
}
|
||||
|
||||
//
|
||||
// iso20 dc
|
||||
//
|
||||
template <>
|
||||
EncodingResult encode_and_compare(const iso20_dc_exiDocument& request, const uint8_t* compare_data,
|
||||
std::size_t length) {
|
||||
return encode(&encode_iso20_dc_exiDocument, request, compare_data, length);
|
||||
}
|
||||
|
||||
template <> DecodingResult<iso20_dc_exiDocument> decode(const uint8_t* raw_data, std::size_t length) {
|
||||
return decode(&decode_iso20_dc_exiDocument, raw_data, length);
|
||||
}
|
||||
|
||||
} // namespace test_utils
|
||||
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace test_utils {
|
||||
|
||||
struct EncodingResult {
|
||||
bool encoding_successful;
|
||||
bool bitstream_match;
|
||||
};
|
||||
|
||||
template <typename DocType>
|
||||
EncodingResult encode_and_compare(const DocType&, const uint8_t* compare_data, std::size_t length);
|
||||
|
||||
template <typename DocType> struct DecodingResult {
|
||||
bool decoding_successful;
|
||||
DocType value;
|
||||
};
|
||||
|
||||
template <typename DocType> DecodingResult<DocType> decode(const uint8_t* raw_data, std::size_t length);
|
||||
|
||||
} // namespace test_utils
|
||||
@@ -0,0 +1,6 @@
|
||||
if(EVEREST_DEPENDENCY_ENABLED_LIBEVSE_SECURITY)
|
||||
add_subdirectory(evse_security)
|
||||
endif()
|
||||
if(EVEREST_DEPENDENCY_ENABLED_LIBOCPP)
|
||||
add_subdirectory(ocpp)
|
||||
endif()
|
||||
@@ -0,0 +1,24 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "evse_security_conversions",
|
||||
srcs = [
|
||||
"src/conversions.cpp",
|
||||
],
|
||||
hdrs = [
|
||||
"include/everest/conversions/evse_security/conversions.hpp",
|
||||
],
|
||||
copts = [
|
||||
"-std=c++17",
|
||||
"-Wimplicit-fallthrough",
|
||||
"-Wno-error=switch-enum", # boost.date_time 1.87.0 has incomplete switch statements
|
||||
],
|
||||
includes = ["include"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//lib/everest/framework:framework",
|
||||
"//lib/everest/evse_security:libevse-security",
|
||||
"//interfaces:interfaces_lib",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
add_library(evse_security_conversions STATIC)
|
||||
add_library(everest::evse_security_conversions ALIAS evse_security_conversions)
|
||||
ev_register_library_target(evse_security_conversions)
|
||||
|
||||
target_sources(evse_security_conversions
|
||||
PRIVATE
|
||||
src/conversions.cpp
|
||||
)
|
||||
|
||||
target_include_directories(evse_security_conversions
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
"$<TARGET_PROPERTY:generate_cpp_files,EVEREST_GENERATED_INCLUDE_DIR>"
|
||||
)
|
||||
|
||||
target_compile_options(evse_security_conversions
|
||||
PRIVATE
|
||||
-Wimplicit-fallthrough
|
||||
-Werror=switch-enum
|
||||
)
|
||||
|
||||
add_dependencies(evse_security_conversions generate_cpp_files)
|
||||
|
||||
target_link_libraries(evse_security_conversions
|
||||
PRIVATE
|
||||
everest::evse_security
|
||||
everest::framework
|
||||
)
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright Pionix GmbH and Contributors to EVerest
|
||||
#ifndef EVSE_SECURITY_CONVERSIONS_HPP
|
||||
#define EVSE_SECURITY_CONVERSIONS_HPP
|
||||
|
||||
#include <evse_security/evse_security.hpp>
|
||||
#include <generated/interfaces/evse_security/Implementation.hpp>
|
||||
|
||||
namespace module {
|
||||
|
||||
namespace conversions {
|
||||
|
||||
evse_security::EncodingFormat from_everest(types::evse_security::EncodingFormat other);
|
||||
evse_security::CaCertificateType from_everest(types::evse_security::CaCertificateType other);
|
||||
evse_security::LeafCertificateType from_everest(types::evse_security::LeafCertificateType other);
|
||||
evse_security::CertificateType from_everest(types::evse_security::CertificateType other);
|
||||
evse_security::HashAlgorithm from_everest(types::evse_security::HashAlgorithm other);
|
||||
evse_security::InstallCertificateResult from_everest(types::evse_security::InstallCertificateResult other);
|
||||
evse_security::DeleteCertificateResult from_everest(types::evse_security::DeleteCertificateResult other);
|
||||
evse_security::GetInstalledCertificatesStatus from_everest(types::evse_security::GetInstalledCertificatesStatus other);
|
||||
|
||||
evse_security::CertificateHashData from_everest(types::evse_security::CertificateHashData other);
|
||||
evse_security::CertificateHashDataChain from_everest(types::evse_security::CertificateHashDataChain other);
|
||||
evse_security::GetInstalledCertificatesResult from_everest(types::evse_security::GetInstalledCertificatesResult other);
|
||||
evse_security::OCSPRequestData from_everest(types::evse_security::OCSPRequestData other);
|
||||
evse_security::OCSPRequestDataList from_everest(types::evse_security::OCSPRequestDataList other);
|
||||
evse_security::CertificateInfo from_everest(types::evse_security::CertificateInfo other);
|
||||
|
||||
types::evse_security::EncodingFormat to_everest(evse_security::EncodingFormat other);
|
||||
types::evse_security::CaCertificateType to_everest(evse_security::CaCertificateType other);
|
||||
types::evse_security::LeafCertificateType to_everest(evse_security::LeafCertificateType other);
|
||||
types::evse_security::CertificateType to_everest(evse_security::CertificateType other);
|
||||
types::evse_security::HashAlgorithm to_everest(evse_security::HashAlgorithm other);
|
||||
types::evse_security::InstallCertificateResult to_everest(evse_security::InstallCertificateResult other);
|
||||
types::evse_security::CertificateValidationResult to_everest(evse_security::CertificateValidationResult other);
|
||||
types::evse_security::DeleteCertificateResult to_everest(evse_security::DeleteCertificateResult other);
|
||||
types::evse_security::GetInstalledCertificatesStatus to_everest(evse_security::GetInstalledCertificatesStatus other);
|
||||
types::evse_security::GetCertificateSignRequestStatus to_everest(evse_security::GetCertificateSignRequestStatus other);
|
||||
types::evse_security::GetCertificateInfoStatus to_everest(evse_security::GetCertificateInfoStatus other);
|
||||
|
||||
types::evse_security::CertificateHashData to_everest(evse_security::CertificateHashData other);
|
||||
types::evse_security::CertificateHashDataChain to_everest(evse_security::CertificateHashDataChain other);
|
||||
types::evse_security::GetInstalledCertificatesResult to_everest(evse_security::GetInstalledCertificatesResult other);
|
||||
types::evse_security::OCSPRequestData to_everest(evse_security::OCSPRequestData other);
|
||||
types::evse_security::OCSPRequestDataList to_everest(evse_security::OCSPRequestDataList other);
|
||||
types::evse_security::CertificateInfo to_everest(evse_security::CertificateInfo other);
|
||||
|
||||
} // namespace conversions
|
||||
|
||||
} // namespace module
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,442 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright Pionix GmbH and Contributors to EVerest
|
||||
|
||||
#include <exception>
|
||||
|
||||
#include <everest/conversions/evse_security/conversions.hpp>
|
||||
|
||||
namespace module {
|
||||
|
||||
namespace conversions {
|
||||
|
||||
evse_security::EncodingFormat from_everest(types::evse_security::EncodingFormat other) {
|
||||
switch (other) {
|
||||
case types::evse_security::EncodingFormat::PEM:
|
||||
return evse_security::EncodingFormat::PEM;
|
||||
case types::evse_security::EncodingFormat::DER:
|
||||
return evse_security::EncodingFormat::DER;
|
||||
}
|
||||
throw std::out_of_range("Could not convert types::evse_security::EncodingFormat to evse_security::EncodingFormat");
|
||||
}
|
||||
|
||||
evse_security::CaCertificateType from_everest(types::evse_security::CaCertificateType other) {
|
||||
switch (other) {
|
||||
case types::evse_security::CaCertificateType::V2G:
|
||||
return evse_security::CaCertificateType::V2G;
|
||||
case types::evse_security::CaCertificateType::MO:
|
||||
return evse_security::CaCertificateType::MO;
|
||||
case types::evse_security::CaCertificateType::CSMS:
|
||||
return evse_security::CaCertificateType::CSMS;
|
||||
case types::evse_security::CaCertificateType::MF:
|
||||
return evse_security::CaCertificateType::MF;
|
||||
}
|
||||
throw std::out_of_range(
|
||||
"Could not convert types::evse_security::CaCertificateType to evse_security::CaCertificateType");
|
||||
}
|
||||
|
||||
evse_security::LeafCertificateType from_everest(types::evse_security::LeafCertificateType other) {
|
||||
switch (other) {
|
||||
case types::evse_security::LeafCertificateType::CSMS:
|
||||
return evse_security::LeafCertificateType::CSMS;
|
||||
case types::evse_security::LeafCertificateType::V2G:
|
||||
return evse_security::LeafCertificateType::V2G;
|
||||
case types::evse_security::LeafCertificateType::MF:
|
||||
return evse_security::LeafCertificateType::MF;
|
||||
case types::evse_security::LeafCertificateType::MO:
|
||||
return evse_security::LeafCertificateType::MO;
|
||||
}
|
||||
throw std::out_of_range(
|
||||
"Could not convert types::evse_security::LeafCertificateType to evse_security::LeafCertificateType");
|
||||
}
|
||||
|
||||
evse_security::CertificateType from_everest(types::evse_security::CertificateType other) {
|
||||
switch (other) {
|
||||
case types::evse_security::CertificateType::V2GRootCertificate:
|
||||
return evse_security::CertificateType::V2GRootCertificate;
|
||||
case types::evse_security::CertificateType::MORootCertificate:
|
||||
return evse_security::CertificateType::MORootCertificate;
|
||||
case types::evse_security::CertificateType::CSMSRootCertificate:
|
||||
return evse_security::CertificateType::CSMSRootCertificate;
|
||||
case types::evse_security::CertificateType::V2GCertificateChain:
|
||||
return evse_security::CertificateType::V2GCertificateChain;
|
||||
case types::evse_security::CertificateType::MFRootCertificate:
|
||||
return evse_security::CertificateType::MFRootCertificate;
|
||||
}
|
||||
throw std::out_of_range(
|
||||
"Could not convert types::evse_security::CertificateType to evse_security::CertificateType");
|
||||
}
|
||||
|
||||
evse_security::HashAlgorithm from_everest(types::evse_security::HashAlgorithm other) {
|
||||
switch (other) {
|
||||
case types::evse_security::HashAlgorithm::SHA256:
|
||||
return evse_security::HashAlgorithm::SHA256;
|
||||
case types::evse_security::HashAlgorithm::SHA384:
|
||||
return evse_security::HashAlgorithm::SHA384;
|
||||
case types::evse_security::HashAlgorithm::SHA512:
|
||||
return evse_security::HashAlgorithm::SHA512;
|
||||
}
|
||||
throw std::out_of_range("Could not convert types::evse_security::HashAlgorithm to evse_security::HashAlgorithm");
|
||||
}
|
||||
|
||||
evse_security::InstallCertificateResult from_everest(types::evse_security::InstallCertificateResult other) {
|
||||
switch (other) {
|
||||
case types::evse_security::InstallCertificateResult::InvalidSignature:
|
||||
return evse_security::InstallCertificateResult::InvalidSignature;
|
||||
case types::evse_security::InstallCertificateResult::InvalidCertificateChain:
|
||||
return evse_security::InstallCertificateResult::InvalidCertificateChain;
|
||||
case types::evse_security::InstallCertificateResult::InvalidFormat:
|
||||
return evse_security::InstallCertificateResult::InvalidFormat;
|
||||
case types::evse_security::InstallCertificateResult::InvalidCommonName:
|
||||
return evse_security::InstallCertificateResult::InvalidCommonName;
|
||||
case types::evse_security::InstallCertificateResult::NoRootCertificateInstalled:
|
||||
return evse_security::InstallCertificateResult::NoRootCertificateInstalled;
|
||||
case types::evse_security::InstallCertificateResult::Expired:
|
||||
return evse_security::InstallCertificateResult::Expired;
|
||||
case types::evse_security::InstallCertificateResult::CertificateStoreMaxLengthExceeded:
|
||||
return evse_security::InstallCertificateResult::CertificateStoreMaxLengthExceeded;
|
||||
case types::evse_security::InstallCertificateResult::WriteError:
|
||||
return evse_security::InstallCertificateResult::WriteError;
|
||||
case types::evse_security::InstallCertificateResult::Accepted:
|
||||
return evse_security::InstallCertificateResult::Accepted;
|
||||
}
|
||||
throw std::out_of_range("Could not convert types::evse_security::InstallCertificateResult to "
|
||||
"evse_security::InstallCertificateResult");
|
||||
}
|
||||
|
||||
evse_security::DeleteCertificateResult from_everest(types::evse_security::DeleteCertificateResult other) {
|
||||
switch (other) {
|
||||
case types::evse_security::DeleteCertificateResult::Accepted:
|
||||
return evse_security::DeleteCertificateResult::Accepted;
|
||||
case types::evse_security::DeleteCertificateResult::Failed:
|
||||
return evse_security::DeleteCertificateResult::Failed;
|
||||
case types::evse_security::DeleteCertificateResult::NotFound:
|
||||
return evse_security::DeleteCertificateResult::NotFound;
|
||||
}
|
||||
throw std::out_of_range("Could not convert types::evse_security::DeleteCertificateResult to "
|
||||
"evse_security::DeleteCertificateResult");
|
||||
}
|
||||
|
||||
evse_security::GetInstalledCertificatesStatus from_everest(types::evse_security::GetInstalledCertificatesStatus other) {
|
||||
switch (other) {
|
||||
case types::evse_security::GetInstalledCertificatesStatus::Accepted:
|
||||
return evse_security::GetInstalledCertificatesStatus::Accepted;
|
||||
case types::evse_security::GetInstalledCertificatesStatus::NotFound:
|
||||
return evse_security::GetInstalledCertificatesStatus::NotFound;
|
||||
}
|
||||
throw std::out_of_range("Could not convert types::evse_security::GetInstalledCertificatesStatus to "
|
||||
"evse_security::GetInstalledCertificatesStatus");
|
||||
}
|
||||
|
||||
evse_security::CertificateHashData from_everest(types::evse_security::CertificateHashData other) {
|
||||
evse_security::CertificateHashData lhs;
|
||||
lhs.hash_algorithm = from_everest(other.hash_algorithm);
|
||||
lhs.issuer_name_hash = other.issuer_name_hash;
|
||||
lhs.issuer_key_hash = other.issuer_key_hash;
|
||||
lhs.serial_number = other.serial_number;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
evse_security::CertificateHashDataChain from_everest(types::evse_security::CertificateHashDataChain other) {
|
||||
evse_security::CertificateHashDataChain lhs;
|
||||
lhs.certificate_type = from_everest(other.certificate_type);
|
||||
lhs.certificate_hash_data = from_everest(other.certificate_hash_data);
|
||||
if (other.child_certificate_hash_data.has_value()) {
|
||||
std::vector<evse_security::CertificateHashData> v;
|
||||
for (const auto& certificate_hash_data : other.child_certificate_hash_data.value()) {
|
||||
v.push_back(from_everest(certificate_hash_data));
|
||||
}
|
||||
lhs.child_certificate_hash_data = v;
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
evse_security::GetInstalledCertificatesResult from_everest(types::evse_security::GetInstalledCertificatesResult other) {
|
||||
evse_security::GetInstalledCertificatesResult lhs;
|
||||
lhs.status = from_everest(other.status);
|
||||
for (const auto& certificate_hash_data_chain : other.certificate_hash_data_chain) {
|
||||
lhs.certificate_hash_data_chain.push_back(from_everest(certificate_hash_data_chain));
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
evse_security::OCSPRequestData from_everest(types::evse_security::OCSPRequestData other) {
|
||||
evse_security::OCSPRequestData lhs;
|
||||
if (other.certificate_hash_data.has_value()) {
|
||||
lhs.certificate_hash_data = from_everest(other.certificate_hash_data.value());
|
||||
}
|
||||
if (other.responder_url.has_value()) {
|
||||
lhs.responder_url = other.responder_url.value();
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
evse_security::OCSPRequestDataList from_everest(types::evse_security::OCSPRequestDataList other) {
|
||||
evse_security::OCSPRequestDataList lhs;
|
||||
for (const auto& ocsp_request_data : other.ocsp_request_data_list) {
|
||||
lhs.ocsp_request_data_list.push_back(from_everest(ocsp_request_data));
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
evse_security::CertificateOCSP from_everest(types::evse_security::CertificateOCSP other) {
|
||||
evse_security::CertificateOCSP lhs;
|
||||
lhs.hash = from_everest(other.hash);
|
||||
|
||||
if (other.ocsp_path.has_value()) {
|
||||
lhs.ocsp_path = other.ocsp_path.value();
|
||||
}
|
||||
|
||||
return lhs;
|
||||
}
|
||||
|
||||
evse_security::CertificateInfo from_everest(types::evse_security::CertificateInfo other) {
|
||||
evse_security::CertificateInfo lhs;
|
||||
lhs.key = other.key;
|
||||
lhs.certificate = other.certificate;
|
||||
lhs.certificate_single = other.certificate_single;
|
||||
lhs.certificate_count = other.certificate_count;
|
||||
lhs.password = other.password;
|
||||
if (other.ocsp.has_value()) {
|
||||
for (auto& ocsp_data : other.ocsp.value()) {
|
||||
lhs.ocsp.push_back(from_everest(ocsp_data));
|
||||
}
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
types::evse_security::EncodingFormat to_everest(evse_security::EncodingFormat other) {
|
||||
switch (other) {
|
||||
case evse_security::EncodingFormat::PEM:
|
||||
return types::evse_security::EncodingFormat::PEM;
|
||||
case evse_security::EncodingFormat::DER:
|
||||
return types::evse_security::EncodingFormat::DER;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::EncodingFormat to types::evse_security::EncodingFormat");
|
||||
}
|
||||
|
||||
types::evse_security::CaCertificateType to_everest(evse_security::CaCertificateType other) {
|
||||
switch (other) {
|
||||
case evse_security::CaCertificateType::V2G:
|
||||
return types::evse_security::CaCertificateType::V2G;
|
||||
case evse_security::CaCertificateType::MO:
|
||||
return types::evse_security::CaCertificateType::MO;
|
||||
case evse_security::CaCertificateType::CSMS:
|
||||
return types::evse_security::CaCertificateType::CSMS;
|
||||
case evse_security::CaCertificateType::MF:
|
||||
return types::evse_security::CaCertificateType::MF;
|
||||
}
|
||||
throw std::out_of_range(
|
||||
"Could not convert evse_security::CaCertificateType to types::evse_security::CaCertificateType");
|
||||
}
|
||||
|
||||
types::evse_security::LeafCertificateType to_everest(evse_security::LeafCertificateType other) {
|
||||
switch (other) {
|
||||
case evse_security::LeafCertificateType::CSMS:
|
||||
return types::evse_security::LeafCertificateType::CSMS;
|
||||
case evse_security::LeafCertificateType::V2G:
|
||||
return types::evse_security::LeafCertificateType::V2G;
|
||||
case evse_security::LeafCertificateType::MF:
|
||||
return types::evse_security::LeafCertificateType::MF;
|
||||
case evse_security::LeafCertificateType::MO:
|
||||
return types::evse_security::LeafCertificateType::MO;
|
||||
}
|
||||
throw std::out_of_range(
|
||||
"Could not convert evse_security::LeafCertificateType to types::evse_security::LeafCertificateType");
|
||||
}
|
||||
|
||||
types::evse_security::CertificateType to_everest(evse_security::CertificateType other) {
|
||||
switch (other) {
|
||||
case evse_security::CertificateType::V2GRootCertificate:
|
||||
return types::evse_security::CertificateType::V2GRootCertificate;
|
||||
case evse_security::CertificateType::MORootCertificate:
|
||||
return types::evse_security::CertificateType::MORootCertificate;
|
||||
case evse_security::CertificateType::CSMSRootCertificate:
|
||||
return types::evse_security::CertificateType::CSMSRootCertificate;
|
||||
case evse_security::CertificateType::V2GCertificateChain:
|
||||
return types::evse_security::CertificateType::V2GCertificateChain;
|
||||
case evse_security::CertificateType::MFRootCertificate:
|
||||
return types::evse_security::CertificateType::MFRootCertificate;
|
||||
}
|
||||
throw std::out_of_range(
|
||||
"Could not convert evse_security::CertificateType to types::evse_security::CertificateType");
|
||||
}
|
||||
|
||||
types::evse_security::HashAlgorithm to_everest(evse_security::HashAlgorithm other) {
|
||||
switch (other) {
|
||||
case evse_security::HashAlgorithm::SHA256:
|
||||
return types::evse_security::HashAlgorithm::SHA256;
|
||||
case evse_security::HashAlgorithm::SHA384:
|
||||
return types::evse_security::HashAlgorithm::SHA384;
|
||||
case evse_security::HashAlgorithm::SHA512:
|
||||
return types::evse_security::HashAlgorithm::SHA512;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::HashAlgorithm to types::evse_security::HashAlgorithm");
|
||||
}
|
||||
|
||||
types::evse_security::InstallCertificateResult to_everest(evse_security::InstallCertificateResult other) {
|
||||
switch (other) {
|
||||
case evse_security::InstallCertificateResult::InvalidSignature:
|
||||
return types::evse_security::InstallCertificateResult::InvalidSignature;
|
||||
case evse_security::InstallCertificateResult::InvalidCertificateChain:
|
||||
return types::evse_security::InstallCertificateResult::InvalidCertificateChain;
|
||||
case evse_security::InstallCertificateResult::InvalidFormat:
|
||||
return types::evse_security::InstallCertificateResult::InvalidFormat;
|
||||
case evse_security::InstallCertificateResult::InvalidCommonName:
|
||||
return types::evse_security::InstallCertificateResult::InvalidCommonName;
|
||||
case evse_security::InstallCertificateResult::NoRootCertificateInstalled:
|
||||
return types::evse_security::InstallCertificateResult::NoRootCertificateInstalled;
|
||||
case evse_security::InstallCertificateResult::Expired:
|
||||
return types::evse_security::InstallCertificateResult::Expired;
|
||||
case evse_security::InstallCertificateResult::CertificateStoreMaxLengthExceeded:
|
||||
return types::evse_security::InstallCertificateResult::CertificateStoreMaxLengthExceeded;
|
||||
case evse_security::InstallCertificateResult::WriteError:
|
||||
return types::evse_security::InstallCertificateResult::WriteError;
|
||||
case evse_security::InstallCertificateResult::Accepted:
|
||||
return types::evse_security::InstallCertificateResult::Accepted;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::InstallCertificateResult to "
|
||||
"types::evse_security::InstallCertificateResult");
|
||||
}
|
||||
|
||||
types::evse_security::CertificateValidationResult to_everest(evse_security::CertificateValidationResult other) {
|
||||
switch (other) {
|
||||
case evse_security::CertificateValidationResult::Valid:
|
||||
return types::evse_security::CertificateValidationResult::Valid;
|
||||
case evse_security::CertificateValidationResult::InvalidSignature:
|
||||
return types::evse_security::CertificateValidationResult::InvalidSignature;
|
||||
case evse_security::CertificateValidationResult::IssuerNotFound:
|
||||
return types::evse_security::CertificateValidationResult::IssuerNotFound;
|
||||
case evse_security::CertificateValidationResult::InvalidLeafSignature:
|
||||
return types::evse_security::CertificateValidationResult::InvalidLeafSignature;
|
||||
case evse_security::CertificateValidationResult::InvalidChain:
|
||||
return types::evse_security::CertificateValidationResult::InvalidChain;
|
||||
case evse_security::CertificateValidationResult::Expired:
|
||||
return types::evse_security::CertificateValidationResult::Expired;
|
||||
case evse_security::CertificateValidationResult::Unknown:
|
||||
return types::evse_security::CertificateValidationResult::Unknown;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::CertificateValidationResult to "
|
||||
"types::evse_security::CertificateValidationResult");
|
||||
}
|
||||
|
||||
types::evse_security::DeleteCertificateResult to_everest(evse_security::DeleteCertificateResult other) {
|
||||
switch (other) {
|
||||
case evse_security::DeleteCertificateResult::Accepted:
|
||||
return types::evse_security::DeleteCertificateResult::Accepted;
|
||||
case evse_security::DeleteCertificateResult::Failed:
|
||||
return types::evse_security::DeleteCertificateResult::Failed;
|
||||
case evse_security::DeleteCertificateResult::NotFound:
|
||||
return types::evse_security::DeleteCertificateResult::NotFound;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::DeleteCertificateResult to "
|
||||
"types::evse_security::DeleteCertificateResult");
|
||||
}
|
||||
|
||||
types::evse_security::GetInstalledCertificatesStatus to_everest(evse_security::GetInstalledCertificatesStatus other) {
|
||||
switch (other) {
|
||||
case evse_security::GetInstalledCertificatesStatus::Accepted:
|
||||
return types::evse_security::GetInstalledCertificatesStatus::Accepted;
|
||||
case evse_security::GetInstalledCertificatesStatus::NotFound:
|
||||
return types::evse_security::GetInstalledCertificatesStatus::NotFound;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::GetInstalledCertificatesStatus to "
|
||||
"types::evse_security::GetInstalledCertificatesStatus");
|
||||
}
|
||||
|
||||
types::evse_security::GetCertificateSignRequestStatus to_everest(evse_security::GetCertificateSignRequestStatus other) {
|
||||
switch (other) {
|
||||
case evse_security::GetCertificateSignRequestStatus::Accepted:
|
||||
return types::evse_security::GetCertificateSignRequestStatus::Accepted;
|
||||
case evse_security::GetCertificateSignRequestStatus::InvalidRequestedType:
|
||||
return types::evse_security::GetCertificateSignRequestStatus::InvalidRequestedType;
|
||||
case evse_security::GetCertificateSignRequestStatus::KeyGenError:
|
||||
return types::evse_security::GetCertificateSignRequestStatus::KeyGenError;
|
||||
case evse_security::GetCertificateSignRequestStatus::GenerationError:
|
||||
return types::evse_security::GetCertificateSignRequestStatus::GenerationError;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::GetCertificateSignRequestStatus to "
|
||||
"types::evse_security::GetCertificateSignRequestStatus");
|
||||
}
|
||||
|
||||
types::evse_security::GetCertificateInfoStatus to_everest(evse_security::GetCertificateInfoStatus other) {
|
||||
switch (other) {
|
||||
case evse_security::GetCertificateInfoStatus::Accepted:
|
||||
return types::evse_security::GetCertificateInfoStatus::Accepted;
|
||||
case evse_security::GetCertificateInfoStatus::Rejected:
|
||||
return types::evse_security::GetCertificateInfoStatus::Rejected;
|
||||
case evse_security::GetCertificateInfoStatus::NotFound:
|
||||
return types::evse_security::GetCertificateInfoStatus::NotFound;
|
||||
case evse_security::GetCertificateInfoStatus::NotFoundValid:
|
||||
return types::evse_security::GetCertificateInfoStatus::NotFoundValid;
|
||||
case evse_security::GetCertificateInfoStatus::PrivateKeyNotFound:
|
||||
return types::evse_security::GetCertificateInfoStatus::PrivateKeyNotFound;
|
||||
}
|
||||
throw std::out_of_range("Could not convert evse_security::GetCertificateInfoStatus to "
|
||||
"types::evse_security::GetCertificateInfoStatus");
|
||||
}
|
||||
|
||||
types::evse_security::CertificateHashData to_everest(evse_security::CertificateHashData other) {
|
||||
types::evse_security::CertificateHashData lhs;
|
||||
lhs.hash_algorithm = to_everest(other.hash_algorithm);
|
||||
lhs.issuer_name_hash = other.issuer_name_hash;
|
||||
lhs.issuer_key_hash = other.issuer_key_hash;
|
||||
lhs.serial_number = other.serial_number;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
types::evse_security::CertificateHashDataChain to_everest(evse_security::CertificateHashDataChain other) {
|
||||
types::evse_security::CertificateHashDataChain lhs;
|
||||
lhs.certificate_type = to_everest(other.certificate_type);
|
||||
lhs.certificate_hash_data = to_everest(other.certificate_hash_data);
|
||||
|
||||
std::vector<types::evse_security::CertificateHashData> v;
|
||||
for (const auto& certificate_hash_data : other.child_certificate_hash_data) {
|
||||
v.push_back(to_everest(certificate_hash_data));
|
||||
}
|
||||
lhs.child_certificate_hash_data = v;
|
||||
|
||||
return lhs;
|
||||
}
|
||||
|
||||
types::evse_security::GetInstalledCertificatesResult to_everest(evse_security::GetInstalledCertificatesResult other) {
|
||||
types::evse_security::GetInstalledCertificatesResult lhs;
|
||||
lhs.status = to_everest(other.status);
|
||||
for (const auto& certificate_hash_data_chain : other.certificate_hash_data_chain) {
|
||||
lhs.certificate_hash_data_chain.push_back(to_everest(certificate_hash_data_chain));
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
types::evse_security::OCSPRequestData to_everest(evse_security::OCSPRequestData other) {
|
||||
types::evse_security::OCSPRequestData lhs;
|
||||
if (other.certificate_hash_data.has_value()) {
|
||||
lhs.certificate_hash_data = to_everest(other.certificate_hash_data.value());
|
||||
}
|
||||
if (other.responder_url.has_value()) {
|
||||
lhs.responder_url = other.responder_url;
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
types::evse_security::OCSPRequestDataList to_everest(evse_security::OCSPRequestDataList other) {
|
||||
types::evse_security::OCSPRequestDataList lhs;
|
||||
for (const auto& ocsp_request_data : other.ocsp_request_data_list) {
|
||||
lhs.ocsp_request_data_list.push_back(to_everest(ocsp_request_data));
|
||||
}
|
||||
return lhs;
|
||||
}
|
||||
|
||||
types::evse_security::CertificateInfo to_everest(evse_security::CertificateInfo other) {
|
||||
types::evse_security::CertificateInfo lhs;
|
||||
lhs.key = other.key;
|
||||
lhs.certificate_root = other.certificate_root;
|
||||
lhs.certificate = other.certificate;
|
||||
lhs.certificate_single = other.certificate_single;
|
||||
lhs.password = other.password;
|
||||
lhs.certificate_count = other.certificate_count;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
} // namespace conversions
|
||||
|
||||
} // namespace module
|
||||
45
tools/EVerest-main/lib/everest/conversions/ocpp/BUILD.bazel
Normal file
45
tools/EVerest-main/lib/everest/conversions/ocpp/BUILD.bazel
Normal file
@@ -0,0 +1,45 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "ocpp_evse_security",
|
||||
srcs = [
|
||||
"src/evse_security_ocpp.cpp"
|
||||
],
|
||||
hdrs = [
|
||||
"include/everest/conversions/ocpp/evse_security_ocpp.hpp",
|
||||
],
|
||||
copts = [
|
||||
"-std=c++17",
|
||||
"-Wimplicit-fallthrough",
|
||||
"-Wno-error=switch-enum", # boost.date_time 1.87.0 has incomplete switch statements
|
||||
],
|
||||
includes = ["include"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//lib/everest/framework:framework",
|
||||
"//lib/everest/ocpp:libocpp",
|
||||
"//interfaces:interfaces_lib",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "ocpp_conversions",
|
||||
srcs = [
|
||||
"src/ocpp_conversions.cpp",
|
||||
],
|
||||
hdrs = [
|
||||
"include/everest/conversions/ocpp/ocpp_conversions.hpp"
|
||||
],
|
||||
copts = [
|
||||
"-std=c++17",
|
||||
"-Wimplicit-fallthrough",
|
||||
"-Wno-error=switch-enum", # boost.date_time 1.87.0 has incomplete switch statements
|
||||
],
|
||||
includes = ["include"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//lib/everest/framework:framework",
|
||||
"//lib/everest/ocpp:libocpp",
|
||||
"//types:types_lib",
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1,62 @@
|
||||
# OCPP EVSE Security
|
||||
|
||||
add_library(ocpp_evse_security STATIC)
|
||||
add_library(everest::ocpp_evse_security ALIAS ocpp_evse_security)
|
||||
ev_register_library_target(ocpp_evse_security)
|
||||
|
||||
target_sources(ocpp_evse_security
|
||||
PRIVATE
|
||||
src/evse_security_ocpp.cpp
|
||||
)
|
||||
|
||||
target_include_directories(ocpp_evse_security
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
"$<TARGET_PROPERTY:generate_cpp_files,EVEREST_GENERATED_INCLUDE_DIR>"
|
||||
)
|
||||
|
||||
target_compile_options(ocpp_evse_security
|
||||
PRIVATE
|
||||
-Wimplicit-fallthrough
|
||||
-Werror=switch-enum
|
||||
)
|
||||
|
||||
add_dependencies(ocpp_evse_security generate_cpp_files)
|
||||
|
||||
target_link_libraries(ocpp_evse_security
|
||||
PRIVATE
|
||||
everest::ocpp
|
||||
everest::framework
|
||||
)
|
||||
|
||||
|
||||
# OCPP conversions
|
||||
|
||||
add_library(ocpp_conversions STATIC)
|
||||
add_library(everest::ocpp_conversions ALIAS ocpp_conversions)
|
||||
ev_register_library_target(ocpp_conversions)
|
||||
|
||||
target_sources(ocpp_conversions
|
||||
PRIVATE
|
||||
src/ocpp_conversions.cpp
|
||||
)
|
||||
|
||||
target_include_directories(ocpp_conversions
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
"$<TARGET_PROPERTY:generate_cpp_files,EVEREST_GENERATED_INCLUDE_DIR>"
|
||||
)
|
||||
|
||||
target_compile_options(ocpp_conversions
|
||||
PRIVATE
|
||||
-Wimplicit-fallthrough
|
||||
-Werror=switch-enum
|
||||
)
|
||||
|
||||
add_dependencies(ocpp_conversions generate_cpp_files)
|
||||
|
||||
target_link_libraries(ocpp_conversions
|
||||
PRIVATE
|
||||
everest::ocpp
|
||||
everest::framework
|
||||
)
|
||||
@@ -0,0 +1,84 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// Copyright Pionix GmbH and Contributors to EVerest
|
||||
#ifndef EVEREST_SECURITY_OCPP_HPP
|
||||
#define EVEREST_SECURITY_OCPP_HPP
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include <generated/interfaces/evse_security/Interface.hpp>
|
||||
#include <ocpp/common/evse_security.hpp>
|
||||
|
||||
class EvseSecurity : public ocpp::EvseSecurity {
|
||||
private:
|
||||
evse_securityIntf& r_security;
|
||||
|
||||
public:
|
||||
EvseSecurity() = delete;
|
||||
EvseSecurity(evse_securityIntf& r_security);
|
||||
~EvseSecurity();
|
||||
ocpp::InstallCertificateResult install_ca_certificate(const std::string& certificate,
|
||||
const ocpp::CaCertificateType& certificate_type) override;
|
||||
ocpp::DeleteCertificateResult
|
||||
delete_certificate(const ocpp::CertificateHashDataType& certificate_hash_data) override;
|
||||
ocpp::CertificateValidationResult verify_certificate(const std::string& certificate_chain,
|
||||
const ocpp::LeafCertificateType& certificate_type) override;
|
||||
ocpp::CertificateValidationResult
|
||||
verify_certificate(const std::string& certificate_chain,
|
||||
const std::vector<ocpp::LeafCertificateType>& certificate_types) override;
|
||||
ocpp::InstallCertificateResult
|
||||
update_leaf_certificate(const std::string& certificate_chain,
|
||||
const ocpp::CertificateSigningUseEnum& certificate_type) override;
|
||||
std::vector<ocpp::CertificateHashDataChain>
|
||||
get_installed_certificates(const std::vector<ocpp::CertificateType>& certificate_types) override;
|
||||
std::vector<ocpp::OCSPRequestData> get_v2g_ocsp_request_data() override;
|
||||
std::vector<ocpp::OCSPRequestData> get_mo_ocsp_request_data(const std::string& certificate_chain) override;
|
||||
void update_ocsp_cache(const ocpp::CertificateHashDataType& certificate_hash_data,
|
||||
const std::string& ocsp_response) override;
|
||||
bool is_ca_certificate_installed(const ocpp::CaCertificateType& certificate_type) override;
|
||||
ocpp::GetCertificateSignRequestResult
|
||||
generate_certificate_signing_request(const ocpp::CertificateSigningUseEnum& certificate_type,
|
||||
const std::string& country, const std::string& organization,
|
||||
const std::string& common, bool use_tpm) override;
|
||||
ocpp::GetCertificateInfoResult get_leaf_certificate_info(const ocpp::CertificateSigningUseEnum& certificate_type,
|
||||
bool include_ocsp) override;
|
||||
bool update_certificate_links(const ocpp::CertificateSigningUseEnum& certificate_type) override;
|
||||
std::string get_verify_file(const ocpp::CaCertificateType& certificate_type) override;
|
||||
std::string get_verify_location(const ocpp::CaCertificateType& certificate_type) override;
|
||||
int get_leaf_expiry_days_count(const ocpp::CertificateSigningUseEnum& certificate_type) override;
|
||||
};
|
||||
|
||||
namespace conversions {
|
||||
|
||||
ocpp::CaCertificateType to_ocpp(types::evse_security::CaCertificateType other);
|
||||
ocpp::LeafCertificateType to_ocpp(types::evse_security::LeafCertificateType other);
|
||||
ocpp::CertificateType to_ocpp(types::evse_security::CertificateType other);
|
||||
ocpp::HashAlgorithmEnumType to_ocpp(types::evse_security::HashAlgorithm other);
|
||||
ocpp::InstallCertificateResult to_ocpp(types::evse_security::InstallCertificateResult other);
|
||||
ocpp::CertificateValidationResult to_ocpp(types::evse_security::CertificateValidationResult other);
|
||||
ocpp::GetCertificateInfoStatus to_ocpp(types::evse_security::GetCertificateInfoStatus other);
|
||||
ocpp::GetCertificateSignRequestStatus to_ocpp(types::evse_security::GetCertificateSignRequestStatus other);
|
||||
ocpp::DeleteCertificateResult to_ocpp(types::evse_security::DeleteCertificateResult other);
|
||||
|
||||
ocpp::CertificateHashDataType to_ocpp(types::evse_security::CertificateHashData other);
|
||||
ocpp::CertificateHashDataChain to_ocpp(types::evse_security::CertificateHashDataChain other);
|
||||
ocpp::OCSPRequestData to_ocpp(types::evse_security::OCSPRequestData other);
|
||||
ocpp::CertificateOCSP to_ocpp(types::evse_security::CertificateOCSP other);
|
||||
ocpp::CertificateInfo to_ocpp(types::evse_security::CertificateInfo other);
|
||||
|
||||
types::evse_security::CaCertificateType from_ocpp(ocpp::CaCertificateType other);
|
||||
types::evse_security::LeafCertificateType from_ocpp(ocpp::CertificateSigningUseEnum other);
|
||||
types::evse_security::LeafCertificateType from_ocpp(ocpp::LeafCertificateType other);
|
||||
types::evse_security::CertificateType from_ocpp(ocpp::CertificateType other);
|
||||
types::evse_security::HashAlgorithm from_ocpp(ocpp::HashAlgorithmEnumType other);
|
||||
types::evse_security::InstallCertificateResult from_ocpp(ocpp::InstallCertificateResult other);
|
||||
types::evse_security::GetCertificateSignRequestStatus from_ocpp(ocpp::GetCertificateSignRequestStatus other);
|
||||
types::evse_security::DeleteCertificateResult from_ocpp(ocpp::DeleteCertificateResult other);
|
||||
|
||||
types::evse_security::CertificateHashData from_ocpp(ocpp::CertificateHashDataType other);
|
||||
types::evse_security::CertificateHashDataChain from_ocpp(ocpp::CertificateHashDataChain other);
|
||||
types::evse_security::OCSPRequestData from_ocpp(ocpp::OCSPRequestData other);
|
||||
types::evse_security::CertificateInfo from_ocpp(ocpp::CertificateInfo other);
|
||||
|
||||
}; // namespace conversions
|
||||
|
||||
#endif // EVEREST_SECURITY_OCPP_HPP
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user