From 09a3fe13c9b8b18e4d615e3b460709aa8e320f0a Mon Sep 17 00:00:00 2001 From: Thomas Kunze Date: Tue, 20 Aug 2024 01:22:25 +0200 Subject: [PATCH] change header paths --- src/CMakeLists.txt | 372 +++++++++--------- .../{app_layer => application_layer}/apdu.cpp | 5 +- .../{app_layer => application_layer}/apdu.h | 7 +- .../application_layer.cpp | 17 +- .../application_layer.h | 5 +- src/knx/bau/bau.h | 6 +- src/knx/bau/bau_systemB.cpp | 4 +- src/knx/bau/bau_systemB.h | 21 +- src/knx/bau/bau_systemB_device.cpp | 4 +- src/knx/bau/bau_systemB_device.h | 29 +- src/knx/cemi_server/cemi_server.cpp | 12 +- src/knx/cemi_server/cemi_server.h | 4 +- src/knx/cemi_server/cemi_server_object.cpp | 7 +- src/knx/cemi_server/cemi_server_object.h | 2 +- src/knx/cemi_server/usb_tunnel_interface.cpp | 6 +- src/knx/{bau => coupler}/bau091A.cpp | 3 +- src/knx/{bau => coupler}/bau091A.h | 13 +- src/knx/{bau => coupler}/bau2920.cpp | 8 +- src/knx/{bau => coupler}/bau2920.h | 12 +- .../{bau => coupler}/bau_systemB_coupler.cpp | 4 +- .../{bau => coupler}/bau_systemB_coupler.h | 23 +- .../network_layer_coupler.cpp | 10 +- .../network_layer_coupler.h | 9 +- .../router_object.cpp | 13 +- .../router_object.h | 7 +- .../data_secure/secure_application_layer.cpp | 27 +- .../data_secure/secure_application_layer.h | 8 +- .../data_secure/security_interface_object.cpp | 10 +- .../data_secure/security_interface_object.h | 6 +- src/knx/datalink_layer/cemi_frame.cpp | 8 +- src/knx/datalink_layer/cemi_frame.h | 14 +- src/knx/datalink_layer/data_link_layer.cpp | 11 +- src/knx/datalink_layer/data_link_layer.h | 21 +- src/knx/group_object/datapoint_types.cpp | 1 + src/knx/group_object/dpt.cpp | 7 +- src/knx/group_object/dptconvert.cpp | 4 +- src/knx/group_object/dptconvert.h | 4 +- src/knx/group_object/group_object.cpp | 8 +- src/knx/group_object/group_object.h | 5 +- .../interface_object/address_table_object.cpp | 10 +- .../application_program_object.cpp | 10 +- .../association_table_object.cpp | 10 +- src/knx/interface_object/data_property.cpp | 3 +- src/knx/interface_object/device_object.cpp | 10 +- .../group_object_table_object.cpp | 12 +- .../group_object_table_object.h | 2 +- src/knx/interface_object/interface_object.cpp | 8 +- src/knx/interface_object/interface_object.h | 10 +- src/knx/interface_object/property.cpp | 4 +- src/knx/interface_object/property.h | 3 +- src/knx/interface_object/table_object.cpp | 10 +- src/knx/{bau => ip}/bau57B0.cpp | 4 +- src/knx/{bau => ip}/bau57B0.h | 10 +- src/knx/ip/ip_data_link_layer.cpp | 13 +- src/knx/ip/ip_data_link_layer.h | 2 +- src/knx/ip/ip_parameter_object.cpp | 2 - src/knx/ip/ip_parameter_object.h | 5 +- src/knx/ip/knx_ip_frame.h | 2 +- src/knx/ip/knx_ip_routing_indication.h | 2 +- src/knx/ip/knx_ip_tunnel_connection.h | 2 +- src/knx/ip/knx_ip_tunneling_ack.h | 3 +- src/knx/knx_facade.cpp | 2 +- src/knx/knx_facade.h | 31 +- src/knx/network_layer/network_layer.cpp | 11 +- src/knx/network_layer/network_layer.h | 7 +- .../network_layer/network_layer_device.cpp | 11 +- src/knx/network_layer/network_layer_device.h | 8 +- .../network_layer/network_layer_entity.cpp | 9 +- src/knx/network_layer/network_layer_entity.h | 5 +- src/knx/network_layer/npdu.cpp | 8 +- src/knx/network_layer/npdu.h | 5 +- src/knx/{bau => rf}/bau27B0.cpp | 4 +- src/knx/{bau => rf}/bau27B0.h | 16 +- src/knx/rf/rf_data_link_layer.cpp | 13 +- src/knx/rf/rf_data_link_layer.h | 5 +- src/knx/rf/rf_medium_object.cpp | 6 +- src/knx/rf/rf_medium_object.h | 2 +- src/knx/rf/rf_physical_layer.h | 4 +- src/knx/rf/rf_physical_layer_cc1101.cpp | 2 +- src/knx/rf/rf_physical_layer_cc1101.h | 4 +- src/knx/rf/rf_physical_layer_cc1310.cpp | 16 +- src/knx/rf/rf_physical_layer_cc1310.h | 3 +- src/knx/{bau => tp}/bau07B0.cpp | 4 +- src/knx/{bau => tp}/bau07B0.h | 10 +- src/knx/tp/tp_frame.cpp | 1 + src/knx/tp/tp_frame.h | 7 +- src/knx/tp/tpuart_data_link_layer.cpp | 13 +- src/knx/tp/tpuart_data_link_layer.h | 3 +- src/knx/transport_layer/tpdu.cpp | 3 +- src/knx/transport_layer/tpdu.h | 8 +- src/knx/transport_layer/transport_layer.cpp | 14 +- src/knx/transport_layer/transport_layer.h | 9 +- src/knx/util/memory.cpp | 7 +- src/knx/util/memory.h | 6 +- 94 files changed, 591 insertions(+), 540 deletions(-) rename src/knx/{app_layer => application_layer}/apdu.cpp (93%) rename src/knx/{app_layer => application_layer}/apdu.h (94%) rename src/knx/{app_layer => application_layer}/application_layer.cpp (99%) rename src/knx/{app_layer => application_layer}/application_layer.h (99%) rename src/knx/{bau => coupler}/bau091A.cpp (99%) rename src/knx/{bau => coupler}/bau091A.h (82%) rename src/knx/{bau => coupler}/bau2920.cpp (98%) rename src/knx/{bau => coupler}/bau2920.h (80%) rename src/knx/{bau => coupler}/bau_systemB_coupler.cpp (98%) rename src/knx/{bau => coupler}/bau_systemB_coupler.h (59%) rename src/knx/{network_layer => coupler}/network_layer_coupler.cpp (99%) rename src/knx/{network_layer => coupler}/network_layer_coupler.h (97%) rename src/knx/{interface_object => coupler}/router_object.cpp (99%) rename src/knx/{interface_object => coupler}/router_object.h (95%) rename src/knx/{bau => ip}/bau57B0.cpp (99%) rename src/knx/{bau => ip}/bau57B0.h (80%) rename src/knx/{bau => rf}/bau27B0.cpp (99%) rename src/knx/{bau => rf}/bau27B0.h (85%) rename src/knx/{bau => tp}/bau07B0.cpp (99%) rename src/knx/{bau => tp}/bau07B0.h (79%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd0c71c..0bec88f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,185 +3,199 @@ project(knx-linux VERSION 1.5) set(LIBRARIES_FROM_REFERENCES "") set(SOURCES -knx/address_table_object.cpp -knx/address_table_object.h -knx/apdu.cpp -knx/apdu.h -knx/application_layer.cpp -knx/application_layer.h -knx/application_program_object.cpp -knx/application_program_object.h -knx/association_table_object.cpp -knx/association_table_object.h -knx/bau.cpp -knx/bau.h -knx/bau07B0.cpp -knx/bau07B0.h -knx/bau091A.cpp -knx/bau091A.h -knx/bau27B0.cpp -knx/bau27B0.h -knx/bau2920.cpp -knx/bau2920.h -knx/bau57B0.cpp -knx/bau57B0.h -knx/bau_systemB.cpp -knx/bau_systemB.h -knx/bau_systemB_coupler.cpp -knx/bau_systemB_coupler.h -knx/bau_systemB_device.cpp -knx/bau_systemB_device.h -knx/bits.cpp -knx/bits.h -knx/callback_property.h -knx/cemi_frame.cpp -knx/cemi_frame.h -knx/cemi_server.cpp -knx/cemi_server.h -knx/cemi_server_object.cpp -knx/cemi_server_object.h -knx/config.h -knx/datapoint_types.cpp -knx/datapoint_types.h -knx/data_link_layer.cpp -knx/data_link_layer.h -knx/data_property.cpp -knx/data_property.h -knx/device_object.cpp -knx/device_object.h -knx/dpt.cpp -knx/dpt.h -knx/dptconvert.cpp -knx/dptconvert.h -knx/function_property.h -knx/group_object.cpp -knx/group_object.h -knx/group_object_table_object.cpp -knx/group_object_table_object.h -knx/interface_object.cpp -knx/interface_object.h -knx/ip/ip_data_link_layer.cpp -knx/ip/ip_data_link_layer.h -knx/ip/ip_host_protocol_address_information.cpp -knx/ip/ip_host_protocol_address_information.h -knx/ip/ip_parameter_object.cpp -knx/ip/ip_parameter_object.h -knx/ip/knx_ip_ch.cpp -knx/ip/knx_ip_ch.h -knx/ip/knx_ip_config_dib.cpp -knx/ip/knx_ip_config_dib.h -knx/ip/knx_ip_config_request.cpp -knx/ip/knx_ip_config_request.h -knx/ip/knx_ip_connect_request.cpp -knx/ip/knx_ip_connect_request.h -knx/ip/knx_ip_connect_response.cpp -knx/ip/knx_ip_connect_response.h -knx/ip/knx_ip_crd.cpp -knx/ip/knx_ip_crd.h -knx/ip/knx_ip_cri.cpp -knx/ip/knx_ip_cri.h -knx/ip/knx_ip_description_request.cpp -knx/ip/knx_ip_description_request.h -knx/ip/knx_ip_description_response.cpp -knx/ip/knx_ip_description_response.h -knx/ip/knx_ip_device_information_dib.cpp -knx/ip/knx_ip_device_information_dib.h -knx/ip/knx_ip_dib.cpp -knx/ip/knx_ip_dib.h -knx/ip/knx_ip_disconnect_request.cpp -knx/ip/knx_ip_disconnect_request.h -knx/ip/knx_ip_disconnect_response.cpp -knx/ip/knx_ip_disconnect_response.h -knx/ip/knx_ip_extended_device_information_dib.cpp -knx/ip/knx_ip_extended_device_information_dib.h -knx/ip/knx_ip_frame.cpp -knx/ip/knx_ip_frame.h -knx/ip/knx_ip_knx_addresses_dib.cpp -knx/ip/knx_ip_knx_addresses_dib.h -knx/ip/knx_ip_routing_indication.cpp -knx/ip/knx_ip_routing_indication.h -knx/ip/knx_ip_search_request.cpp -knx/ip/knx_ip_search_request.h -knx/ip/knx_ip_search_request_extended.cpp -knx/ip/knx_ip_search_request_extended.h -knx/ip/knx_ip_search_response.cpp -knx/ip/knx_ip_search_response.h -knx/ip/knx_ip_search_response_extended.cpp -knx/ip/knx_ip_search_response_extended.h -knx/ip/knx_ip_state_request.cpp -knx/ip/knx_ip_state_request.h -knx/ip/knx_ip_state_response.cpp -knx/ip/knx_ip_state_response.h -knx/ip/knx_ip_supported_service_dib.cpp -knx/ip/knx_ip_supported_service_dib.h -knx/ip/knx_ip_tunneling_ack.cpp -knx/ip/knx_ip_tunneling_ack.h -knx/ip/knx_ip_tunneling_info_dib.cpp -knx/ip/knx_ip_tunneling_info_dib.h -knx/ip/knx_ip_tunneling_request.cpp -knx/ip/knx_ip_tunneling_request.h -knx/ip/knx_ip_tunnel_connection.cpp -knx/ip/knx_ip_tunnel_connection.h -knx/ip/service_families.h -knx/knx_types.h -knx/knx_types.cpp -knx/knx_value.cpp -knx/knx_value.h -knx/memory.cpp -knx/memory.h -knx/network_layer.cpp -knx/network_layer.h -knx/network_layer_coupler.cpp -knx/network_layer_coupler.h -knx/network_layer_device.cpp -knx/network_layer_device.h -knx/network_layer_entity.cpp -knx/network_layer_entity.h -knx/npdu.cpp -knx/npdu.h -knx/platform/linux_platform.cpp -knx/platform/linux_platform.h -knx/platform.cpp -knx/platform.h -knx/property.cpp -knx/property.h -knx/rf/rf_data_link_layer.cpp -knx/rf/rf_data_link_layer.h -knx/rf/rf_medium_object.cpp -knx/rf/rf_medium_object.h -knx/rf/rf_physical_layer.h -knx/rf/rf_physical_layer_cc1101.cpp -knx/rf/rf_physical_layer_cc1101.h -knx/rf/rf_physical_layer_cc1310.cpp -knx/rf/rf_physical_layer_cc1310.h -knx/router_object.cpp -knx/router_object.h -knx/save_restore.h -knx/secure_application_layer.cpp -knx/secure_application_layer.h -knx/security_interface_object.cpp -knx/security_interface_object.h -knx/table_object.cpp -knx/table_object.h -knx/tpdu.cpp -knx/tpdu.h -knx/tpuart_data_link_layer.cpp -knx/tpuart_data_link_layer.h -knx/tp_frame.cpp -knx/tp_frame.h -knx/transport_layer.cpp -knx/transport_layer.h -knx/usb_tunnel_interface.cpp -knx/usb_tunnel_interface.h -knx/util/aes.c -knx/util/aes.h -knx/util/aes.hpp -knx/util/simple_map.h -knx/util/logger.h -knx/util/logger.cpp -knx.h -knx_facade.cpp -knx_facade.h +./knx/application_layer/apdu.cpp +./knx/application_layer/apdu.h +./knx/application_layer/application_layer.cpp +./knx/application_layer/application_layer.h +./knx/bau/bau.cpp +./knx/bau/bau.h +./knx/bau/bau_systemB.cpp +./knx/bau/bau_systemB.h +./knx/coupler/bau_systemB_coupler.cpp +./knx/coupler/bau_systemB_coupler.h +./knx/bau/bau_systemB_device.cpp +./knx/bau/bau_systemB_device.h +./knx/bits.cpp +./knx/bits.h +./knx/cemi_server/cemi_server.cpp +./knx/cemi_server/cemi_server.h +./knx/cemi_server/cemi_server_object.cpp +./knx/cemi_server/cemi_server_object.h +./knx/cemi_server/usb_tunnel_interface.cpp +./knx/cemi_server/usb_tunnel_interface.h +./knx/config.h +./knx/coupler/bau091A.cpp +./knx/coupler/bau091A.h +./knx/coupler/bau2920.cpp +./knx/coupler/bau2920.h +./knx/coupler/router_object.cpp +./knx/coupler/router_object.h +./knx/datalink_layer/cemi_frame.cpp +./knx/datalink_layer/cemi_frame.h +./knx/datalink_layer/data_link_layer.cpp +./knx/datalink_layer/data_link_layer.h +./knx/data_secure/secure_application_layer.cpp +./knx/data_secure/secure_application_layer.h +./knx/data_secure/security_interface_object.cpp +./knx/data_secure/security_interface_object.h +./knx/group_object/datapoint_types.cpp +./knx/group_object/datapoint_types.h +./knx/group_object/dpt.cpp +./knx/group_object/dpt.h +./knx/group_object/dptconvert.cpp +./knx/group_object/dptconvert.h +./knx/group_object/group_object.cpp +./knx/group_object/group_object.h +./knx/group_object/knx_value.cpp +./knx/group_object/knx_value.h +./knx/interface_object/address_table_object.cpp +./knx/interface_object/address_table_object.h +./knx/interface_object/application_program_object.cpp +./knx/interface_object/application_program_object.h +./knx/interface_object/association_table_object.cpp +./knx/interface_object/association_table_object.h +./knx/interface_object/callback_property.h +./knx/interface_object/data_property.cpp +./knx/interface_object/data_property.h +./knx/interface_object/device_object.cpp +./knx/interface_object/device_object.h +./knx/interface_object/function_property.h +./knx/interface_object/group_object_table_object.cpp +./knx/interface_object/group_object_table_object.h +./knx/interface_object/interface_object.cpp +./knx/interface_object/interface_object.h +./knx/interface_object/property.cpp +./knx/interface_object/property.h +./knx/interface_object/table_object.cpp +./knx/interface_object/table_object.h +./knx/ip/bau57B0.cpp +./knx/ip/bau57B0.h +./knx/ip/ip_data_link_layer.cpp +./knx/ip/ip_data_link_layer.h +./knx/ip/ip_host_protocol_address_information.cpp +./knx/ip/ip_host_protocol_address_information.h +./knx/ip/ip_parameter_object.cpp +./knx/ip/ip_parameter_object.h +./knx/ip/knx_ip_ch.cpp +./knx/ip/knx_ip_ch.h +./knx/ip/knx_ip_config_dib.cpp +./knx/ip/knx_ip_config_dib.h +./knx/ip/knx_ip_config_request.cpp +./knx/ip/knx_ip_config_request.h +./knx/ip/knx_ip_connect_request.cpp +./knx/ip/knx_ip_connect_request.h +./knx/ip/knx_ip_connect_response.cpp +./knx/ip/knx_ip_connect_response.h +./knx/ip/knx_ip_crd.cpp +./knx/ip/knx_ip_crd.h +./knx/ip/knx_ip_cri.cpp +./knx/ip/knx_ip_cri.h +./knx/ip/knx_ip_description_request.cpp +./knx/ip/knx_ip_description_request.h +./knx/ip/knx_ip_description_response.cpp +./knx/ip/knx_ip_description_response.h +./knx/ip/knx_ip_device_information_dib.cpp +./knx/ip/knx_ip_device_information_dib.h +./knx/ip/knx_ip_dib.cpp +./knx/ip/knx_ip_dib.h +./knx/ip/knx_ip_disconnect_request.cpp +./knx/ip/knx_ip_disconnect_request.h +./knx/ip/knx_ip_disconnect_response.cpp +./knx/ip/knx_ip_disconnect_response.h +./knx/ip/knx_ip_extended_device_information_dib.cpp +./knx/ip/knx_ip_extended_device_information_dib.h +./knx/ip/knx_ip_frame.cpp +./knx/ip/knx_ip_frame.h +./knx/ip/knx_ip_knx_addresses_dib.cpp +./knx/ip/knx_ip_knx_addresses_dib.h +./knx/ip/knx_ip_routing_indication.cpp +./knx/ip/knx_ip_routing_indication.h +./knx/ip/knx_ip_search_request.cpp +./knx/ip/knx_ip_search_request.h +./knx/ip/knx_ip_search_request_extended.cpp +./knx/ip/knx_ip_search_request_extended.h +./knx/ip/knx_ip_search_response.cpp +./knx/ip/knx_ip_search_response.h +./knx/ip/knx_ip_search_response_extended.cpp +./knx/ip/knx_ip_search_response_extended.h +./knx/ip/knx_ip_state_request.cpp +./knx/ip/knx_ip_state_request.h +./knx/ip/knx_ip_state_response.cpp +./knx/ip/knx_ip_state_response.h +./knx/ip/knx_ip_supported_service_dib.cpp +./knx/ip/knx_ip_supported_service_dib.h +./knx/ip/knx_ip_tunneling_ack.cpp +./knx/ip/knx_ip_tunneling_ack.h +./knx/ip/knx_ip_tunneling_info_dib.cpp +./knx/ip/knx_ip_tunneling_info_dib.h +./knx/ip/knx_ip_tunneling_request.cpp +./knx/ip/knx_ip_tunneling_request.h +./knx/ip/knx_ip_tunnel_connection.cpp +./knx/ip/knx_ip_tunnel_connection.h +./knx/ip/service_families.h +./knx/knx_facade.cpp +./knx/knx_facade.h +./knx/knx_types.cpp +./knx/knx_types.h +./knx/network_layer/network_layer.cpp +./knx/network_layer/network_layer.h +./knx/coupler/network_layer_coupler.cpp +./knx/coupler/network_layer_coupler.h +./knx/network_layer/network_layer_device.cpp +./knx/network_layer/network_layer_device.h +./knx/network_layer/network_layer_entity.cpp +./knx/network_layer/network_layer_entity.h +./knx/network_layer/npdu.cpp +./knx/network_layer/npdu.h +./knx/platform/arduino_platform.cpp +./knx/platform/arduino_platform.h +./knx/platform/cc1310_platform.cpp +./knx/platform/cc1310_platform.h +./knx/platform/esp32_platform.cpp +./knx/platform/esp32_platform.h +./knx/platform/esp_platform.cpp +./knx/platform/esp_platform.h +./knx/platform/linux_platform.cpp +./knx/platform/linux_platform.h +./knx/platform/platform.cpp +./knx/platform/platform.h +./knx/platform/rp2040_arduino_platform.cpp +./knx/platform/rp2040_arduino_platform.h +./knx/platform/samd_platform.cpp +./knx/platform/samd_platform.h +./knx/platform/stm32_platform.cpp +./knx/platform/stm32_platform.h +./knx/rf/bau27B0.cpp +./knx/rf/bau27B0.h +./knx/rf/rf_data_link_layer.cpp +./knx/rf/rf_data_link_layer.h +./knx/rf/rf_medium_object.cpp +./knx/rf/rf_medium_object.h +./knx/rf/rf_physical_layer.h +./knx/rf/rf_physical_layer_cc1101.cpp +./knx/rf/rf_physical_layer_cc1101.h +./knx/rf/rf_physical_layer_cc1310.cpp +./knx/rf/rf_physical_layer_cc1310.h +./knx/tp/bau07B0.cpp +./knx/tp/bau07B0.h +./knx/tp/tpuart_data_link_layer.cpp +./knx/tp/tpuart_data_link_layer.h +./knx/tp/tp_frame.cpp +./knx/tp/tp_frame.h +./knx/transport_layer/tpdu.cpp +./knx/transport_layer/tpdu.h +./knx/transport_layer/transport_layer.cpp +./knx/transport_layer/transport_layer.h +./knx/util/aes.c +./knx/util/aes.h +./knx/util/aes.hpp +./knx/util/logger.cpp +./knx/util/logger.h +./knx/util/memory.cpp +./knx/util/memory.h +./knx/util/save_restore.h +./knx/util/simple_map.h +./knx.h ) diff --git a/src/knx/app_layer/apdu.cpp b/src/knx/application_layer/apdu.cpp similarity index 93% rename from src/knx/app_layer/apdu.cpp rename to src/knx/application_layer/apdu.cpp index 1dc619a..7d483b7 100644 --- a/src/knx/app_layer/apdu.cpp +++ b/src/knx/application_layer/apdu.cpp @@ -1,6 +1,7 @@ #include "apdu.h" -#include "cemi_frame.h" -#include "bits.h" + +#include "../datalink_layer/cemi_frame.h" +#include "../bits.h" APDU::APDU(uint8_t* data, CemiFrame& frame): _data(data), _frame(frame) { diff --git a/src/knx/app_layer/apdu.h b/src/knx/application_layer/apdu.h similarity index 94% rename from src/knx/app_layer/apdu.h rename to src/knx/application_layer/apdu.h index 5033f5b..8d86dec 100644 --- a/src/knx/app_layer/apdu.h +++ b/src/knx/application_layer/apdu.h @@ -1,8 +1,9 @@ #pragma once -#include -#include "util/logger.h" -#include "knx_types.h" +#include "../util/logger.h" +#include "../knx_types.h" + +#include class CemiFrame; diff --git a/src/knx/app_layer/application_layer.cpp b/src/knx/application_layer/application_layer.cpp similarity index 99% rename from src/knx/app_layer/application_layer.cpp rename to src/knx/application_layer/application_layer.cpp index 6f31b01..085b97a 100644 --- a/src/knx/app_layer/application_layer.cpp +++ b/src/knx/application_layer/application_layer.cpp @@ -1,13 +1,16 @@ #include "application_layer.h" -#include "transport_layer.h" -#include "cemi_frame.h" -#include "association_table_object.h" + #include "apdu.h" -#include "bau.h" -#include "string.h" +#include "../transport_layer/transport_layer.h" +#include "../datalink_layer/cemi_frame.h" +#include "../interface_object/association_table_object.h" +#include "../bau/bau.h" +#include "../util/logger.h" +#include "../bits.h" + +// for memcpy +#include #include -#include "util/logger.h" -#include "bits.h" #define LOGGER Logger::logger("ApplicationLayer") diff --git a/src/knx/app_layer/application_layer.h b/src/knx/application_layer/application_layer.h similarity index 99% rename from src/knx/app_layer/application_layer.h rename to src/knx/application_layer/application_layer.h index 9f8f2c5..276ec0d 100644 --- a/src/knx/app_layer/application_layer.h +++ b/src/knx/application_layer/application_layer.h @@ -1,8 +1,9 @@ #pragma once -#include -#include "knx_types.h" #include "apdu.h" +#include "../knx_types.h" + +#include class AssociationTableObject; class BusAccessUnit; diff --git a/src/knx/bau/bau.h b/src/knx/bau/bau.h index 6269abe..3a3de51 100644 --- a/src/knx/bau/bau.h +++ b/src/knx/bau/bau.h @@ -1,7 +1,9 @@ #pragma once + +#include "../knx_types.h" +#include "../interface_object/interface_object.h" + #include -#include "knx_types.h" -#include "interface_object.h" typedef void (*BeforeRestartCallback)(void); typedef bool (*FunctionPropertyCallback)(uint8_t objectIndex, uint8_t propertyId, uint8_t length, uint8_t* data, uint8_t* resultData, uint8_t& resultLength); diff --git a/src/knx/bau/bau_systemB.cpp b/src/knx/bau/bau_systemB.cpp index b727148..85787e2 100644 --- a/src/knx/bau/bau_systemB.cpp +++ b/src/knx/bau/bau_systemB.cpp @@ -1,5 +1,7 @@ #include "bau_systemB.h" -#include "bits.h" + +#include "../bits.h" + #include #include diff --git a/src/knx/bau/bau_systemB.h b/src/knx/bau/bau_systemB.h index 576dac7..06db379 100644 --- a/src/knx/bau/bau_systemB.h +++ b/src/knx/bau/bau_systemB.h @@ -1,16 +1,17 @@ #pragma once -#include "config.h" #include "bau.h" -#include "security_interface_object.h" -#include "application_program_object.h" -#include "application_layer.h" -#include "secure_application_layer.h" -#include "transport_layer.h" -#include "network_layer.h" -#include "data_link_layer.h" -#include "platform.h" -#include "memory.h" + +#include "../config.h" +#include "../data_secure/security_interface_object.h" +#include "../data_secure/secure_application_layer.h" +#include "../interface_object/application_program_object.h" +#include "../application_layer/application_layer.h" +#include "../transport_layer/transport_layer.h" +#include "../network_layer/network_layer.h" +#include "../datalink_layer/data_link_layer.h" +#include "../platform/platform.h" +#include "../util/memory.h" class BauSystemB : protected BusAccessUnit { diff --git a/src/knx/bau/bau_systemB_device.cpp b/src/knx/bau/bau_systemB_device.cpp index ae4a5d9..39d029d 100644 --- a/src/knx/bau/bau_systemB_device.cpp +++ b/src/knx/bau/bau_systemB_device.cpp @@ -1,5 +1,7 @@ #include "bau_systemB_device.h" -#include "bits.h" + +#include "../bits.h" + #include #include diff --git a/src/knx/bau/bau_systemB_device.h b/src/knx/bau/bau_systemB_device.h index 4e5e283..551d0ab 100644 --- a/src/knx/bau/bau_systemB_device.h +++ b/src/knx/bau/bau_systemB_device.h @@ -1,20 +1,21 @@ #pragma once -#include "config.h" #include "bau_systemB.h" -#include "device_object.h" -#include "address_table_object.h" -#include "association_table_object.h" -#include "group_object_table_object.h" -#include "security_interface_object.h" -#include "application_program_object.h" -#include "application_layer.h" -#include "secure_application_layer.h" -#include "transport_layer.h" -#include "network_layer_device.h" -#include "data_link_layer.h" -#include "platform.h" -#include "memory.h" + +#include "../config.h" +#include "../interface_object/device_object.h" +#include "../interface_object/address_table_object.h" +#include "../interface_object/association_table_object.h" +#include "../interface_object/group_object_table_object.h" +#include "../interface_object/application_program_object.h" +#include "../data_secure/security_interface_object.h" +#include "../data_secure/secure_application_layer.h" +#include "../application_layer/application_layer.h" +#include "../transport_layer/transport_layer.h" +#include "../network_layer/network_layer_device.h" +#include "../datalink_layer/data_link_layer.h" +#include "../platform/platform.h" +#include "../util/memory.h" class BauSystemBDevice : public BauSystemB { diff --git a/src/knx/cemi_server/cemi_server.cpp b/src/knx/cemi_server/cemi_server.cpp index 6b54500..ae01680 100644 --- a/src/knx/cemi_server/cemi_server.cpp +++ b/src/knx/cemi_server/cemi_server.cpp @@ -1,10 +1,12 @@ #include "cemi_server.h" -#include "cemi_frame.h" -#include "bau_systemB.h" + #include "usb_tunnel_interface.h" -#include "data_link_layer.h" -#include "string.h" -#include "bits.h" +#include "../bau/bau_systemB.h" +#include "../datalink_layer/cemi_frame.h" +#include "../datalink_layer/data_link_layer.h" +#include "../bits.h" + +#include #include CemiServer::CemiServer(BauSystemB& bau) diff --git a/src/knx/cemi_server/cemi_server.h b/src/knx/cemi_server/cemi_server.h index 796cec1..4551b1c 100644 --- a/src/knx/cemi_server/cemi_server.h +++ b/src/knx/cemi_server/cemi_server.h @@ -1,8 +1,8 @@ #pragma once -#include -#include "knx_types.h" #include "usb_tunnel_interface.h" +#include "../knx_types.h" +#include class BauSystemB; class DataLinkLayer; diff --git a/src/knx/cemi_server/cemi_server_object.cpp b/src/knx/cemi_server/cemi_server_object.cpp index 2a9486c..e513e59 100644 --- a/src/knx/cemi_server/cemi_server_object.cpp +++ b/src/knx/cemi_server/cemi_server_object.cpp @@ -1,7 +1,8 @@ -#include #include "cemi_server_object.h" -#include "bits.h" -#include "data_property.h" + +#include "../bits.h" + +#include CemiServerObject::CemiServerObject() { diff --git a/src/knx/cemi_server/cemi_server_object.h b/src/knx/cemi_server/cemi_server_object.h index 799d479..8049d0a 100644 --- a/src/knx/cemi_server/cemi_server_object.h +++ b/src/knx/cemi_server/cemi_server_object.h @@ -1,6 +1,6 @@ #pragma once -#include "interface_object.h" +#include "../interface_object/interface_object.h" class CemiServerObject: public InterfaceObject { diff --git a/src/knx/cemi_server/usb_tunnel_interface.cpp b/src/knx/cemi_server/usb_tunnel_interface.cpp index b22b41f..dc004a3 100644 --- a/src/knx/cemi_server/usb_tunnel_interface.cpp +++ b/src/knx/cemi_server/usb_tunnel_interface.cpp @@ -1,12 +1,12 @@ #include "usb_tunnel_interface.h" + #include "cemi_server.h" -#include "cemi_frame.h" +#include "../datalink_layer/cemi_frame.h" +#include "../bits.h" #include #include -#include "bits.h" - #define MAX_EP_SIZE 64 #define HID_HEADER_SIZE 3 #define MAX_KNX_TELEGRAM_SIZE 263 diff --git a/src/knx/bau/bau091A.cpp b/src/knx/coupler/bau091A.cpp similarity index 99% rename from src/knx/bau/bau091A.cpp rename to src/knx/coupler/bau091A.cpp index befe68b..e21c64c 100644 --- a/src/knx/bau/bau091A.cpp +++ b/src/knx/coupler/bau091A.cpp @@ -1,9 +1,10 @@ #include "bau091A.h" + #include "bits.h" + #include #include -using namespace std; /* ToDos Announce the line status of sec side 03_05_01 4.4.3 diff --git a/src/knx/bau/bau091A.h b/src/knx/coupler/bau091A.h similarity index 82% rename from src/knx/bau/bau091A.h rename to src/knx/coupler/bau091A.h index 8f5a146..0a3f48e 100644 --- a/src/knx/bau/bau091A.h +++ b/src/knx/coupler/bau091A.h @@ -1,13 +1,12 @@ #pragma once -#include "config.h" - #include "bau_systemB_coupler.h" -#include "router_object.h" -#include "ip/ip_parameter_object.h" -#include "ip/ip_data_link_layer.h" -#include "tpuart_data_link_layer.h" -#include "cemi_server_object.h" +#include "../config.h" +#include "../interface_object/router_object.h" +#include "../ip/ip_parameter_object.h" +#include "../ip/ip_data_link_layer.h" +#include "../tp/tpuart_data_link_layer.h" +#include "../cemi_server/cemi_server_object.h" class Bau091A : public BauSystemBCoupler, public ITpUartCallBacks, public DataLinkLayerCallbacks { diff --git a/src/knx/bau/bau2920.cpp b/src/knx/coupler/bau2920.cpp similarity index 98% rename from src/knx/bau/bau2920.cpp rename to src/knx/coupler/bau2920.cpp index bd44f82..0a3b2a6 100644 --- a/src/knx/bau/bau2920.cpp +++ b/src/knx/coupler/bau2920.cpp @@ -1,7 +1,9 @@ #include "bau2920.h" -#include "bits.h" -#include -#include + +#include "../bits.h" + +#include +#include using namespace std; diff --git a/src/knx/bau/bau2920.h b/src/knx/coupler/bau2920.h similarity index 80% rename from src/knx/bau/bau2920.h rename to src/knx/coupler/bau2920.h index 276d4dc..42f1d37 100644 --- a/src/knx/bau/bau2920.h +++ b/src/knx/coupler/bau2920.h @@ -1,17 +1,17 @@ #pragma once -#include "config.h" +#include "../config.h" #include "bau_systemB_coupler.h" #include "tpuart_data_link_layer.h" #if defined(DeviceFamily_CC13X0) - #include "rf/rf_physical_layer_cc1310.h" + #include "../rf/rf_physical_layer_cc1310.h" #else - #include "rf/rf_physical_layer_cc1101.h" + #include "../rf/rf_physical_layer_cc1101.h" #endif -#include "rf/rf_data_link_layer.h" -#include "rf/rf_medium_object.h" -#include "cemi_server_object.h" +#include "../rf/rf_data_link_layer.h" +#include "../rf/rf_medium_object.h" +#include "../cemi_server/cemi_server_object.h" class Bau2920 : public BauSystemBCoupler { diff --git a/src/knx/bau/bau_systemB_coupler.cpp b/src/knx/coupler/bau_systemB_coupler.cpp similarity index 98% rename from src/knx/bau/bau_systemB_coupler.cpp rename to src/knx/coupler/bau_systemB_coupler.cpp index e71164f..b06ca2f 100644 --- a/src/knx/bau/bau_systemB_coupler.cpp +++ b/src/knx/coupler/bau_systemB_coupler.cpp @@ -1,5 +1,7 @@ #include "bau_systemB_coupler.h" -#include "bits.h" + +#include "../bits.h" + #include #include diff --git a/src/knx/bau/bau_systemB_coupler.h b/src/knx/coupler/bau_systemB_coupler.h similarity index 59% rename from src/knx/bau/bau_systemB_coupler.h rename to src/knx/coupler/bau_systemB_coupler.h index 4fea4f4..0aa68aa 100644 --- a/src/knx/bau/bau_systemB_coupler.h +++ b/src/knx/coupler/bau_systemB_coupler.h @@ -1,18 +1,19 @@ #pragma once -#include "config.h" -#include "bau_systemB.h" -#include "device_object.h" -#include "security_interface_object.h" -#include "application_program_object.h" #include "router_object.h" -#include "application_layer.h" -#include "secure_application_layer.h" -#include "transport_layer.h" #include "network_layer_coupler.h" -#include "data_link_layer.h" -#include "platform.h" -#include "memory.h" + +#include "../config.h" +#include "../bau/bau_systemB.h" +#include "../interface_object/device_object.h" +#include "../interface_object/application_program_object.h" +#include "../data_secure/security_interface_object.h" +#include "../data_secure/secure_application_layer.h" +#include "../application_layer/application_layer.h" +#include "../transport_layer/transport_layer.h" +#include "../datalink_layer/data_link_layer.h" +#include "../platform/platform.h" +#include "../util/memory.h" class BauSystemBCoupler : public BauSystemB { diff --git a/src/knx/network_layer/network_layer_coupler.cpp b/src/knx/coupler/network_layer_coupler.cpp similarity index 99% rename from src/knx/network_layer/network_layer_coupler.cpp rename to src/knx/coupler/network_layer_coupler.cpp index 6583e83..743d4b7 100644 --- a/src/knx/network_layer/network_layer_coupler.cpp +++ b/src/knx/coupler/network_layer_coupler.cpp @@ -1,10 +1,10 @@ #include "network_layer_coupler.h" -#include "data_link_layer.h" -#include "device_object.h" + #include "router_object.h" -#include "tpdu.h" -#include "cemi_frame.h" -#include "bits.h" +#include "../interface_object/device_object.h" +#include "../transport_layer/tpdu.h" +#include "../datalink_layer/data_link_layer.h" +#include "../bits.h" NetworkLayerCoupler::NetworkLayerCoupler(DeviceObject& deviceObj, TransportLayer& layer) : diff --git a/src/knx/network_layer/network_layer_coupler.h b/src/knx/coupler/network_layer_coupler.h similarity index 97% rename from src/knx/network_layer/network_layer_coupler.h rename to src/knx/coupler/network_layer_coupler.h index 75f1694..2ca0a66 100644 --- a/src/knx/network_layer/network_layer_coupler.h +++ b/src/knx/coupler/network_layer_coupler.h @@ -1,11 +1,10 @@ #pragma once -#include -#include "knx_types.h" -#include "npdu.h" -#include "transport_layer.h" -#include "network_layer_entity.h" +#include "../knx_types.h" #include "network_layer.h" +#include "transport_layer.h" + +#include class DeviceObject; class RouterObject; diff --git a/src/knx/interface_object/router_object.cpp b/src/knx/coupler/router_object.cpp similarity index 99% rename from src/knx/interface_object/router_object.cpp rename to src/knx/coupler/router_object.cpp index 2a5b2ba..a5c1ffa 100644 --- a/src/knx/interface_object/router_object.cpp +++ b/src/knx/coupler/router_object.cpp @@ -1,13 +1,10 @@ -#include "config.h" +#include "router_object.h" + +#include "../config.h" +#include "../bits.h" +#include "../util/memory.h" #include -#include "router_object.h" -#include "bits.h" -#include "memory.h" -#include "data_property.h" -#include "callback_property.h" -#include "function_property.h" - // Filter Table Realization Type 3 // The Filter Table Realisation Type 3 shall be organised as a memory mapped bit-field of diff --git a/src/knx/interface_object/router_object.h b/src/knx/coupler/router_object.h similarity index 95% rename from src/knx/interface_object/router_object.h rename to src/knx/coupler/router_object.h index 7f9194d..3ed7c7b 100644 --- a/src/knx/interface_object/router_object.h +++ b/src/knx/coupler/router_object.h @@ -1,9 +1,8 @@ #pragma once -#include "config.h" - -#include "table_object.h" -#include "knx_types.h" +#include "../interface_object/table_object.h" +#include "../config.h" +#include "../knx_types.h" class Memory; diff --git a/src/knx/data_secure/secure_application_layer.cpp b/src/knx/data_secure/secure_application_layer.cpp index 07200e6..ddf12da 100644 --- a/src/knx/data_secure/secure_application_layer.cpp +++ b/src/knx/data_secure/secure_application_layer.cpp @@ -1,25 +1,28 @@ -#include "config.h" +#include "../config.h" #ifdef USE_DATASECURE #include "secure_application_layer.h" -#include "transport_layer.h" -#include "cemi_frame.h" -#include "association_table_object.h" -#include "address_table_object.h" + #include "security_interface_object.h" -#include "device_object.h" -#include "apdu.h" -#include "bau.h" -#include "string.h" -#include "bits.h" -#include "util/logger.h" +#include "../bau/bau.h" +#include "../application_layer/apdu.h" +#include "../transport_layer/transport_layer.h" +#include "../datalink_layer/cemi_frame.h" +#include "../interface_object/association_table_object.h" +#include "../interface_object/address_table_object.h" +#include "../interface_object/device_object.h" +#include "../bits.h" +#include "../util/logger.h" + +#include + #define LOGGER Logger::logger("SecureApplicationLayer") // Select what cipher modes to include. We need AES128-CBC and AES128-CTR modes. #define CBC 1 #define CTR 1 #define ECB 0 -#include "util/aes.hpp" +#include "../util/aes.hpp" static constexpr uint8_t kSecureDataPdu = 0; static constexpr uint8_t kSecureSyncRequest = 2; diff --git a/src/knx/data_secure/secure_application_layer.h b/src/knx/data_secure/secure_application_layer.h index c60e93e..7a106c1 100644 --- a/src/knx/data_secure/secure_application_layer.h +++ b/src/knx/data_secure/secure_application_layer.h @@ -1,10 +1,10 @@ #pragma once -#include "application_layer.h" +#include "../application_layer/application_layer.h" +#include "../knx_types.h" +#include "../util/simple_map.h" + #include -#include "knx_types.h" -#include "apdu.h" -#include "util/simple_map.h" class DeviceObject; class SecurityInterfaceObject; diff --git a/src/knx/data_secure/security_interface_object.cpp b/src/knx/data_secure/security_interface_object.cpp index 69e9558..c3c3d73 100644 --- a/src/knx/data_secure/security_interface_object.cpp +++ b/src/knx/data_secure/security_interface_object.cpp @@ -1,13 +1,11 @@ -#include "config.h" +#include "../config.h" #ifdef USE_DATASECURE -#include #include "security_interface_object.h" #include "secure_application_layer.h" -#include "bits.h" -#include "data_property.h" -#include "callback_property.h" -#include "function_property.h" +#include "../bits.h" + +#include // Our FDSK. It is never changed from ETS. This is the permanent default tool key that is restored on every factory reset of the device. const uint8_t SecurityInterfaceObject::_fdsk[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; diff --git a/src/knx/data_secure/security_interface_object.h b/src/knx/data_secure/security_interface_object.h index 37f78f9..5de959f 100644 --- a/src/knx/data_secure/security_interface_object.h +++ b/src/knx/data_secure/security_interface_object.h @@ -1,10 +1,10 @@ #pragma once -#include "config.h" +#include "../config.h" #ifdef USE_DATASECURE -#include "interface_object.h" -#include "knx_types.h" +#include "../interface_object/interface_object.h" +#include "../knx_types.h" class SecurityInterfaceObject: public InterfaceObject { diff --git a/src/knx/datalink_layer/cemi_frame.cpp b/src/knx/datalink_layer/cemi_frame.cpp index b2f446e..bff85ca 100644 --- a/src/knx/datalink_layer/cemi_frame.cpp +++ b/src/knx/datalink_layer/cemi_frame.cpp @@ -1,7 +1,9 @@ #include "cemi_frame.h" -#include "bits.h" -#include "string.h" -#include + +#include "../bits.h" + +#include +#include /* cEMI Frame Format diff --git a/src/knx/datalink_layer/cemi_frame.h b/src/knx/datalink_layer/cemi_frame.h index bd30bcf..f29f049 100644 --- a/src/knx/datalink_layer/cemi_frame.h +++ b/src/knx/datalink_layer/cemi_frame.h @@ -1,13 +1,13 @@ #pragma once -#include "knx_types.h" -#include -#include "npdu.h" -#include "tpdu.h" -#include "apdu.h" -#include "config.h" -#include "util/logger.h" +#include "../knx_types.h" +#include "../application_layer/apdu.h" +#include "../transport_layer/tpdu.h" +#include "../network_layer/npdu.h" +#include "../config.h" +#include "../util/logger.h" +#include #define NPDU_LPDU_DIFF 8 #define TPDU_NPDU_DIFF 1 diff --git a/src/knx/datalink_layer/data_link_layer.cpp b/src/knx/datalink_layer/data_link_layer.cpp index bd5c641..f5872b1 100644 --- a/src/knx/datalink_layer/data_link_layer.cpp +++ b/src/knx/datalink_layer/data_link_layer.cpp @@ -1,11 +1,10 @@ #include "data_link_layer.h" -#include "platform.h" -#include "device_object.h" -#include "cemi_server.h" -#include "cemi_frame.h" -#include "util/logger.h" -#include "bits.h" +#include "../platform/platform.h" +#include "../interface_object/device_object.h" +#include "../cemi_server/cemi_server.h" +#include "../util/logger.h" +#include "../bits.h" #define LOGGER Logger::logger("DataLinkLayer") diff --git a/src/knx/datalink_layer/data_link_layer.h b/src/knx/datalink_layer/data_link_layer.h index 00950df..f38167b 100644 --- a/src/knx/datalink_layer/data_link_layer.h +++ b/src/knx/datalink_layer/data_link_layer.h @@ -1,16 +1,19 @@ #pragma once -#include "config.h" +#include "../config.h" + +#include "cemi_frame.h" + +#include "../interface_object/device_object.h" +#include "../knx_types.h" +#include "../network_layer/network_layer_entity.h" +#ifdef KNX_TUNNELING + #include "../ip/ip_parameter_object.h" +#endif +#include "../cemi_server/cemi_server.h" +#include "../bau/bau.h" #include -#include "device_object.h" -#include "knx_types.h" -#include "network_layer_entity.h" -#ifdef KNX_TUNNELING - #include "ip/ip_parameter_object.h" -#endif -#include "cemi_server.h" -#include "bau.h" class Platform; diff --git a/src/knx/group_object/datapoint_types.cpp b/src/knx/group_object/datapoint_types.cpp index b757d0f..664d4df 100644 --- a/src/knx/group_object/datapoint_types.cpp +++ b/src/knx/group_object/datapoint_types.cpp @@ -9,6 +9,7 @@ */ #include "datapoint_types.h" + #include // Sign for a negative DPT9 float value diff --git a/src/knx/group_object/dpt.cpp b/src/knx/group_object/dpt.cpp index af0d994..af2491c 100644 --- a/src/knx/group_object/dpt.cpp +++ b/src/knx/group_object/dpt.cpp @@ -1,8 +1,9 @@ #include "dpt.h" -#include "util/logger.h" -#define LOGGER Logger::logger("Dpt") -#include "bits.h" +#include "../util/logger.h" +#include "../bits.h" + +#define LOGGER Logger::logger("Dpt") Dpt::Dpt() {} diff --git a/src/knx/group_object/dptconvert.cpp b/src/knx/group_object/dptconvert.cpp index a73a036..673ba7f 100644 --- a/src/knx/group_object/dptconvert.cpp +++ b/src/knx/group_object/dptconvert.cpp @@ -1,5 +1,7 @@ #include "dptconvert.h" -#include "bits.h" + +#include "../bits.h" + #include #include #include diff --git a/src/knx/group_object/dptconvert.h b/src/knx/group_object/dptconvert.h index f341df8..7a34d8b 100644 --- a/src/knx/group_object/dptconvert.h +++ b/src/knx/group_object/dptconvert.h @@ -28,11 +28,11 @@ #pragma once -#include - #include "dpt.h" #include "knx_value.h" +#include + /** * Converts the KNX Payload given by the specific DPT and puts the value in the KNXValue struc */ diff --git a/src/knx/group_object/group_object.cpp b/src/knx/group_object/group_object.cpp index 9e2058b..af70b0b 100644 --- a/src/knx/group_object/group_object.cpp +++ b/src/knx/group_object/group_object.cpp @@ -1,8 +1,10 @@ #include "group_object.h" -#include "string.h" + #include "datapoint_types.h" -#include "group_object_table_object.h" -#include "bits.h" +#include "../interface_objects/group_object_table_object.h" +#include "../bits.h" + +#include #ifdef SMALL_GROUPOBJECT GroupObjectUpdatedHandler GroupObject::_updateHandlerStatic = 0; diff --git a/src/knx/group_object/group_object.h b/src/knx/group_object/group_object.h index 51c89f6..1048008 100644 --- a/src/knx/group_object/group_object.h +++ b/src/knx/group_object/group_object.h @@ -1,9 +1,10 @@ #pragma once +#include "../knx_types.h" +#include "dptconvert.h" + #include #include -#include "knx_types.h" -#include "dptconvert.h" class GroupObjectTableObject; diff --git a/src/knx/interface_object/address_table_object.cpp b/src/knx/interface_object/address_table_object.cpp index d9b37d1..70348ad 100644 --- a/src/knx/interface_object/address_table_object.cpp +++ b/src/knx/interface_object/address_table_object.cpp @@ -1,9 +1,9 @@ -#include - #include "address_table_object.h" -#include "data_property.h" -#include "util/logger.h" -#include "bits.h" + +#include "../util/logger.h" +#include "../bits.h" + +#include #define LOGGER Logger::logger("AddressTableObject") diff --git a/src/knx/interface_object/application_program_object.cpp b/src/knx/interface_object/application_program_object.cpp index 5c1c679..82af9fb 100644 --- a/src/knx/interface_object/application_program_object.cpp +++ b/src/knx/interface_object/application_program_object.cpp @@ -1,10 +1,10 @@ #include "application_program_object.h" -#include "data_property.h" -#include "callback_property.h" -#include "dptconvert.h" + +#include "../group_object/dptconvert.h" +#include "../util/logger.h" +#include "../bits.h" + #include -#include "util/logger.h" -#include "bits.h" #define LOGGER Logger::logger("ApplicationProgramObject") diff --git a/src/knx/interface_object/association_table_object.cpp b/src/knx/interface_object/association_table_object.cpp index cab9c3f..5590fe5 100644 --- a/src/knx/interface_object/association_table_object.cpp +++ b/src/knx/interface_object/association_table_object.cpp @@ -1,9 +1,9 @@ -#include - #include "association_table_object.h" -#include "data_property.h" -#include "util/logger.h" -#include "bits.h" + +#include "../util/logger.h" +#include "../bits.h" + +#include #define LOGGER Logger::logger("AssociationTableObject") diff --git a/src/knx/interface_object/data_property.cpp b/src/knx/interface_object/data_property.cpp index f2279b4..cc87593 100644 --- a/src/knx/interface_object/data_property.cpp +++ b/src/knx/interface_object/data_property.cpp @@ -1,5 +1,6 @@ #include "data_property.h" -#include "bits.h" + +#include "../bits.h" #include diff --git a/src/knx/interface_object/device_object.cpp b/src/knx/interface_object/device_object.cpp index 4397bdc..60480c1 100644 --- a/src/knx/interface_object/device_object.cpp +++ b/src/knx/interface_object/device_object.cpp @@ -1,9 +1,9 @@ -#include #include "device_object.h" -#include "bits.h" -#include "data_property.h" -#include "callback_property.h" -#include "config.h" + +#include "../bits.h" +#include "../config.h" + +#include #define LEN_KNX_SERIAL 6 diff --git a/src/knx/interface_object/group_object_table_object.cpp b/src/knx/interface_object/group_object_table_object.cpp index cee4a3b..d1ea993 100644 --- a/src/knx/interface_object/group_object_table_object.cpp +++ b/src/knx/interface_object/group_object_table_object.cpp @@ -1,10 +1,10 @@ -#include - #include "group_object_table_object.h" -#include "group_object.h" -#include "data_property.h" -#include "util/logger.h" -#include "bits.h" + +#include "../group_object/group_object.h" +#include "../util/logger.h" +#include "../bits.h" + +#include #define LOGGER Logger::logger("GroupObjectTableObject") diff --git a/src/knx/interface_object/group_object_table_object.h b/src/knx/interface_object/group_object_table_object.h index fc5d131..0475505 100644 --- a/src/knx/interface_object/group_object_table_object.h +++ b/src/knx/interface_object/group_object_table_object.h @@ -1,7 +1,7 @@ #pragma once #include "table_object.h" -#include "group_object.h" +#include "../group_object/group_object.h" class GroupObjectTableObject : public TableObject { diff --git a/src/knx/interface_object/interface_object.cpp b/src/knx/interface_object/interface_object.cpp index 1b317d2..3a94f05 100644 --- a/src/knx/interface_object/interface_object.cpp +++ b/src/knx/interface_object/interface_object.cpp @@ -1,8 +1,8 @@ -#include - #include "interface_object.h" -#include "data_property.h" -#include "bits.h" + +#include "../bits.h" + +#include InterfaceObject::~InterfaceObject() { diff --git a/src/knx/interface_object/interface_object.h b/src/knx/interface_object/interface_object.h index 9ea72e5..1de2a85 100644 --- a/src/knx/interface_object/interface_object.h +++ b/src/knx/interface_object/interface_object.h @@ -1,9 +1,13 @@ #pragma once -#include #include "property.h" -#include "save_restore.h" -#include "knx_types.h" +#include "data_property.h" +#include "callback_property.h" +#include "function_property.h" +#include "../util/save_restore.h" +#include "../knx_types.h" + +#include /** Enum for the type of an interface object. See Section 2.2 of knx:3/7/3 */ enum ObjectType diff --git a/src/knx/interface_object/property.cpp b/src/knx/interface_object/property.cpp index 552683b..7e618fa 100644 --- a/src/knx/interface_object/property.cpp +++ b/src/knx/interface_object/property.cpp @@ -1,8 +1,8 @@ #include "property.h" -#include "bits.h" + +#include "../bits.h" #include -using namespace std; PropertyID Property::Id() const { diff --git a/src/knx/interface_object/property.h b/src/knx/interface_object/property.h index 4c7fd9b..c17f0bc 100644 --- a/src/knx/interface_object/property.h +++ b/src/knx/interface_object/property.h @@ -9,8 +9,9 @@ */ #pragma once +#include "../util/save_restore.h" + #include -#include "save_restore.h" /** The data type of a property. */ enum PropertyDataType diff --git a/src/knx/interface_object/table_object.cpp b/src/knx/interface_object/table_object.cpp index cef83be..fc7b607 100644 --- a/src/knx/interface_object/table_object.cpp +++ b/src/knx/interface_object/table_object.cpp @@ -1,10 +1,8 @@ -#include - #include "table_object.h" -#include "bits.h" -#include "memory.h" -#include "callback_property.h" -#include "data_property.h" +#include "../bits.h" +#include "../util/memory.h" + +#include BeforeTablesUnloadCallback TableObject::_beforeTablesUnload = 0; uint8_t TableObject::_tableUnloadCount = 0; diff --git a/src/knx/bau/bau57B0.cpp b/src/knx/ip/bau57B0.cpp similarity index 99% rename from src/knx/bau/bau57B0.cpp rename to src/knx/ip/bau57B0.cpp index 1a9baae..7061969 100644 --- a/src/knx/bau/bau57B0.cpp +++ b/src/knx/ip/bau57B0.cpp @@ -1,5 +1,7 @@ #include "bau57B0.h" -#include "bits.h" + +#include "../bits.h" + #include #include diff --git a/src/knx/bau/bau57B0.h b/src/knx/ip/bau57B0.h similarity index 80% rename from src/knx/bau/bau57B0.h rename to src/knx/ip/bau57B0.h index 81eafa1..d67bf07 100644 --- a/src/knx/bau/bau57B0.h +++ b/src/knx/ip/bau57B0.h @@ -1,11 +1,11 @@ #pragma once -#include "config.h" +#include "../config.h" -#include "bau_systemB_device.h" -#include "ip/ip_parameter_object.h" -#include "ip/ip_data_link_layer.h" -#include "cemi_server_object.h" +#include "ip_parameter_object.h" +#include "ip_data_link_layer.h" +#include "../bau/bau_systemB_device.h" +#include "../cemi_server/cemi_server_object.h" class Bau57B0 : public BauSystemBDevice, public DataLinkLayerCallbacks { diff --git a/src/knx/ip/ip_data_link_layer.cpp b/src/knx/ip/ip_data_link_layer.cpp index 581f2f2..d491f0d 100644 --- a/src/knx/ip/ip_data_link_layer.cpp +++ b/src/knx/ip/ip_data_link_layer.cpp @@ -1,18 +1,10 @@ #include "ip_data_link_layer.h" -#include "../bits.h" -#include "../platform.h" -#include "../device_object.h" #include "knx_ip_routing_indication.h" #include "knx_ip_search_request.h" #include "knx_ip_search_response.h" #include "knx_ip_search_request_extended.h" #include "knx_ip_search_response_extended.h" -#include "../util/logger.h" - -#define LOGGER Logger::logger("IpDataLinkLayer") - - #include "knx_ip_connect_request.h" #include "knx_ip_connect_response.h" #include "knx_ip_state_request.h" @@ -24,7 +16,12 @@ #include "knx_ip_description_request.h" #include "knx_ip_description_response.h" #include "knx_ip_config_request.h" +#include "../bits.h" +#include "../platform/platform.h" +#include "../interface_object/device_object.h" +#include "../util/logger.h" +#define LOGGER Logger::logger("IpDataLinkLayer") #include #include diff --git a/src/knx/ip/ip_data_link_layer.h b/src/knx/ip/ip_data_link_layer.h index 4be7707..dee4849 100644 --- a/src/knx/ip/ip_data_link_layer.h +++ b/src/knx/ip/ip_data_link_layer.h @@ -1,7 +1,7 @@ #pragma once #include -#include "../data_link_layer.h" +#include "../datalink_layer/data_link_layer.h" #include "ip_parameter_object.h" #include "knx_ip_tunnel_connection.h" #include "service_families.h" diff --git a/src/knx/ip/ip_parameter_object.cpp b/src/knx/ip/ip_parameter_object.cpp index 885adc8..ae220c9 100644 --- a/src/knx/ip/ip_parameter_object.cpp +++ b/src/knx/ip/ip_parameter_object.cpp @@ -1,8 +1,6 @@ #include "ip_parameter_object.h" #include "../bits.h" -#include "../data_property.h" -#include "../callback_property.h" // 224.0.23.12 #define DEFAULT_MULTICAST_ADDR ((uint32_t)0xE000170C) diff --git a/src/knx/ip/ip_parameter_object.h b/src/knx/ip/ip_parameter_object.h index 83f17cd..c4f5f7b 100644 --- a/src/knx/ip/ip_parameter_object.h +++ b/src/knx/ip/ip_parameter_object.h @@ -1,8 +1,7 @@ #pragma once -#include "../interface_object.h" -#include "../device_object.h" -#include "../platform.h" +#include "../inteface_object/device_object.h" +#include "../platform/platform.h" #define KNXIP_MULTICAST_PORT 3671 diff --git a/src/knx/ip/knx_ip_frame.h b/src/knx/ip/knx_ip_frame.h index a10cdc5..e351c21 100644 --- a/src/knx/ip/knx_ip_frame.h +++ b/src/knx/ip/knx_ip_frame.h @@ -1,6 +1,6 @@ #pragma once -#include "../cemi_frame.h" +#include "../datalink_layer/cemi_frame.h" #define LEN_KNXIP_HEADER 0x6 diff --git a/src/knx/ip/knx_ip_routing_indication.h b/src/knx/ip/knx_ip_routing_indication.h index 72228ca..e932423 100644 --- a/src/knx/ip/knx_ip_routing_indication.h +++ b/src/knx/ip/knx_ip_routing_indication.h @@ -1,7 +1,7 @@ #pragma once #include "knx_ip_frame.h" -#include "../cemi_frame.h" +#include "../datalink_layer/cemi_frame.h" class KnxIpRoutingIndication : public KnxIpFrame { diff --git a/src/knx/ip/knx_ip_tunnel_connection.h b/src/knx/ip/knx_ip_tunnel_connection.h index 65e0d0e..eb4a0e7 100644 --- a/src/knx/ip/knx_ip_tunnel_connection.h +++ b/src/knx/ip/knx_ip_tunnel_connection.h @@ -1,5 +1,5 @@ #pragma once -#include "../platform.h" +#include "../platform/platform.h" class KnxIpTunnelConnection { diff --git a/src/knx/ip/knx_ip_tunneling_ack.h b/src/knx/ip/knx_ip_tunneling_ack.h index ef296e2..0f61723 100644 --- a/src/knx/ip/knx_ip_tunneling_ack.h +++ b/src/knx/ip/knx_ip_tunneling_ack.h @@ -1,9 +1,8 @@ #pragma once #include "knx_ip_frame.h" -#include "../cemi_frame.h" #include "knx_ip_ch.h" - +#include "../datalink_layer/cemi_frame.h" class KnxIpTunnelingAck : public KnxIpFrame { public: diff --git a/src/knx/knx_facade.cpp b/src/knx/knx_facade.cpp index dfb5173..f69a8e7 100644 --- a/src/knx/knx_facade.cpp +++ b/src/knx/knx_facade.cpp @@ -1,6 +1,6 @@ #include "knx_facade.h" -#include "knx/bits.h" +#include "bits.h" #ifndef KNX_NO_AUTOMATIC_GLOBAL_INSTANCE diff --git a/src/knx/knx_facade.h b/src/knx/knx_facade.h index 67e95da..f43aa81 100644 --- a/src/knx/knx_facade.h +++ b/src/knx/knx_facade.h @@ -1,14 +1,13 @@ #pragma once -#include "knx/util/logger.h" -#include "knx/config.h" -#include "knx/bau.h" -#include "knx/bau07B0.h" -#include "knx/bau091A.h" -#include "knx/bau27B0.h" -#include "knx/bau2920.h" -#include "knx/bau57B0.h" - +#include "util/logger.h" +#include "config.h" +#include "bau/bau.h" +#include "tp/bau07B0.h" +#include "rf/bau27B0.h" +#include "ip/bau57B0.h" +#include "coupler/bau091A.h" +#include "coupler/bau2920.h" #include "knx/bits.h" #ifndef USERDATA_SAVE_SIZE @@ -16,19 +15,19 @@ #endif #ifdef ARDUINO_ARCH_SAMD - #include "knx/platform/samd_platform.h" + #include "platform/samd_platform.h" #elif defined(ARDUINO_ARCH_RP2040) - #include "knx/platform/rp2040_arduino_platform.h" + #include "platform/rp2040_arduino_platform.h" #elif defined(ARDUINO_ARCH_ESP8266) - #include "knx/platform/esp_platform.h" + #include "platform/esp_platform.h" #elif defined(ARDUINO_ARCH_ESP32) - #include "knx/platform/esp32_platform.h" + #include "platform/esp32_platform.h" #elif defined(ARDUINO_ARCH_STM32) - #include "knx/platform/stm32_platform.h" + #include "platform/stm32_platform.h" #elif __linux__ - #include "knx/platform/linux_platform.h" + #include "platform/linux_platform.h" #else - #include "knx/platform/cc1310_platform.h" + #include "platform/cc1310_platform.h" #endif #ifndef KNX_NO_AUTOMATIC_GLOBAL_INSTANCE diff --git a/src/knx/network_layer/network_layer.cpp b/src/knx/network_layer/network_layer.cpp index 1384751..d9d0840 100644 --- a/src/knx/network_layer/network_layer.cpp +++ b/src/knx/network_layer/network_layer.cpp @@ -1,10 +1,9 @@ #include "network_layer.h" -#include "device_object.h" -#include "data_link_layer.h" -#include "tpdu.h" -#include "cemi_frame.h" -#include "bits.h" -#include "apdu.h" + +#include "../interface_object/device_object.h" +#include "../datalink_layer/data_link_layer.h" +#include "../transport_layer/tpdu.h" +#include "../bits.h" NetworkLayer::NetworkLayer(DeviceObject& deviceObj, TransportLayer& layer) : _deviceObj(deviceObj), diff --git a/src/knx/network_layer/network_layer.h b/src/knx/network_layer/network_layer.h index 28be8d6..b3cfa83 100644 --- a/src/knx/network_layer/network_layer.h +++ b/src/knx/network_layer/network_layer.h @@ -1,10 +1,11 @@ #pragma once -#include -#include "knx_types.h" #include "npdu.h" -#include "transport_layer.h" #include "network_layer_entity.h" +#include "../transport_layer/transport_layer.h" +#include "../knx_types.h" + +#include class DeviceObject; class APDU; diff --git a/src/knx/network_layer/network_layer_device.cpp b/src/knx/network_layer/network_layer_device.cpp index 37b9221..b38a1ee 100644 --- a/src/knx/network_layer/network_layer_device.cpp +++ b/src/knx/network_layer/network_layer_device.cpp @@ -1,9 +1,10 @@ #include "network_layer_device.h" -#include "device_object.h" -#include "tpdu.h" -#include "cemi_frame.h" -#include "util/logger.h" -#include "bits.h" + +#include "../interface_object/device_object.h" +#include "../transport_layer/tpdu.h" +#include "../datalink_layer/cemi_frame.h" +#include "../util/logger.h" +#include "../bits.h" #define LOGGER Logger::logger("NetworkLayerDevice") diff --git a/src/knx/network_layer/network_layer_device.h b/src/knx/network_layer/network_layer_device.h index 4833dd0..b452a76 100644 --- a/src/knx/network_layer/network_layer_device.h +++ b/src/knx/network_layer/network_layer_device.h @@ -1,11 +1,11 @@ #pragma once -#include -#include "knx_types.h" -#include "npdu.h" -#include "transport_layer.h" #include "network_layer_entity.h" #include "network_layer.h" +#include "../transport_layer/transport_layer.h" +#include "../knx_types.h" + +#include class DeviceObject; diff --git a/src/knx/network_layer/network_layer_entity.cpp b/src/knx/network_layer/network_layer_entity.cpp index 925dd52..a0ccebe 100644 --- a/src/knx/network_layer/network_layer_entity.cpp +++ b/src/knx/network_layer/network_layer_entity.cpp @@ -1,8 +1,9 @@ -#include "network_layer.h" #include "network_layer_entity.h" -#include "tpdu.h" -#include "data_link_layer.h" -#include "bits.h" + +#include "network_layer.h" +#include "../transport_layer/tpdu.h" +#include "../datalink_layer/data_link_layer.h" +#include "../bits.h" NetworkLayerEntity::NetworkLayerEntity(NetworkLayer& netLayer, uint8_t entityIndex) : _netLayer(netLayer), _entityIndex(entityIndex) { diff --git a/src/knx/network_layer/network_layer_entity.h b/src/knx/network_layer/network_layer_entity.h index 0c579c1..5444a11 100644 --- a/src/knx/network_layer/network_layer_entity.h +++ b/src/knx/network_layer/network_layer_entity.h @@ -1,8 +1,9 @@ #pragma once -#include -#include "knx_types.h" #include "npdu.h" +#include "../knx_types.h" + +#include class DataLinkLayer; class NetworkLayer; diff --git a/src/knx/network_layer/npdu.cpp b/src/knx/network_layer/npdu.cpp index 6ee276c..a99d1f3 100644 --- a/src/knx/network_layer/npdu.cpp +++ b/src/knx/network_layer/npdu.cpp @@ -1,7 +1,9 @@ #include "npdu.h" -#include "cemi_frame.h" -#include -#include "bits.h" + +#include "../datalink_layer/cemi_frame.h" +#include "../bits.h" + +#include NPDU::NPDU(uint8_t* data, CemiFrame& frame): _data(data), _frame(frame) { diff --git a/src/knx/network_layer/npdu.h b/src/knx/network_layer/npdu.h index bd14ec6..75ee877 100644 --- a/src/knx/network_layer/npdu.h +++ b/src/knx/network_layer/npdu.h @@ -1,7 +1,8 @@ #pragma once -#include -#include "util/logger.h" +#include "../util/logger.h" + +#include class CemiFrame; class TPDU; diff --git a/src/knx/bau/bau27B0.cpp b/src/knx/rf/bau27B0.cpp similarity index 99% rename from src/knx/bau/bau27B0.cpp rename to src/knx/rf/bau27B0.cpp index 09dd862..99ddd6f 100644 --- a/src/knx/bau/bau27B0.cpp +++ b/src/knx/rf/bau27B0.cpp @@ -1,10 +1,10 @@ #include "bau27B0.h" + #include "bits.h" + #include #include -using namespace std; - Bau27B0::Bau27B0(Platform& platform) : BauSystemBDevice(platform), _dlLayer(_deviceObj, _rfMediumObj, _netLayer.getInterface(), _platform) diff --git a/src/knx/bau/bau27B0.h b/src/knx/rf/bau27B0.h similarity index 85% rename from src/knx/bau/bau27B0.h rename to src/knx/rf/bau27B0.h index a2e771b..8400c0f 100644 --- a/src/knx/bau/bau27B0.h +++ b/src/knx/rf/bau27B0.h @@ -1,17 +1,17 @@ #pragma once -#include "config.h" +#include "../config.h" -#include "bau_systemB_device.h" -#include "rf/rf_medium_object.h" +#include "rf_medium_object.h" #if defined(DeviceFamily_CC13X0) - #include "rf/rf_physical_layer_cc1310.h" + #include "rf_physical_layer_cc1310.h" #else - #include "rf/rf_physical_layer_cc1101.h" + #include "rf_physical_layer_cc1101.h" #endif -#include "rf/rf_data_link_layer.h" -#include "cemi_server.h" -#include "cemi_server_object.h" +#include "rf_data_link_layer.h" +#include "../bau/bau_systemB_device.h" +#include "../cemi_server/cemi_server.h" +#include "../cemi_server/cemi_server_object.h" class Bau27B0 : public BauSystemBDevice { diff --git a/src/knx/rf/rf_data_link_layer.cpp b/src/knx/rf/rf_data_link_layer.cpp index 7ea2d23..9607846 100644 --- a/src/knx/rf/rf_data_link_layer.cpp +++ b/src/knx/rf/rf_data_link_layer.cpp @@ -1,16 +1,17 @@ +#include "rf_data_link_layer.h" + #if defined(DeviceFamily_CC13X0) #include "rf_physical_layer_cc1310.h" #else #include "rf_physical_layer_cc1101.h" #endif -#include "rf_data_link_layer.h" -#include "../bits.h" -#include "../platform.h" -#include "../device_object.h" -#include "../address_table_object.h" #include "rf_medium_object.h" -#include "../cemi_frame.h" +#include "../bits.h" +#include "../platform/platform.h" +#include "../interface_object/device_object.h" +#include "../interface_object/address_table_object.h" +#include "../datalink_layer/cemi_frame.h" #include #include diff --git a/src/knx/rf/rf_data_link_layer.h b/src/knx/rf/rf_data_link_layer.h index 3b383fb..3f21f6f 100644 --- a/src/knx/rf/rf_data_link_layer.h +++ b/src/knx/rf/rf_data_link_layer.h @@ -2,8 +2,9 @@ #include "../config.h" -#include -#include "../data_link_layer.h" +#include "..datalink_layer/data_link_layer.h" + +#include #define MAX_KNX_TELEGRAM_SIZE 263 diff --git a/src/knx/rf/rf_medium_object.cpp b/src/knx/rf/rf_medium_object.cpp index 54d431b..2c0c732 100644 --- a/src/knx/rf/rf_medium_object.cpp +++ b/src/knx/rf/rf_medium_object.cpp @@ -1,8 +1,8 @@ -#include #include "rf_medium_object.h" + #include "../bits.h" -#include "../data_property.h" -#include "../function_property.h" + +#include RfMediumObject::RfMediumObject() { diff --git a/src/knx/rf/rf_medium_object.h b/src/knx/rf/rf_medium_object.h index 71ca419..d3ef859 100644 --- a/src/knx/rf/rf_medium_object.h +++ b/src/knx/rf/rf_medium_object.h @@ -1,6 +1,6 @@ #pragma once -#include "../interface_object.h" +#include "../interface_object/interface_object.h" class RfMediumObject: public InterfaceObject { diff --git a/src/knx/rf/rf_physical_layer.h b/src/knx/rf/rf_physical_layer.h index 8ee32ab..2b45b82 100644 --- a/src/knx/rf/rf_physical_layer.h +++ b/src/knx/rf/rf_physical_layer.h @@ -1,8 +1,8 @@ #pragma once -#include +#include "../platform/platform.h" -#include "../platform.h" +#include // Calculate the real packet size out of the L-field of FT3 frame data. See KNX-RF spec. 3.2.5 Data Link Layer frame format #define PACKET_SIZE(lField) ((((lField - 10 /*size of first pkt*/))/16 + 2 /*CRC in first pkt */) * 2 /*to bytes*/ +lField + 1 /*size of len byte*/) diff --git a/src/knx/rf/rf_physical_layer_cc1101.cpp b/src/knx/rf/rf_physical_layer_cc1101.cpp index 381adc0..0c6fbb8 100644 --- a/src/knx/rf/rf_physical_layer_cc1101.cpp +++ b/src/knx/rf/rf_physical_layer_cc1101.cpp @@ -1,8 +1,8 @@ #ifndef DeviceFamily_CC13X0 #include "rf_physical_layer_cc1101.h" -#include "rf_data_link_layer.h" +#include "rf_data_link_layer.h" #include "../bits.h" #include "../platform.h" diff --git a/src/knx/rf/rf_physical_layer_cc1101.h b/src/knx/rf/rf_physical_layer_cc1101.h index c8679a4..7eed58b 100644 --- a/src/knx/rf/rf_physical_layer_cc1101.h +++ b/src/knx/rf/rf_physical_layer_cc1101.h @@ -4,10 +4,10 @@ #include "../config.h" -#include - #include "rf_physical_layer.h" +#include + /*----------------------------------[standard]--------------------------------*/ #define CC1101_TIMEOUT 2000 // Time to wait for a response from CC1101 diff --git a/src/knx/rf/rf_physical_layer_cc1310.cpp b/src/knx/rf/rf_physical_layer_cc1310.cpp index f39dfb2..833b250 100644 --- a/src/knx/rf/rf_physical_layer_cc1310.cpp +++ b/src/knx/rf/rf_physical_layer_cc1310.cpp @@ -1,11 +1,6 @@ #ifdef DeviceFamily_CC13X0 - - -#include -#include -#include - #include "rf_physical_layer_cc1310.h" + #include "rf_data_link_layer.h" #include @@ -13,12 +8,15 @@ #include DeviceFamily_constructPath(driverlib/rf_prop_mailbox.h) #include #include "smartrf_settings/smartrf_settings.h" - +#include "../platform/platform.h" #include "../platform/cc1310_platform.h" #include "Board.h" +#include "../bits.h" -#include "bits.h" -#include "platform.h" + +#include +#include +#include #define RX_MAX_BUFFER_LENGTH 256 #define RF_TERMINATION_EVENT_MASK (RF_EventLastCmdDone | RF_EventLastFGCmdDone | RF_EventCmdAborted | RF_EventCmdStopped | RF_EventCmdCancelled) diff --git a/src/knx/rf/rf_physical_layer_cc1310.h b/src/knx/rf/rf_physical_layer_cc1310.h index ffc9038..d7dfa60 100644 --- a/src/knx/rf/rf_physical_layer_cc1310.h +++ b/src/knx/rf/rf_physical_layer_cc1310.h @@ -3,11 +3,10 @@ #ifdef DeviceFamily_CC13X0 #include "../config.h" +#include "rf_physical_layer.h" #include -#include "rf_physical_layer.h" - #define RX_PACKET_TIMEOUT 20 // Wait 20ms for packet reception to complete // loop states diff --git a/src/knx/bau/bau07B0.cpp b/src/knx/tp/bau07B0.cpp similarity index 99% rename from src/knx/bau/bau07B0.cpp rename to src/knx/tp/bau07B0.cpp index f1f8e0d..1c7a226 100644 --- a/src/knx/bau/bau07B0.cpp +++ b/src/knx/tp/bau07B0.cpp @@ -1,10 +1,10 @@ #include "bau07B0.h" + #include "bits.h" + #include #include -using namespace std; - Bau07B0::Bau07B0(Platform& platform) : BauSystemBDevice(platform), DataLinkLayerCallbacks(), _dlLayer(_deviceObj, _netLayer.getInterface(), _platform, (ITpUartCallBacks&) * this, (DataLinkLayerCallbacks*) this) diff --git a/src/knx/bau/bau07B0.h b/src/knx/tp/bau07B0.h similarity index 79% rename from src/knx/bau/bau07B0.h rename to src/knx/tp/bau07B0.h index e5074f7..af5521a 100644 --- a/src/knx/bau/bau07B0.h +++ b/src/knx/tp/bau07B0.h @@ -1,11 +1,11 @@ #pragma once -#include "config.h" +#include "../config.h" -#include "bau_systemB_device.h" -#include "tpuart_data_link_layer.h" -#include "cemi_server.h" -#include "cemi_server_object.h" +#include "../bau/bau_systemB_device.h" +#include "../tp/tpuart_data_link_layer.h" +#include "../cemi_server/cemi_server.h" +#include "../cemi_server/cemi_server_object.h" class Bau07B0 : public BauSystemBDevice, public ITpUartCallBacks, public DataLinkLayerCallbacks { diff --git a/src/knx/tp/tp_frame.cpp b/src/knx/tp/tp_frame.cpp index 226fd33..ce49df3 100644 --- a/src/knx/tp/tp_frame.cpp +++ b/src/knx/tp/tp_frame.cpp @@ -1,4 +1,5 @@ #include "tp_frame.h" + #include "bits.h" void TpFrame::printIt() const diff --git a/src/knx/tp/tp_frame.h b/src/knx/tp/tp_frame.h index 22462ed..d30bcc5 100644 --- a/src/knx/tp/tp_frame.h +++ b/src/knx/tp/tp_frame.h @@ -1,9 +1,10 @@ #pragma once -#include "cemi_frame.h" -#include "util/logger.h" +#include "../datalink_layer/cemi_frame.h" +#include "../util/logger.h" + #include -#include +#include // Means that the frame is invalid #define TP_FRAME_FLAG_INVALID 0b10000000 diff --git a/src/knx/tp/tpuart_data_link_layer.cpp b/src/knx/tp/tpuart_data_link_layer.cpp index bd9903e..02542c2 100644 --- a/src/knx/tp/tpuart_data_link_layer.cpp +++ b/src/knx/tp/tpuart_data_link_layer.cpp @@ -1,11 +1,10 @@ -#pragma GCC optimize("O3") - -#include "address_table_object.h" -#include "cemi_frame.h" -#include "device_object.h" -#include "platform.h" #include "tpuart_data_link_layer.h" -#include "bits.h" + +#include "../interface_object/address_table_object.h" +#include "../interface_object/device_object.h" +#include "../datalink_layer/cemi_frame.h" +#include "../platform/platform.h" +#include "../bits.h" /* * A new implementation of the tpuart connection. diff --git a/src/knx/tp/tpuart_data_link_layer.h b/src/knx/tp/tpuart_data_link_layer.h index a5b30d6..a2746a8 100644 --- a/src/knx/tp/tpuart_data_link_layer.h +++ b/src/knx/tp/tpuart_data_link_layer.h @@ -1,7 +1,8 @@ #pragma once -#include "data_link_layer.h" #include "tp_frame.h" +#include "../datalink_layer/data_link_layer.h" + #include #define MAX_KNX_TELEGRAM_SIZE 263 diff --git a/src/knx/transport_layer/tpdu.cpp b/src/knx/transport_layer/tpdu.cpp index 1e7ba23..90ccbe0 100644 --- a/src/knx/transport_layer/tpdu.cpp +++ b/src/knx/transport_layer/tpdu.cpp @@ -1,6 +1,7 @@ #include "tpdu.h" + #include "cemi_frame.h" -#include "bits.h" +#include "../bits.h" TPDU::TPDU(uint8_t* data, CemiFrame& frame): _data(data), _frame(frame) { diff --git a/src/knx/transport_layer/tpdu.h b/src/knx/transport_layer/tpdu.h index 2c33053..79182d6 100644 --- a/src/knx/transport_layer/tpdu.h +++ b/src/knx/transport_layer/tpdu.h @@ -1,8 +1,10 @@ #pragma once -#include "stdint.h" -#include "knx_types.h" -#include "util/logger.h" +#include "../knx_types.h" +#include "../util/logger.h" + +#include + class CemiFrame; class APDU; diff --git a/src/knx/transport_layer/transport_layer.cpp b/src/knx/transport_layer/transport_layer.cpp index 742bc4f..421a019 100644 --- a/src/knx/transport_layer/transport_layer.cpp +++ b/src/knx/transport_layer/transport_layer.cpp @@ -1,13 +1,13 @@ #include "transport_layer.h" -#include "apdu.h" -#include "cemi_frame.h" -#include "network_layer.h" -#include "application_layer.h" -#include "platform.h" -#include "util/logger.h" -#include + +#include "../application_layer/application_layer.h" +#include "../network_layer/network_layer.h" +#include "../platform/platform.h" +#include "../util/logger.h" #include "bits.h" +#include + #define LOGGER Logger::logger("TransportLayer") TransportLayer::TransportLayer(ApplicationLayer& layer): _savedFrame(0), diff --git a/src/knx/transport_layer/transport_layer.h b/src/knx/transport_layer/transport_layer.h index a74d9b5..94dcc6f 100644 --- a/src/knx/transport_layer/transport_layer.h +++ b/src/knx/transport_layer/transport_layer.h @@ -1,10 +1,11 @@ #pragma once -#include -#include "knx_types.h" #include "tpdu.h" -#include "address_table_object.h" -#include "cemi_frame.h" +#include "../knx_types.h" +#include "../interface_object/address_table_object.h" +#include "../datalink_layer/cemi_frame.h" + +#include class ApplicationLayer; class APDU; diff --git a/src/knx/util/memory.cpp b/src/knx/util/memory.cpp index b2ecd57..80dbb88 100644 --- a/src/knx/util/memory.cpp +++ b/src/knx/util/memory.cpp @@ -1,11 +1,10 @@ #include "memory.h" -#include "util/logger.h" - -#define LOGGER Logger::logger("Memory") +#include "logger.h" +#include "../bits.h" #include -#include "bits.h" +#define LOGGER Logger::logger("Memory") Memory::Memory(Platform& platform, DeviceObject& deviceObject) : _platform(platform), _deviceObject(deviceObject) diff --git a/src/knx/util/memory.h b/src/knx/util/memory.h index 6ac1757..1ebe4e0 100644 --- a/src/knx/util/memory.h +++ b/src/knx/util/memory.h @@ -2,9 +2,9 @@ #include #include "save_restore.h" -#include "platform.h" -#include "device_object.h" -#include "table_object.h" +#include "../platform/platform.h" +#include "../interface_object/device_object.h" +#include "../interface_object/table_object.h" #define MAXSAVE 5 #define MAXTABLEOBJ 4