diff --git a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/ecalmon_tree_widget.cpp b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/ecalmon_tree_widget.cpp index 1de5585efb..97f4173e2d 100644 --- a/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/ecalmon_tree_widget.cpp +++ b/app/mon/mon_gui/src/widgets/ecalmon_tree_widget/ecalmon_tree_widget.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -508,7 +508,7 @@ void EcalmonTreeWidget::loadGuiSettings(const QString& group) QVector group_by_columns; int auto_expand = 0; - for (auto column_variant : settings.value("group_by_columns").toList()) + for (const auto& column_variant : settings.value("group_by_columns").toList()) { int column = column_variant.toInt(); if ((column >= 0) && (column < group_tree_model_->columnCount())) diff --git a/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp b/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp index 15e084c5ef..74d04c2608 100644 --- a/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp +++ b/app/mon/mon_gui/src/widgets/models/host_tree_item.cpp @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -167,8 +167,9 @@ void HostTreeItem::update(const eCAL::pb::Monitoring& monitoring_pb) data_received_bytes_ = 0; // Fill variables with accumulated data - for (auto topic : monitoring_pb.topics()) + for (int i = 0; i clear(); - for (auto publisher : publishers) + for (const auto& publisher : publishers) ui_.textEdit->append(publisher); } diff --git a/build_win/nanopb/compile-nanopb.bat b/build_win/nanopb/compile-nanopb.bat new file mode 100644 index 0000000000..fdbf4f4589 --- /dev/null +++ b/build_win/nanopb/compile-nanopb.bat @@ -0,0 +1 @@ +python compile-nanopb.py --nano_pb_path c:\nanopb\nanopb-0.4.9 --ecal_repository "..\.." \ No newline at end of file diff --git a/build_win/nanopb/compile-nanopb.py b/build_win/nanopb/compile-nanopb.py new file mode 100644 index 0000000000..5632fc90e0 --- /dev/null +++ b/build_win/nanopb/compile-nanopb.py @@ -0,0 +1,112 @@ +import sys +import re +import subprocess +import logging +from pathlib import Path +import shutil +import argparse + +def setup_logging(): + """Sets up the logging configuration.""" + logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + + +def list_files(directory: Path, extension: str) -> list[Path]: + """Returns a list of files with specific extension in the given directory.""" + if not directory.exists(): + logging.error(f"Directory {directory} does not exist.") + return [] + return list(directory.glob(f"*{extension}")) + + +def copy_files(source_dir: Path, target_dir: Path, file_types: list[str]): + """Copies files of specific types from source to target directory.""" + target_dir.mkdir(parents=True, exist_ok=True) + for file_type in file_types: + for file in source_dir.glob(file_type): + try: + shutil.copy2(file, target_dir) + logging.info(f"Copied {file.name} to {target_dir}") + except Exception as e: + logging.error(f"Error copying {file.name} to {target_dir}: {e}") + + +def check_nanopb_compiler_exists(compiler_path: Path): + """Checks if the nanopb_generator exists.""" + if not compiler_path.exists(): + logging.error(f"nanopb generator not found at {compiler_path}") + sys.exit(1) + + +def run_nanopb_generator(proto_files: list[Path], compiler: Path, ecal_pb_base_path: Path, ecal_pb_sub_path: Path, target_dir: Path): + """Runs the nanopb generator for each proto file.""" + for proto_file_path in proto_files: + proto_file_name = proto_file_path.name + + command = [ + str(compiler), + "-I" + str(ecal_pb_base_path), + "-I" + str(ecal_pb_base_path / ecal_pb_sub_path), + "-D" + str(target_dir / ecal_pb_sub_path), + "-e" + ".npb", + proto_file_name + ] + + logging.info(f"Running: {' '.join(command)}") + + try: + result = subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd=proto_file_path.parent) + logging.info(f"Success: {proto_file_name} processed.") + logging.debug(result.stdout) + except subprocess.CalledProcessError as e: + logging.error(f"Error running nanopb_generator for {proto_file_name}: {e.stderr}") + + +def main(nano_pb_path: Path, ecal_repository: Path): + setup_logging() + + # Define paths based on the provided arguments + ecal_pb_base_path = Path(ecal_repository / "ecal/core_pb/src") + ecal_pb_sub_path = Path("ecal/core/pb") + ecal_target_path = Path("../../core/src/serialization/nanopb") + + # Combine paths and list .proto files + proto_files_dir = ecal_pb_base_path / ecal_pb_sub_path + ecal_pb_files = list_files(proto_files_dir, ".proto") + + # Check if nanopb generator exists + nano_pb_compiler = nano_pb_path / "generator-bin/nanopb_generator.exe" + check_nanopb_compiler_exists(nano_pb_compiler) + + # Check if any .proto files are found + if not ecal_pb_files: + logging.error(f"No .proto files found in {proto_files_dir}") + sys.exit(1) + + # Prepare target directory + absolute_target_path = (ecal_pb_base_path / ecal_target_path).resolve() + absolute_target_path.mkdir(parents=True, exist_ok=True) + + # Copy nanopb common decoder and encoder to target nanopb directory + target_nanopb_dir = absolute_target_path + copy_files(nano_pb_path, target_nanopb_dir, ["*.c", "*.h"]) + + # Run nanopb_generator for each .proto file + run_nanopb_generator(ecal_pb_files, nano_pb_compiler, ecal_pb_base_path, ecal_pb_sub_path, absolute_target_path) + + +if __name__ == "__main__": + # Set up argument parsing + parser = argparse.ArgumentParser(description="Process nanopb and eCAL protobuf files.") + parser.add_argument("--nano_pb_path", type=Path, required=True, help="Path to the nanopb directory") + parser.add_argument("--ecal_repository", type=Path, required=True, help="Path to the eCAL repository") + + # Parse the arguments + args = parser.parse_args() + + # Resolve paths to absolute paths to support relative paths + nano_pb_path = Path(args.nano_pb_path).resolve() + ecal_repository = Path(args.ecal_repository).resolve() + + # Call the main function with resolved absolute paths + main(nano_pb_path, ecal_repository) \ No newline at end of file diff --git a/ecal/core/CMakeLists.txt b/ecal/core/CMakeLists.txt index e9e9243bbf..4f9e7eeeeb 100644 --- a/ecal/core/CMakeLists.txt +++ b/ecal/core/CMakeLists.txt @@ -329,29 +329,29 @@ endif() # serialization ###################################### set(ecal_serialization_src - src/serialization/nanopb/nanopb/pb.h - src/serialization/nanopb/nanopb/pb_common.c - src/serialization/nanopb/nanopb/pb_common.h - src/serialization/nanopb/nanopb/pb_decode.c - src/serialization/nanopb/nanopb/pb_decode.h - src/serialization/nanopb/nanopb/pb_encode.c - src/serialization/nanopb/nanopb/pb_encode.h - src/serialization/nanopb/ecal.pb.c - src/serialization/nanopb/ecal.pb.h - src/serialization/nanopb/host.pb.c - src/serialization/nanopb/host.pb.h - src/serialization/nanopb/layer.pb.c - src/serialization/nanopb/layer.pb.h - src/serialization/nanopb/logging.pb.c - src/serialization/nanopb/logging.pb.h - src/serialization/nanopb/monitoring.pb.c - src/serialization/nanopb/monitoring.pb.h - src/serialization/nanopb/process.pb.c - src/serialization/nanopb/process.pb.h - src/serialization/nanopb/service.pb.c - src/serialization/nanopb/service.pb.h - src/serialization/nanopb/topic.pb.c - src/serialization/nanopb/topic.pb.h + src/serialization/nanopb/pb.h + src/serialization/nanopb/pb_common.c + src/serialization/nanopb/pb_common.h + src/serialization/nanopb/pb_decode.c + src/serialization/nanopb/pb_decode.h + src/serialization/nanopb/pb_encode.c + src/serialization/nanopb/pb_encode.h + src/serialization/nanopb/ecal/core/pb/ecal.npb.c + src/serialization/nanopb/ecal/core/pb/ecal.npb.h + src/serialization/nanopb/ecal/core/pb/host.npb.c + src/serialization/nanopb/ecal/core/pb/host.npb.h + src/serialization/nanopb/ecal/core/pb/layer.npb.c + src/serialization/nanopb/ecal/core/pb/layer.npb.h + src/serialization/nanopb/ecal/core/pb/logging.npb.c + src/serialization/nanopb/ecal/core/pb/logging.npb.h + src/serialization/nanopb/ecal/core/pb/monitoring.npb.c + src/serialization/nanopb/ecal/core/pb/monitoring.npb.h + src/serialization/nanopb/ecal/core/pb/process.npb.c + src/serialization/nanopb/ecal/core/pb/process.npb.h + src/serialization/nanopb/ecal/core/pb/service.npb.c + src/serialization/nanopb/ecal/core/pb/service.npb.h + src/serialization/nanopb/ecal/core/pb/topic.npb.c + src/serialization/nanopb/ecal/core/pb/topic.npb.h src/serialization/ecal_serialize_common.cpp src/serialization/ecal_serialize_common.h src/serialization/ecal_serialize_logging.cpp @@ -451,10 +451,10 @@ endif() # builder ###################################### set (ecal_builder_src - src/builder/logging_attribute_builder.cpp - src/builder/monitoring_attribute_builder.cpp - src/builder/registration_attribute_builder.cpp - src/logging/builder/udp_attribute_builder.cpp + src/config/builder/logging_attribute_builder.cpp + src/config/builder/monitoring_attribute_builder.cpp + src/config/builder/registration_attribute_builder.cpp + src/logging/config/builder/udp_attribute_builder.cpp src/pubsub/config/builder/reader_attribute_builder.cpp src/pubsub/config/builder/writer_attribute_builder.cpp src/readwrite/config/builder/shm_attribute_builder.cpp @@ -462,9 +462,9 @@ set (ecal_builder_src src/readwrite/config/builder/udp_attribute_builder.cpp src/readwrite/tcp/config/builder/data_reader_tcp_attribute_builder.cpp src/readwrite/udp/config/builder/udp_attribute_builder.cpp - src/registration/builder/udp_shm_attribute_builder.cpp - src/registration/builder/sample_applier_attribute_builder.cpp - src/registration/udp/builder/udp_attribute_builder.cpp + src/registration/config/builder/udp_shm_attribute_builder.cpp + src/registration/config/builder/sample_applier_attribute_builder.cpp + src/registration/udp/config/builder/udp_attribute_builder.cpp ) @@ -706,8 +706,8 @@ target_link_libraries(${PROJECT_NAME} target_include_directories(${PROJECT_NAME} PRIVATE $ + $ $ - $ PUBLIC $ $ diff --git a/ecal/core/src/builder/logging_attribute_builder.cpp b/ecal/core/src/config/builder/logging_attribute_builder.cpp similarity index 100% rename from ecal/core/src/builder/logging_attribute_builder.cpp rename to ecal/core/src/config/builder/logging_attribute_builder.cpp diff --git a/ecal/core/src/builder/logging_attribute_builder.h b/ecal/core/src/config/builder/logging_attribute_builder.h similarity index 95% rename from ecal/core/src/builder/logging_attribute_builder.h rename to ecal/core/src/config/builder/logging_attribute_builder.h index 2a4957522c..122e0eccc4 100644 --- a/ecal/core/src/builder/logging_attribute_builder.h +++ b/ecal/core/src/config/builder/logging_attribute_builder.h @@ -19,7 +19,7 @@ #pragma once -#include "logging/attributes/logging_attributes.h" +#include "logging/config/attributes/logging_attributes.h" #include "ecal/config/logging.h" #include "ecal/config/registration.h" #include "ecal/config/transport_layer.h" diff --git a/ecal/core/src/builder/monitoring_attribute_builder.cpp b/ecal/core/src/config/builder/monitoring_attribute_builder.cpp similarity index 100% rename from ecal/core/src/builder/monitoring_attribute_builder.cpp rename to ecal/core/src/config/builder/monitoring_attribute_builder.cpp diff --git a/ecal/core/src/builder/monitoring_attribute_builder.h b/ecal/core/src/config/builder/monitoring_attribute_builder.h similarity index 93% rename from ecal/core/src/builder/monitoring_attribute_builder.h rename to ecal/core/src/config/builder/monitoring_attribute_builder.h index fa20ebd4ba..2d28650003 100644 --- a/ecal/core/src/builder/monitoring_attribute_builder.h +++ b/ecal/core/src/config/builder/monitoring_attribute_builder.h @@ -19,7 +19,7 @@ #pragma once -#include "monitoring/attributes/monitoring_attributes.h" +#include "monitoring/config/attributes/monitoring_attributes.h" #include diff --git a/ecal/core/src/builder/registration_attribute_builder.cpp b/ecal/core/src/config/builder/registration_attribute_builder.cpp similarity index 100% rename from ecal/core/src/builder/registration_attribute_builder.cpp rename to ecal/core/src/config/builder/registration_attribute_builder.cpp diff --git a/ecal/core/src/builder/registration_attribute_builder.h b/ecal/core/src/config/builder/registration_attribute_builder.h similarity index 93% rename from ecal/core/src/builder/registration_attribute_builder.h rename to ecal/core/src/config/builder/registration_attribute_builder.h index a2d82853f7..92d821f9a8 100644 --- a/ecal/core/src/builder/registration_attribute_builder.h +++ b/ecal/core/src/config/builder/registration_attribute_builder.h @@ -19,7 +19,7 @@ #pragma once -#include "registration/attributes/registration_attributes.h" +#include "registration/config/attributes/registration_attributes.h" #include diff --git a/ecal/core/src/ecal_globals.cpp b/ecal/core/src/ecal_globals.cpp index 6db0fb3ee7..70eeeb3ec3 100644 --- a/ecal/core/src/ecal_globals.cpp +++ b/ecal/core/src/ecal_globals.cpp @@ -33,9 +33,9 @@ #include "service/ecal_service_singleton_manager.h" #endif -#include "builder/registration_attribute_builder.h" -#include "builder/monitoring_attribute_builder.h" -#include "builder/logging_attribute_builder.h" +#include "config/builder/registration_attribute_builder.h" +#include "config/builder/monitoring_attribute_builder.h" +#include "config/builder/logging_attribute_builder.h" namespace eCAL { diff --git a/ecal/core/src/logging/attributes/logging_attributes.h b/ecal/core/src/logging/config/attributes/logging_attributes.h similarity index 100% rename from ecal/core/src/logging/attributes/logging_attributes.h rename to ecal/core/src/logging/config/attributes/logging_attributes.h diff --git a/ecal/core/src/logging/builder/udp_attribute_builder.cpp b/ecal/core/src/logging/config/builder/udp_attribute_builder.cpp similarity index 100% rename from ecal/core/src/logging/builder/udp_attribute_builder.cpp rename to ecal/core/src/logging/config/builder/udp_attribute_builder.cpp diff --git a/ecal/core/src/logging/builder/udp_attribute_builder.h b/ecal/core/src/logging/config/builder/udp_attribute_builder.h similarity index 95% rename from ecal/core/src/logging/builder/udp_attribute_builder.h rename to ecal/core/src/logging/config/builder/udp_attribute_builder.h index 569729d861..bead7d647e 100644 --- a/ecal/core/src/logging/builder/udp_attribute_builder.h +++ b/ecal/core/src/logging/config/builder/udp_attribute_builder.h @@ -23,7 +23,7 @@ #include "io/udp/ecal_udp_receiver_attr.h" #include "io/udp/ecal_udp_sender_attr.h" -#include "logging/attributes/logging_attributes.h" +#include "logging/config/attributes/logging_attributes.h" namespace eCAL { diff --git a/ecal/core/src/logging/ecal_log_impl.cpp b/ecal/core/src/logging/ecal_log_impl.cpp index 07118b44af..76f1d5b1e7 100644 --- a/ecal/core/src/logging/ecal_log_impl.cpp +++ b/ecal/core/src/logging/ecal_log_impl.cpp @@ -27,7 +27,7 @@ #include "ecal_log_impl.h" #include "serialization/ecal_serialize_logging.h" -#include "builder/udp_attribute_builder.h" +#include "config/builder/udp_attribute_builder.h" #include #include diff --git a/ecal/core/src/logging/ecal_log_impl.h b/ecal/core/src/logging/ecal_log_impl.h index 42a4749a85..03aa0210ac 100644 --- a/ecal/core/src/logging/ecal_log_impl.h +++ b/ecal/core/src/logging/ecal_log_impl.h @@ -33,7 +33,7 @@ #include #include -#include "attributes/logging_attributes.h" +#include "config/attributes/logging_attributes.h" #include "ecal_global_accessors.h" #include diff --git a/ecal/core/src/monitoring/attributes/monitoring_attributes.h b/ecal/core/src/monitoring/config/attributes/monitoring_attributes.h similarity index 100% rename from ecal/core/src/monitoring/attributes/monitoring_attributes.h rename to ecal/core/src/monitoring/config/attributes/monitoring_attributes.h diff --git a/ecal/core/src/monitoring/ecal_monitoring_def.h b/ecal/core/src/monitoring/ecal_monitoring_def.h index f903ff32fe..647cd8bc92 100644 --- a/ecal/core/src/monitoring/ecal_monitoring_def.h +++ b/ecal/core/src/monitoring/ecal_monitoring_def.h @@ -25,7 +25,7 @@ #include -#include "attributes/monitoring_attributes.h" +#include "config/attributes/monitoring_attributes.h" #include #include diff --git a/ecal/core/src/monitoring/ecal_monitoring_filter.h b/ecal/core/src/monitoring/ecal_monitoring_filter.h index c883db5e37..0eff9a3e53 100644 --- a/ecal/core/src/monitoring/ecal_monitoring_filter.h +++ b/ecal/core/src/monitoring/ecal_monitoring_filter.h @@ -25,7 +25,7 @@ #include #include -#include "monitoring/attributes/monitoring_attributes.h" +#include "monitoring/config/attributes/monitoring_attributes.h" namespace eCAL { diff --git a/ecal/core/src/monitoring/ecal_monitoring_impl.h b/ecal/core/src/monitoring/ecal_monitoring_impl.h index 9e9b120f5b..8a8f18bef2 100644 --- a/ecal/core/src/monitoring/ecal_monitoring_impl.h +++ b/ecal/core/src/monitoring/ecal_monitoring_impl.h @@ -26,7 +26,7 @@ #include #include "ecal_def.h" -#include "monitoring/attributes/monitoring_attributes.h" +#include "monitoring/config/attributes/monitoring_attributes.h" #include "monitoring/ecal_monitoring_filter.h" #include "serialization/ecal_serialize_sample_registration.h" diff --git a/ecal/core/src/registration/attributes/registration_attributes.h b/ecal/core/src/registration/config/attributes/registration_attributes.h similarity index 100% rename from ecal/core/src/registration/attributes/registration_attributes.h rename to ecal/core/src/registration/config/attributes/registration_attributes.h diff --git a/ecal/core/src/registration/attributes/sample_applier_attributes.h b/ecal/core/src/registration/config/attributes/sample_applier_attributes.h similarity index 100% rename from ecal/core/src/registration/attributes/sample_applier_attributes.h rename to ecal/core/src/registration/config/attributes/sample_applier_attributes.h diff --git a/ecal/core/src/registration/builder/sample_applier_attribute_builder.cpp b/ecal/core/src/registration/config/builder/sample_applier_attribute_builder.cpp similarity index 100% rename from ecal/core/src/registration/builder/sample_applier_attribute_builder.cpp rename to ecal/core/src/registration/config/builder/sample_applier_attribute_builder.cpp diff --git a/ecal/core/src/registration/builder/sample_applier_attribute_builder.h b/ecal/core/src/registration/config/builder/sample_applier_attribute_builder.h similarity index 87% rename from ecal/core/src/registration/builder/sample_applier_attribute_builder.h rename to ecal/core/src/registration/config/builder/sample_applier_attribute_builder.h index e9d4ce337b..b8af9a45fd 100644 --- a/ecal/core/src/registration/builder/sample_applier_attribute_builder.h +++ b/ecal/core/src/registration/config/builder/sample_applier_attribute_builder.h @@ -19,8 +19,8 @@ #pragma once -#include "registration/attributes/registration_attributes.h" -#include "registration/attributes/sample_applier_attributes.h" +#include "registration/config/attributes/registration_attributes.h" +#include "registration/config/attributes/sample_applier_attributes.h" namespace eCAL { diff --git a/ecal/core/src/registration/builder/udp_shm_attribute_builder.cpp b/ecal/core/src/registration/config/builder/udp_shm_attribute_builder.cpp similarity index 100% rename from ecal/core/src/registration/builder/udp_shm_attribute_builder.cpp rename to ecal/core/src/registration/config/builder/udp_shm_attribute_builder.cpp diff --git a/ecal/core/src/registration/builder/udp_shm_attribute_builder.h b/ecal/core/src/registration/config/builder/udp_shm_attribute_builder.h similarity index 79% rename from ecal/core/src/registration/builder/udp_shm_attribute_builder.h rename to ecal/core/src/registration/config/builder/udp_shm_attribute_builder.h index 1fefc8e02b..1ee7a14227 100644 --- a/ecal/core/src/registration/builder/udp_shm_attribute_builder.h +++ b/ecal/core/src/registration/config/builder/udp_shm_attribute_builder.h @@ -19,10 +19,10 @@ #pragma once -#include "registration/udp/attributes/registration_sender_udp_attributes.h" -#include "registration/udp/attributes/registration_receiver_udp_attributes.h" -#include "registration/shm/attributes/registration_shm_attributes.h" -#include "registration/attributes/registration_attributes.h" +#include "registration/udp/config/attributes/registration_sender_udp_attributes.h" +#include "registration/udp/config/attributes/registration_receiver_udp_attributes.h" +#include "registration/shm/config/attributes/registration_shm_attributes.h" +#include "registration/config/attributes/registration_attributes.h" namespace eCAL diff --git a/ecal/core/src/registration/ecal_process_registration.cpp b/ecal/core/src/registration/ecal_process_registration.cpp index 34b6104a89..465193dd34 100644 --- a/ecal/core/src/registration/ecal_process_registration.cpp +++ b/ecal/core/src/registration/ecal_process_registration.cpp @@ -38,6 +38,9 @@ eCAL::Registration::Sample eCAL::Registration::GetProcessRegisterSample() auto& process_sample_identifier = process_sample.identifier; process_sample_identifier.host_name = eCAL::Process::GetHostName(); process_sample_identifier.process_id = eCAL::Process::GetProcessID(); + // We need to set the pid as entity_id. + // However, we cannot send anything over the wire :( + process_sample_identifier.entity_id = std::to_string(process_sample_identifier.process_id); auto& process_sample_process = process_sample.process; process_sample_process.hgname = eCAL::Process::GetHostGroupName(); diff --git a/ecal/core/src/registration/ecal_registration_provider.cpp b/ecal/core/src/registration/ecal_registration_provider.cpp index b5e0a62b11..88be21131d 100644 --- a/ecal/core/src/registration/ecal_registration_provider.cpp +++ b/ecal/core/src/registration/ecal_registration_provider.cpp @@ -45,7 +45,7 @@ #include #endif -#include "builder/udp_shm_attribute_builder.h" +#include "config/builder/udp_shm_attribute_builder.h" namespace eCAL diff --git a/ecal/core/src/registration/ecal_registration_provider.h b/ecal/core/src/registration/ecal_registration_provider.h index 4746311575..cba3e35ff7 100644 --- a/ecal/core/src/registration/ecal_registration_provider.h +++ b/ecal/core/src/registration/ecal_registration_provider.h @@ -31,7 +31,7 @@ #include "registration/ecal_registration_sender.h" #include "util/ecal_thread.h" -#include "attributes/registration_attributes.h" +#include "config/attributes/registration_attributes.h" #include #include diff --git a/ecal/core/src/registration/ecal_registration_receiver.cpp b/ecal/core/src/registration/ecal_registration_receiver.cpp index 089c0d0ad7..2a688654f1 100644 --- a/ecal/core/src/registration/ecal_registration_receiver.cpp +++ b/ecal/core/src/registration/ecal_registration_receiver.cpp @@ -42,8 +42,8 @@ #include #include -#include "builder/udp_shm_attribute_builder.h" -#include "builder/sample_applier_attribute_builder.h" +#include "config/builder/udp_shm_attribute_builder.h" +#include "config/builder/sample_applier_attribute_builder.h" namespace eCAL { diff --git a/ecal/core/src/registration/ecal_registration_receiver.h b/ecal/core/src/registration/ecal_registration_receiver.h index dff0c41d2b..91ca5d8592 100644 --- a/ecal/core/src/registration/ecal_registration_receiver.h +++ b/ecal/core/src/registration/ecal_registration_receiver.h @@ -34,7 +34,7 @@ #include "registration/ecal_registration_sample_applier.h" #include "registration/ecal_registration_sample_applier_gates.h" #include "registration/ecal_registration_sample_applier_user.h" -#include "attributes/registration_attributes.h" +#include "config/attributes/registration_attributes.h" #include #include diff --git a/ecal/core/src/registration/ecal_registration_sample_applier.h b/ecal/core/src/registration/ecal_registration_sample_applier.h index 5007f2e9d8..7b313de4a7 100644 --- a/ecal/core/src/registration/ecal_registration_sample_applier.h +++ b/ecal/core/src/registration/ecal_registration_sample_applier.h @@ -29,7 +29,7 @@ #include #include "serialization/ecal_struct_sample_registration.h" -#include "attributes/sample_applier_attributes.h" +#include "config/attributes/sample_applier_attributes.h" #include #include diff --git a/ecal/core/src/registration/shm/attributes/registration_shm_attributes.h b/ecal/core/src/registration/shm/config/attributes/registration_shm_attributes.h similarity index 100% rename from ecal/core/src/registration/shm/attributes/registration_shm_attributes.h rename to ecal/core/src/registration/shm/config/attributes/registration_shm_attributes.h diff --git a/ecal/core/src/registration/shm/ecal_memfile_broadcast.h b/ecal/core/src/registration/shm/ecal_memfile_broadcast.h index d8a183d68e..d7e76275cc 100644 --- a/ecal/core/src/registration/shm/ecal_memfile_broadcast.h +++ b/ecal/core/src/registration/shm/ecal_memfile_broadcast.h @@ -32,7 +32,7 @@ #include "relocatable_circular_queue.h" #include "io/shm/ecal_memfile.h" -#include "attributes/registration_shm_attributes.h" +#include "config/attributes/registration_shm_attributes.h" #include diff --git a/ecal/core/src/registration/shm/ecal_registration_receiver_shm.h b/ecal/core/src/registration/shm/ecal_registration_receiver_shm.h index 4164e76bf9..ad4f1d6501 100644 --- a/ecal/core/src/registration/shm/ecal_registration_receiver_shm.h +++ b/ecal/core/src/registration/shm/ecal_registration_receiver_shm.h @@ -29,7 +29,7 @@ #include #include -#include "attributes/registration_shm_attributes.h" +#include "config/attributes/registration_shm_attributes.h" namespace eCAL { diff --git a/ecal/core/src/registration/shm/ecal_registration_sender_shm.h b/ecal/core/src/registration/shm/ecal_registration_sender_shm.h index f67ba0de80..88f0a312c0 100644 --- a/ecal/core/src/registration/shm/ecal_registration_sender_shm.h +++ b/ecal/core/src/registration/shm/ecal_registration_sender_shm.h @@ -33,7 +33,7 @@ #include "registration/shm/ecal_memfile_broadcast.h" #include "registration/shm/ecal_memfile_broadcast_writer.h" -#include "attributes/registration_shm_attributes.h" +#include "config/attributes/registration_shm_attributes.h" #include diff --git a/ecal/core/src/registration/udp/attributes/registration_receiver_udp_attributes.h b/ecal/core/src/registration/udp/config/attributes/registration_receiver_udp_attributes.h similarity index 100% rename from ecal/core/src/registration/udp/attributes/registration_receiver_udp_attributes.h rename to ecal/core/src/registration/udp/config/attributes/registration_receiver_udp_attributes.h diff --git a/ecal/core/src/registration/udp/attributes/registration_sender_udp_attributes.h b/ecal/core/src/registration/udp/config/attributes/registration_sender_udp_attributes.h similarity index 100% rename from ecal/core/src/registration/udp/attributes/registration_sender_udp_attributes.h rename to ecal/core/src/registration/udp/config/attributes/registration_sender_udp_attributes.h diff --git a/ecal/core/src/registration/udp/builder/udp_attribute_builder.cpp b/ecal/core/src/registration/udp/config/builder/udp_attribute_builder.cpp similarity index 100% rename from ecal/core/src/registration/udp/builder/udp_attribute_builder.cpp rename to ecal/core/src/registration/udp/config/builder/udp_attribute_builder.cpp diff --git a/ecal/core/src/registration/udp/builder/udp_attribute_builder.h b/ecal/core/src/registration/udp/config/builder/udp_attribute_builder.h similarity index 87% rename from ecal/core/src/registration/udp/builder/udp_attribute_builder.h rename to ecal/core/src/registration/udp/config/builder/udp_attribute_builder.h index beb1525209..84e153bcc6 100644 --- a/ecal/core/src/registration/udp/builder/udp_attribute_builder.h +++ b/ecal/core/src/registration/udp/config/builder/udp_attribute_builder.h @@ -23,8 +23,8 @@ #include "io/udp/ecal_udp_receiver_attr.h" #include "io/udp/ecal_udp_sender_attr.h" -#include "registration/udp/attributes/registration_sender_udp_attributes.h" -#include "registration/udp/attributes/registration_receiver_udp_attributes.h" +#include "registration/udp/config/attributes/registration_sender_udp_attributes.h" +#include "registration/udp/config/attributes/registration_receiver_udp_attributes.h" namespace eCAL { diff --git a/ecal/core/src/registration/udp/ecal_registration_receiver_udp.cpp b/ecal/core/src/registration/udp/ecal_registration_receiver_udp.cpp index 8d5f9249d9..1d7c39c330 100644 --- a/ecal/core/src/registration/udp/ecal_registration_receiver_udp.cpp +++ b/ecal/core/src/registration/udp/ecal_registration_receiver_udp.cpp @@ -24,7 +24,7 @@ #include "serialization/ecal_serialize_sample_registration.h" #include -#include "registration/udp/builder/udp_attribute_builder.h" +#include "registration/udp/config/builder/udp_attribute_builder.h" using namespace eCAL; diff --git a/ecal/core/src/registration/udp/ecal_registration_receiver_udp.h b/ecal/core/src/registration/udp/ecal_registration_receiver_udp.h index bcbe66fa4d..cbab155112 100644 --- a/ecal/core/src/registration/udp/ecal_registration_receiver_udp.h +++ b/ecal/core/src/registration/udp/ecal_registration_receiver_udp.h @@ -26,7 +26,7 @@ #include #include -#include "registration/udp/attributes/registration_receiver_udp_attributes.h" +#include "registration/udp/config/attributes/registration_receiver_udp_attributes.h" namespace eCAL { diff --git a/ecal/core/src/registration/udp/ecal_registration_sender_udp.cpp b/ecal/core/src/registration/udp/ecal_registration_sender_udp.cpp index 26efe9c11c..2a0fce3374 100644 --- a/ecal/core/src/registration/udp/ecal_registration_sender_udp.cpp +++ b/ecal/core/src/registration/udp/ecal_registration_sender_udp.cpp @@ -32,7 +32,7 @@ #include "io/udp/ecal_udp_configurations.h" #include -#include "registration/udp/builder/udp_attribute_builder.h" +#include "registration/udp/config/builder/udp_attribute_builder.h" namespace eCAL { diff --git a/ecal/core/src/registration/udp/ecal_registration_sender_udp.h b/ecal/core/src/registration/udp/ecal_registration_sender_udp.h index c0a8e12511..f39fc97a76 100644 --- a/ecal/core/src/registration/udp/ecal_registration_sender_udp.h +++ b/ecal/core/src/registration/udp/ecal_registration_sender_udp.h @@ -29,7 +29,7 @@ #include "registration/ecal_registration_sender.h" #include "io/udp/ecal_udp_sample_sender.h" -#include "registration/udp/attributes/registration_sender_udp_attributes.h" +#include "registration/udp/config/attributes/registration_sender_udp_attributes.h" namespace eCAL { diff --git a/ecal/core/src/serialization/ecal_serialize_common.cpp b/ecal/core/src/serialization/ecal_serialize_common.cpp index 53fcb8d1f3..13d0649240 100644 --- a/ecal/core/src/serialization/ecal_serialize_common.cpp +++ b/ecal/core/src/serialization/ecal_serialize_common.cpp @@ -22,7 +22,7 @@ * @brief eCAL common (de)serialization **/ -#include "nanopb/ecal.pb.h" +#include "nanopb/ecal/core/pb/ecal.npb.h" #include "nanopb/pb_decode.h" #include "nanopb/pb_encode.h" #include diff --git a/ecal/core/src/serialization/ecal_serialize_logging.cpp b/ecal/core/src/serialization/ecal_serialize_logging.cpp index ef67992538..89c75664cb 100644 --- a/ecal/core/src/serialization/ecal_serialize_logging.cpp +++ b/ecal/core/src/serialization/ecal_serialize_logging.cpp @@ -24,7 +24,7 @@ #include "nanopb/pb_encode.h" #include "nanopb/pb_decode.h" -#include "nanopb/logging.pb.h" +#include "nanopb/ecal/core/pb/logging.npb.h" #include "ecal_serialize_common.h" #include "ecal_serialize_logging.h" diff --git a/ecal/core/src/serialization/ecal_serialize_monitoring.cpp b/ecal/core/src/serialization/ecal_serialize_monitoring.cpp index 5e0bd04a52..59fafbff19 100644 --- a/ecal/core/src/serialization/ecal_serialize_monitoring.cpp +++ b/ecal/core/src/serialization/ecal_serialize_monitoring.cpp @@ -24,7 +24,7 @@ #include "nanopb/pb_encode.h" #include "nanopb/pb_decode.h" -#include "nanopb/monitoring.pb.h" +#include "nanopb/ecal/core/pb/monitoring.npb.h" #include "ecal_serialize_common.h" #include "ecal_serialize_monitoring.h" diff --git a/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp b/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp index da891ed1f8..f80ceb2776 100644 --- a/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp +++ b/ecal/core/src/serialization/ecal_serialize_sample_payload.cpp @@ -24,7 +24,7 @@ #include "nanopb/pb_encode.h" #include "nanopb/pb_decode.h" -#include "nanopb/ecal.pb.h" +#include "nanopb/ecal/core/pb/ecal.npb.h" #include "ecal_serialize_common.h" #include "ecal_struct_sample_payload.h" diff --git a/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp b/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp index 761e103bfc..744f6ebd33 100644 --- a/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp +++ b/ecal/core/src/serialization/ecal_serialize_sample_registration.cpp @@ -24,7 +24,7 @@ #include "nanopb/pb_encode.h" #include "nanopb/pb_decode.h" -#include "nanopb/ecal.pb.h" +#include "nanopb/ecal/core/pb/ecal.npb.h" #include "ecal_serialize_common.h" #include "ecal_serialize_sample_registration.h" @@ -407,6 +407,8 @@ namespace registration_.process.rclock = pb_sample_.process.rclock; // pid registration_.identifier.process_id = pb_sample_.process.pid; + // tid -> we need to use the PID here, because we don't have a designated field for it + registration_.identifier.entity_id = std::to_string(registration_.identifier.process_id); // state.severity registration_.process.state.severity = static_cast(pb_sample_.process.state.severity); // state.severity_level diff --git a/ecal/core/src/serialization/ecal_serialize_service.cpp b/ecal/core/src/serialization/ecal_serialize_service.cpp index 9bf6260d51..08902c537b 100644 --- a/ecal/core/src/serialization/ecal_serialize_service.cpp +++ b/ecal/core/src/serialization/ecal_serialize_service.cpp @@ -24,7 +24,7 @@ #include "nanopb/pb_encode.h" #include "nanopb/pb_decode.h" -#include "nanopb/ecal.pb.h" +#include "nanopb/ecal/core/pb/ecal.npb.h" #include "ecal_serialize_common.h" #include "ecal_serialize_service.h" diff --git a/ecal/core/src/serialization/nanopb/ecal.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.c similarity index 85% rename from ecal/core/src/serialization/nanopb/ecal.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.c index aaf947bc7f..cd260f71d8 100644 --- a/ecal/core/src/serialization/nanopb/ecal.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "ecal.pb.h" +#include "ecal.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif @@ -17,3 +17,4 @@ PB_BIND(eCAL_pb_SampleList, eCAL_pb_SampleList, AUTO) + diff --git a/ecal/core/src/serialization/nanopb/ecal.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.h similarity index 96% rename from ecal/core/src/serialization/nanopb/ecal.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.h index 8711ae4c83..d77987cb4d 100644 --- a/ecal/core/src/serialization/nanopb/ecal.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.h @@ -1,13 +1,13 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_ECAL_PB_H_INCLUDED -#define PB_ECAL_PB_ECAL_PB_H_INCLUDED +#ifndef PB_ECAL_PB_ECAL_NPB_H_INCLUDED +#define PB_ECAL_PB_ECAL_NPB_H_INCLUDED #include -#include "host.pb.h" -#include "process.pb.h" -#include "service.pb.h" -#include "topic.pb.h" +#include "ecal/core/pb/host.npb.h" +#include "ecal/core/pb/process.npb.h" +#include "ecal/core/pb/service.npb.h" +#include "ecal/core/pb/topic.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/ecal/core/src/serialization/nanopb/host.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.c similarity index 83% rename from ecal/core/src/serialization/nanopb/host.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.c index e7720239c7..54b6cb5e8f 100644 --- a/ecal/core/src/serialization/nanopb/host.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "host.pb.h" +#include "host.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/ecal/core/src/serialization/nanopb/host.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h similarity index 95% rename from ecal/core/src/serialization/nanopb/host.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h index 63d43d6fd2..adc7f50269 100644 --- a/ecal/core/src/serialization/nanopb/host.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/host.npb.h @@ -1,8 +1,8 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_HOST_PB_H_INCLUDED -#define PB_ECAL_PB_HOST_PB_H_INCLUDED +#ifndef PB_ECAL_PB_HOST_NPB_H_INCLUDED +#define PB_ECAL_PB_HOST_NPB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 diff --git a/ecal/core/src/serialization/nanopb/layer.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c similarity index 89% rename from ecal/core/src/serialization/nanopb/layer.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c index 876144d582..aa8ba1cfb6 100644 --- a/ecal/core/src/serialization/nanopb/layer.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "layer.pb.h" +#include "layer.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif @@ -23,3 +23,4 @@ PB_BIND(eCAL_pb_TLayer, eCAL_pb_TLayer, AUTO) + diff --git a/ecal/core/src/serialization/nanopb/layer.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h similarity index 97% rename from ecal/core/src/serialization/nanopb/layer.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h index 64f39f35ff..56e6ddac1a 100644 --- a/ecal/core/src/serialization/nanopb/layer.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h @@ -1,8 +1,8 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_LAYER_PB_H_INCLUDED -#define PB_ECAL_PB_LAYER_PB_H_INCLUDED +#ifndef PB_ECAL_PB_LAYER_NPB_H_INCLUDED +#define PB_ECAL_PB_LAYER_NPB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 @@ -150,7 +150,7 @@ extern const pb_msgdesc_t eCAL_pb_TLayer_msg; /* eCAL_pb_LayerParShm_size depends on runtime parameters */ /* eCAL_pb_ConnnectionPar_size depends on runtime parameters */ /* eCAL_pb_TLayer_size depends on runtime parameters */ -#define ECAL_PB_LAYER_PB_H_MAX_SIZE eCAL_pb_LayerParTcp_size +#define ECAL_PB_LAYER_NPB_H_MAX_SIZE eCAL_pb_LayerParTcp_size #define eCAL_pb_LayerParTcp_size 11 #define eCAL_pb_LayerParUdpMC_size 0 diff --git a/ecal/core/src/serialization/nanopb/logging.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.c similarity index 83% rename from ecal/core/src/serialization/nanopb/logging.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.c index aba64cb7e0..a00a3e9e3f 100644 --- a/ecal/core/src/serialization/nanopb/logging.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "logging.pb.h" +#include "logging.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/ecal/core/src/serialization/nanopb/logging.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h similarity index 96% rename from ecal/core/src/serialization/nanopb/logging.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h index 696fa02971..1a71f1f174 100644 --- a/ecal/core/src/serialization/nanopb/logging.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h @@ -1,8 +1,8 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_LOGGING_PB_H_INCLUDED -#define PB_ECAL_PB_LOGGING_PB_H_INCLUDED +#ifndef PB_ECAL_PB_LOGGING_NPB_H_INCLUDED +#define PB_ECAL_PB_LOGGING_NPB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 diff --git a/ecal/core/src/serialization/nanopb/monitoring.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.c similarity index 79% rename from ecal/core/src/serialization/nanopb/monitoring.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.c index e512c68e58..f1332cbab4 100644 --- a/ecal/core/src/serialization/nanopb/monitoring.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "monitoring.pb.h" +#include "monitoring.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/ecal/core/src/serialization/nanopb/monitoring.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.h similarity index 89% rename from ecal/core/src/serialization/nanopb/monitoring.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.h index e6cc1dbc4d..24f535965e 100644 --- a/ecal/core/src/serialization/nanopb/monitoring.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.h @@ -1,13 +1,13 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_MONITORING_PB_H_INCLUDED -#define PB_ECAL_PB_MONITORING_PB_H_INCLUDED +#ifndef PB_ECAL_PB_MONITORING_NPB_H_INCLUDED +#define PB_ECAL_PB_MONITORING_NPB_H_INCLUDED #include -#include "host.pb.h" -#include "process.pb.h" -#include "service.pb.h" -#include "topic.pb.h" +#include "ecal/core/pb/host.npb.h" +#include "ecal/core/pb/process.npb.h" +#include "ecal/core/pb/service.npb.h" +#include "ecal/core/pb/topic.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/ecal/core/src/serialization/nanopb/process.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.c similarity index 82% rename from ecal/core/src/serialization/nanopb/process.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.c index 60dfc2db46..adecbca87b 100644 --- a/ecal/core/src/serialization/nanopb/process.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "process.pb.h" +#include "process.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif @@ -16,3 +16,6 @@ PB_BIND(eCAL_pb_Process, eCAL_pb_Process, AUTO) + + + diff --git a/ecal/core/src/serialization/nanopb/process.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h similarity index 98% rename from ecal/core/src/serialization/nanopb/process.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h index 592f0b5f17..7139ac4960 100644 --- a/ecal/core/src/serialization/nanopb/process.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/process.npb.h @@ -1,8 +1,8 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_PROCESS_PB_H_INCLUDED -#define PB_ECAL_PB_PROCESS_PB_H_INCLUDED +#ifndef PB_ECAL_PB_PROCESS_NPB_H_INCLUDED +#define PB_ECAL_PB_PROCESS_NPB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 diff --git a/ecal/core/src/serialization/nanopb/service.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.c similarity index 89% rename from ecal/core/src/serialization/nanopb/service.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.c index 9a2b53399c..77181a02b1 100644 --- a/ecal/core/src/serialization/nanopb/service.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "service.pb.h" +#include "service.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif @@ -26,3 +26,4 @@ PB_BIND(eCAL_pb_Client, eCAL_pb_Client, AUTO) + diff --git a/ecal/core/src/serialization/nanopb/service.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.h similarity index 98% rename from ecal/core/src/serialization/nanopb/service.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.h index 611f224e07..f60c1b2ce6 100644 --- a/ecal/core/src/serialization/nanopb/service.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/service.npb.h @@ -1,8 +1,8 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_SERVICE_PB_H_INCLUDED -#define PB_ECAL_PB_SERVICE_PB_H_INCLUDED +#ifndef PB_ECAL_PB_SERVICE_NPB_H_INCLUDED +#define PB_ECAL_PB_SERVICE_NPB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 diff --git a/ecal/core/src/serialization/nanopb/topic.pb.c b/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.c similarity index 86% rename from ecal/core/src/serialization/nanopb/topic.pb.c rename to ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.c index 7b8316dd23..85f7d1970a 100644 --- a/ecal/core/src/serialization/nanopb/topic.pb.c +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.c @@ -1,7 +1,7 @@ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#include "topic.pb.h" +#include "topic.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif diff --git a/ecal/core/src/serialization/nanopb/topic.pb.h b/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h similarity index 97% rename from ecal/core/src/serialization/nanopb/topic.pb.h rename to ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h index c7eb1ffc22..97993e98a4 100644 --- a/ecal/core/src/serialization/nanopb/topic.pb.h +++ b/ecal/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h @@ -1,10 +1,10 @@ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.4.8 */ +/* Generated by nanopb-0.4.9 */ -#ifndef PB_ECAL_PB_TOPIC_PB_H_INCLUDED -#define PB_ECAL_PB_TOPIC_PB_H_INCLUDED +#ifndef PB_ECAL_PB_TOPIC_NPB_H_INCLUDED +#define PB_ECAL_PB_TOPIC_NPB_H_INCLUDED #include -#include "layer.pb.h" +#include "ecal/core/pb/layer.npb.h" #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. diff --git a/ecal/core/src/serialization/nanopb/nanopb/pb.h b/ecal/core/src/serialization/nanopb/pb.h similarity index 99% rename from ecal/core/src/serialization/nanopb/nanopb/pb.h rename to ecal/core/src/serialization/nanopb/pb.h index c7a055f08f..1bff70e4e6 100644 --- a/ecal/core/src/serialization/nanopb/nanopb/pb.h +++ b/ecal/core/src/serialization/nanopb/pb.h @@ -65,7 +65,7 @@ /* Version of the nanopb library. Just in case you want to check it in * your own program. */ -#define NANOPB_VERSION "nanopb-0.4.8" +#define NANOPB_VERSION "nanopb-0.4.9" /* Include all the system headers needed by nanopb. You will need the * definitions of the following: @@ -215,12 +215,23 @@ PB_STATIC_ASSERT(1, STATIC_ASSERT_IS_NOT_WORKING) #endif #endif +/* Data type for storing encoded data and other byte streams. + * This typedef exists to support platforms where uint8_t does not exist. + * You can regard it as equivalent on uint8_t on other platforms. + */ +#if defined(PB_BYTE_T_OVERRIDE) +typedef PB_BYTE_T_OVERRIDE pb_byte_t; +#elif defined(UINT8_MAX) +typedef uint8_t pb_byte_t; +#else +typedef uint_least8_t pb_byte_t; +#endif + /* List of possible field types. These are used in the autogenerated code. * Least-significant 4 bits tell the scalar type * Most-significant 4 bits specify repeated/required/packed etc. */ - -typedef uint_least8_t pb_type_t; +typedef pb_byte_t pb_type_t; /**** Field data types ****/ @@ -301,12 +312,6 @@ typedef uint_least8_t pb_type_t; #endif #define PB_SIZE_MAX ((pb_size_t)-1) -/* Data type for storing encoded data and other byte streams. - * This typedef exists to support platforms where uint8_t does not exist. - * You can regard it as equivalent on uint8_t on other platforms. - */ -typedef uint_least8_t pb_byte_t; - /* Forward declaration of struct types */ typedef struct pb_istream_s pb_istream_t; typedef struct pb_ostream_s pb_ostream_t; diff --git a/ecal/core/src/serialization/nanopb/nanopb/pb_common.c b/ecal/core/src/serialization/nanopb/pb_common.c similarity index 100% rename from ecal/core/src/serialization/nanopb/nanopb/pb_common.c rename to ecal/core/src/serialization/nanopb/pb_common.c diff --git a/ecal/core/src/serialization/nanopb/nanopb/pb_common.h b/ecal/core/src/serialization/nanopb/pb_common.h similarity index 100% rename from ecal/core/src/serialization/nanopb/nanopb/pb_common.h rename to ecal/core/src/serialization/nanopb/pb_common.h diff --git a/ecal/core/src/serialization/nanopb/nanopb/pb_decode.c b/ecal/core/src/serialization/nanopb/pb_decode.c similarity index 99% rename from ecal/core/src/serialization/nanopb/nanopb/pb_decode.c rename to ecal/core/src/serialization/nanopb/pb_decode.c index 788998eb96..068306a053 100644 --- a/ecal/core/src/serialization/nanopb/nanopb/pb_decode.c +++ b/ecal/core/src/serialization/nanopb/pb_decode.c @@ -4,13 +4,14 @@ */ /* Use the GCC warn_unused_result attribute to check that all return values - * are propagated correctly. On other compilers and gcc before 3.4.0 just - * ignore the annotation. + * are propagated correctly. On other compilers, gcc before 3.4.0 and iar + * before 9.40.1 just ignore the annotation. */ -#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) - #define checkreturn -#else +#if (defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))) || \ + (defined(__IAR_SYSTEMS_ICC__) && (__VER__ >= 9040001)) #define checkreturn __attribute__((warn_unused_result)) +#else + #define checkreturn #endif #include "pb.h" diff --git a/ecal/core/src/serialization/nanopb/nanopb/pb_decode.h b/ecal/core/src/serialization/nanopb/pb_decode.h similarity index 92% rename from ecal/core/src/serialization/nanopb/nanopb/pb_decode.h rename to ecal/core/src/serialization/nanopb/pb_decode.h index ae1d3ccf2e..3f392b2938 100644 --- a/ecal/core/src/serialization/nanopb/nanopb/pb_decode.h +++ b/ecal/core/src/serialization/nanopb/pb_decode.h @@ -37,10 +37,21 @@ struct pb_istream_s bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count); #endif - void *state; /* Free field for use by callback implementation */ + /* state is a free field for use of the callback function defined above. + * Note that when pb_istream_from_buffer() is used, it reserves this field + * for its own use. + */ + void *state; + + /* Maximum number of bytes left in this stream. Callback can report + * EOF before this limit is reached. Setting a limit is recommended + * when decoding directly from file or network streams to avoid + * denial-of-service by excessively long messages. + */ size_t bytes_left; #ifndef PB_NO_ERRMSG + /* Pointer to constant (ROM) string when decoding function returns error */ const char *errmsg; #endif }; diff --git a/ecal/core/src/serialization/nanopb/nanopb/pb_encode.c b/ecal/core/src/serialization/nanopb/pb_encode.c similarity index 99% rename from ecal/core/src/serialization/nanopb/nanopb/pb_encode.c rename to ecal/core/src/serialization/nanopb/pb_encode.c index 7f56201255..f9034a5428 100644 --- a/ecal/core/src/serialization/nanopb/nanopb/pb_encode.c +++ b/ecal/core/src/serialization/nanopb/pb_encode.c @@ -8,13 +8,14 @@ #include "pb_common.h" /* Use the GCC warn_unused_result attribute to check that all return values - * are propagated correctly. On other compilers and gcc before 3.4.0 just - * ignore the annotation. + * are propagated correctly. On other compilers, gcc before 3.4.0 and iar + * before 9.40.1 just ignore the annotation. */ -#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) - #define checkreturn -#else +#if (defined(__GNUC__) && ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))) || \ + (defined(__IAR_SYSTEMS_ICC__) && (__VER__ >= 9040001)) #define checkreturn __attribute__((warn_unused_result)) +#else + #define checkreturn #endif /************************************** diff --git a/ecal/core/src/serialization/nanopb/nanopb/pb_encode.h b/ecal/core/src/serialization/nanopb/pb_encode.h similarity index 93% rename from ecal/core/src/serialization/nanopb/nanopb/pb_encode.h rename to ecal/core/src/serialization/nanopb/pb_encode.h index 891368322f..6dc089da30 100644 --- a/ecal/core/src/serialization/nanopb/nanopb/pb_encode.h +++ b/ecal/core/src/serialization/nanopb/pb_encode.h @@ -37,11 +37,21 @@ struct pb_ostream_s #else bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); #endif - void *state; /* Free field for use by callback implementation. */ - size_t max_size; /* Limit number of output bytes written (or use SIZE_MAX). */ - size_t bytes_written; /* Number of bytes written so far. */ + + /* state is a free field for use of the callback function defined above. + * Note that when pb_ostream_from_buffer() is used, it reserves this field + * for its own use. + */ + void *state; + + /* Limit number of output bytes written. Can be set to SIZE_MAX. */ + size_t max_size; + + /* Number of bytes written so far. */ + size_t bytes_written; #ifndef PB_NO_ERRMSG + /* Pointer to constant (ROM) string when decoding function returns error */ const char *errmsg; #endif }; diff --git a/ecal/tests/cpp/serialization_test/CMakeLists.txt b/ecal/tests/cpp/serialization_test/CMakeLists.txt index 4554421303..2ae63f551c 100644 --- a/ecal/tests/cpp/serialization_test/CMakeLists.txt +++ b/ecal/tests/cpp/serialization_test/CMakeLists.txt @@ -22,32 +22,32 @@ find_package(Threads REQUIRED) find_package(GTest REQUIRED) set(nanopb_lib_src - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/nanopb/pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/nanopb/pb_common.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/nanopb/pb_common.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/nanopb/pb_decode.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/nanopb/pb_decode.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/nanopb/pb_encode.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/nanopb/pb_encode.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/pb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/pb_common.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/pb_common.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/pb_decode.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/pb_decode.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/pb_encode.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/pb_encode.h ) set(nanopb_generated_src - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal.pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/host.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/host.pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/layer.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/layer.pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/logging.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/logging.pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/monitoring.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/monitoring.pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/process.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/process.pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/service.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/service.pb.h - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/topic.pb.c - ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/topic.pb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/ecal.npb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/host.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/host.npb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/layer.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/layer.npb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/logging.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/logging.npb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/monitoring.npb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/process.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/process.npb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/service.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/service.npb.h + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/topic.npb.c + ${ECAL_CORE_PROJECT_ROOT}/core/src/serialization/nanopb/ecal/core/pb/topic.npb.h ) set(ecal_serialize_src diff --git a/ecal/tests/cpp/serialization_test/src/registration_generate.cpp b/ecal/tests/cpp/serialization_test/src/registration_generate.cpp index 1fd33ece09..79a90c545e 100644 --- a/ecal/tests/cpp/serialization_test/src/registration_generate.cpp +++ b/ecal/tests/cpp/serialization_test/src/registration_generate.cpp @@ -152,7 +152,7 @@ namespace eCAL sample.host.hname = GenerateString(8); sample.identifier = GenerateIdentifier(); // Process samples don't have an id internally, hence it must be 0. - sample.identifier.entity_id = ""; + sample.identifier.entity_id = std::to_string(sample.identifier.process_id); sample.process = GenerateProcess(); return sample; } diff --git a/lang/python/core/src/ecal_wrap.cxx b/lang/python/core/src/ecal_wrap.cxx index 9b81a728c0..9c8ea40cb3 100644 --- a/lang/python/core/src/ecal_wrap.cxx +++ b/lang/python/core/src/ecal_wrap.cxx @@ -813,7 +813,9 @@ PyObject* client_call_method(PyObject* /*self*/, PyObject* args) // (client_ha PyArg_ParseTuple(args, "nsy#i", &client_handle, &method_name, &request, &request_len, &timeout); bool called_method{ false }; - called_method = client_call_method(client_handle, method_name, request, (int)request_len, timeout); + Py_BEGIN_ALLOW_THREADS + called_method = client_call_method(client_handle, method_name, request, (int)request_len, timeout); + Py_END_ALLOW_THREADS return(Py_BuildValue("i", called_method)); } @@ -1301,7 +1303,8 @@ PyObject* mon_monitoring(PyObject* /*self*/, PyObject* /*args*/) } } - return(Py_BuildValue("iO", 0, retDict)); + auto* retVal = Py_BuildValue("iO", 0, retDict); Py_DECREF(retDict); + return(retVal); } /****************************************/ @@ -1341,7 +1344,8 @@ PyObject* mon_logging(PyObject* /*self*/, PyObject* /*args*/) } } - return(Py_BuildValue("iO", 0, retList)); + auto* retVal = Py_BuildValue("iO", 0, retList); Py_DECREF(retList); + return(retVal); } diff --git a/lang/python/ecalhdf5/ecal/measurement/measurement.py b/lang/python/ecalhdf5/ecal/measurement/measurement.py index fd230bdd25..720b5dda8c 100644 --- a/lang/python/ecalhdf5/ecal/measurement/measurement.py +++ b/lang/python/ecalhdf5/ecal/measurement/measurement.py @@ -1,6 +1,6 @@ # ========================= eCAL LICENSE ================================= # -# Copyright (C) 2016 - 2019 Continental Corporation +# Copyright (C) 2016 - 2024 Continental Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -191,8 +191,9 @@ def __init__(self, measurement, channel_type): self._measurement = measurement self._iterator = iter(measurement.channel_names) self._channel_type = channel_type + def __next__(self): - return self._channel_type(self._measurement, self._iterator.next()) + return self._channel_type(self._measurement, self._iterator.__next__()) def next(self): return self.__next__() @@ -212,7 +213,7 @@ def __getitem__(self, channel_name): return self._channel_type(self, channel_name) def __iter__(self): - return Measurement.Iterator(self) + return Measurement.Iterator(self, self._channel_type) def __repr__(self): return "< Measurement object: path: %s - number of channels: %i >" % (self._path, len(self.channel_names)) diff --git a/lang/python/ecalhdf5/src/ecalhdf5_wrap.cxx b/lang/python/ecalhdf5/src/ecalhdf5_wrap.cxx index 6d126db3ef..17da3f73d7 100644 --- a/lang/python/ecalhdf5/src/ecalhdf5_wrap.cxx +++ b/lang/python/ecalhdf5/src/ecalhdf5_wrap.cxx @@ -1,6 +1,6 @@ /* ========================= eCAL LICENSE ================================= * - * Copyright (C) 2016 - 2019 Continental Corporation + * Copyright (C) 2016 - 2024 Continental Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -178,7 +178,7 @@ static PyObject* Meas_GetChannelNames(Meas *self, PyObject* /*args*/) for (const auto& channel : channel_names) { PyObject* ch = Py_BuildValue("s", channel.c_str()); - PyList_Append(channels, ch); + PyList_Append(channels, ch); Py_DECREF(ch); } return channels;