From cd62a78eb4f1ac176ad8739d43706dac8ed67f62 Mon Sep 17 00:00:00 2001 From: Thomas Kunze Date: Sat, 17 Aug 2024 12:51:31 +0200 Subject: [PATCH] do away with some feature #ifdefs add #ifndef KNX_NO_* if necessary --- .gitignore | 2 +- examples/knx-linux-coupler/main.cpp | 5 --- examples/knx-linux/main.cpp | 5 --- platformio.ini | 27 ------------ src/CMakeLists.txt | 4 +- src/knx/bau07B0.cpp | 6 +-- src/knx/bau091A.cpp | 6 +-- src/knx/bau27B0.cpp | 6 +-- src/knx/bau2920.cpp | 6 +-- src/knx/bau57B0.cpp | 6 +-- src/knx/bau_systemB_coupler.cpp | 2 - src/knx/bau_systemB_device.cpp | 4 +- src/knx/cemi_frame.cpp | 4 +- src/knx/cemi_frame.h | 2 +- src/knx/cemi_server.cpp | 5 --- src/knx/cemi_server.h | 7 +--- src/knx/cemi_server_object.cpp | 6 --- src/knx/cemi_server_object.h | 5 --- src/knx/config.h | 41 ------------------- src/knx/data_link_layer.cpp | 2 +- src/knx/data_link_layer.h | 4 +- src/knx/device_object.cpp | 2 +- src/knx/ip/ip_data_link_layer.cpp | 4 -- .../ip_host_protocol_address_information.cpp | 3 -- src/knx/ip/ip_parameter_object.cpp | 3 -- src/knx/ip/knx_ip_ch.cpp | 3 -- src/knx/ip/knx_ip_config_dib.cpp | 3 -- src/knx/ip/knx_ip_config_request.cpp | 3 -- src/knx/ip/knx_ip_connect_request.cpp | 3 -- src/knx/ip/knx_ip_connect_response.cpp | 3 -- src/knx/ip/knx_ip_crd.cpp | 3 -- src/knx/ip/knx_ip_cri.cpp | 3 -- src/knx/ip/knx_ip_description_request.cpp | 3 -- src/knx/ip/knx_ip_description_response.cpp | 3 -- src/knx/ip/knx_ip_device_information_dib.cpp | 3 -- src/knx/ip/knx_ip_dib.cpp | 3 -- src/knx/ip/knx_ip_disconnect_request.cpp | 3 -- src/knx/ip/knx_ip_disconnect_response.cpp | 3 -- ...knx_ip_extended_device_information_dib.cpp | 3 -- src/knx/ip/knx_ip_frame.cpp | 3 -- src/knx/ip/knx_ip_knx_addresses_dib.cpp | 3 -- src/knx/ip/knx_ip_routing_indication.cpp | 3 -- src/knx/ip/knx_ip_search_request.cpp | 3 -- src/knx/ip/knx_ip_search_request_extended.cpp | 3 -- src/knx/ip/knx_ip_search_response.cpp | 3 -- .../ip/knx_ip_search_response_extended.cpp | 3 -- src/knx/ip/knx_ip_state_request.cpp | 3 -- src/knx/ip/knx_ip_state_response.cpp | 3 -- src/knx/ip/knx_ip_supported_service_dib.cpp | 3 -- src/knx/ip/knx_ip_tunnel_connection.cpp | 3 -- src/knx/ip/knx_ip_tunneling_ack.cpp | 3 -- src/knx/ip/knx_ip_tunneling_info_dib.cpp | 3 -- src/knx/ip/knx_ip_tunneling_request.cpp | 3 -- src/knx/network_layer_coupler.cpp | 2 - src/knx/network_layer_device.cpp | 2 - src/knx/rf/rf_data_link_layer.cpp | 6 +-- src/knx/rf/rf_medium_object.cpp | 4 -- src/knx/rf/rf_physical_layer_cc1101.cpp | 5 +-- src/knx/rf/rf_physical_layer_cc1310.cpp | 5 +-- src/knx/router_object.cpp | 4 +- src/knx/usb_tunnel_interface.cpp | 5 --- src/knx/usb_tunnel_interface.h | 3 -- 62 files changed, 20 insertions(+), 267 deletions(-) delete mode 100644 platformio.ini diff --git a/.gitignore b/.gitignore index 69f65ed..c7d2f2c 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ bld/ [Ll]og/ out flash.bin -build +build* dist *.egg-info doxyoutput diff --git a/examples/knx-linux-coupler/main.cpp b/examples/knx-linux-coupler/main.cpp index f8d7082..64a09b0 100644 --- a/examples/knx-linux-coupler/main.cpp +++ b/examples/knx-linux-coupler/main.cpp @@ -103,10 +103,5 @@ int main(int argc, char **argv) // opens the "value" sysfs file to read or write the GPIO pin value. // The following calls will close the "value" sysfs fiel for the pin // and unexport the GPIO pin. -#ifdef USE_RF - gpio_unexport(SPI_SS_PIN); - gpio_unexport(GPIO_GDO2_PIN); - gpio_unexport(GPIO_GDO0_PIN); -#endif printf("main() exit.\n"); } diff --git a/examples/knx-linux/main.cpp b/examples/knx-linux/main.cpp index 57b0fe2..488fbb4 100644 --- a/examples/knx-linux/main.cpp +++ b/examples/knx-linux/main.cpp @@ -160,10 +160,5 @@ int main(int argc, char **argv) // opens the "value" sysfs file to read or write the GPIO pin value. // The following calls will close the "value" sysfs fiel for the pin // and unexport the GPIO pin. -#ifdef USE_RF - gpio_unexport(SPI_SS_PIN); - gpio_unexport(GPIO_GDO2_PIN); - gpio_unexport(GPIO_GDO0_PIN); -#endif printf("main() exit.\n"); } diff --git a/platformio.ini b/platformio.ini deleted file mode 100644 index 23ac4f9..0000000 --- a/platformio.ini +++ /dev/null @@ -1,27 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -src_dir = examples/knx-demo - - -[env] -platform = atmelsam -board = zeroUSB -framework = arduino -build_type = debug -monitor_speed = 115200 -lib_ldf_mode = deep+ -lib_extra_dirs = - ${sysenv.USERPROFILE}/Documents/PlatformIO/Projects -build_flags = - -Wno-unknown-pragmas - -[env:build] diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 76ddddf..ca23e76 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -187,5 +187,5 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas - add_library(knx SHARED ${SOURCES}) target_include_directories(knx PUBLIC .) set_property(TARGET knx PROPERTY CXX_STANDARD 11) -target_compile_definitions(knx PUBLIC -DUSE_RF -DUSE_USB -DUSE_TP -D_USE_IP -DUSE_CEMI_SERVER - -DKNX_TUNNELING=1 -DUSE_DATASECURE -DALL_MASKS) +target_compile_definitions(knx PUBLIC -DUSE_USB -DUSE_CEMI_SERVER + -DKNX_TUNNELING=1 -DUSE_DATASECURE) diff --git a/src/knx/bau07B0.cpp b/src/knx/bau07B0.cpp index 24145ba..f1f8e0d 100644 --- a/src/knx/bau07B0.cpp +++ b/src/knx/bau07B0.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#if (MASK_VERSION == 0x07B0) || defined(ALL_MASKS) - #include "bau07B0.h" #include "bits.h" #include @@ -174,5 +171,4 @@ TPAckType Bau07B0::isAckRequired(uint16_t address, bool isGrpAddr) TpUartDataLinkLayer* Bau07B0::getDataLinkLayer() { return (TpUartDataLinkLayer*)&_dlLayer; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/bau091A.cpp b/src/knx/bau091A.cpp index 43aa91e..befe68b 100644 --- a/src/knx/bau091A.cpp +++ b/src/knx/bau091A.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#if MASK_VERSION == 0x091A || defined(ALL_MASKS) - #include "bau091A.h" #include "bits.h" #include @@ -253,5 +250,4 @@ IpDataLinkLayer* Bau091A::getPrimaryDataLinkLayer() TpUartDataLinkLayer* Bau091A::getSecondaryDataLinkLayer() { return (TpUartDataLinkLayer*)&_dlLayerSecondary; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/bau27B0.cpp b/src/knx/bau27B0.cpp index b2253da..09dd862 100644 --- a/src/knx/bau27B0.cpp +++ b/src/knx/bau27B0.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#if MASK_VERSION == 0x27B0 || defined(ALL_MASKS) - #include "bau27B0.h" #include "bits.h" #include @@ -203,5 +200,4 @@ void Bau27B0::domainAddressSerialNumberReadLocalConfirm(Priority priority, HopCo RfDataLinkLayer* Bau27B0::getDataLinkLayer() { return (RfDataLinkLayer*)&_dlLayer; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/bau2920.cpp b/src/knx/bau2920.cpp index e844ab4..bd44f82 100644 --- a/src/knx/bau2920.cpp +++ b/src/knx/bau2920.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#if MASK_VERSION == 0x2920 || defined(ALL_MASKS) - #include "bau2920.h" #include "bits.h" #include @@ -177,5 +174,4 @@ TpUartDataLinkLayer* Bau2920::getPrimaryDataLinkLayer() RfDataLinkLayer* Bau2920::getSecondaryDataLinkLayer() { return (RfDataLinkLayer*)&_dlLayerSecondary; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/bau57B0.cpp b/src/knx/bau57B0.cpp index 609e503..1a9baae 100644 --- a/src/knx/bau57B0.cpp +++ b/src/knx/bau57B0.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#if MASK_VERSION == 0x57B0 || defined(ALL_MASKS) - #include "bau57B0.h" #include "bits.h" #include @@ -165,5 +162,4 @@ void Bau57B0::loop() IpDataLinkLayer* Bau57B0::getDataLinkLayer() { return (IpDataLinkLayer*)&_dlLayer; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/bau_systemB_coupler.cpp b/src/knx/bau_systemB_coupler.cpp index 2adfe0d..e71164f 100644 --- a/src/knx/bau_systemB_coupler.cpp +++ b/src/knx/bau_systemB_coupler.cpp @@ -1,4 +1,3 @@ -#if ((MASK_VERSION != 0x07B0) && (MASK_VERSION != 0x27B0) && (MASK_VERSION != 0x57B0)) || defined(ALL_MASKS) #include "bau_systemB_coupler.h" #include "bits.h" #include @@ -59,4 +58,3 @@ void BauSystemBCoupler::doMasterReset(EraseCode eraseCode, uint8_t channel) _secIfObj.masterReset(eraseCode, channel); #endif } -#endif \ No newline at end of file diff --git a/src/knx/bau_systemB_device.cpp b/src/knx/bau_systemB_device.cpp index 3121543..ae4a5d9 100644 --- a/src/knx/bau_systemB_device.cpp +++ b/src/knx/bau_systemB_device.cpp @@ -1,4 +1,3 @@ -#if (MASK_VERSION == 0x07B0) || (MASK_VERSION == 0x27B0) || (MASK_VERSION == 0x57B0) || defined(ALL_MASKS) #include "bau_systemB_device.h" #include "bits.h" #include @@ -259,5 +258,4 @@ void BauSystemBDevice::groupValueWriteIndication(uint16_t asap, Priority priorit return; updateGroupObject(go, data, dataLength); -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/cemi_frame.cpp b/src/knx/cemi_frame.cpp index 6e5c9db..5ac73ea 100644 --- a/src/knx/cemi_frame.cpp +++ b/src/knx/cemi_frame.cpp @@ -165,7 +165,7 @@ void CemiFrame::fillTelegramTP(uint8_t* data) data[len - 1] = calcCrcTP(data, len - 1); } -#ifdef USE_RF +#ifndef KNX_NO_RF uint16_t CemiFrame::telegramLengthtRF() const { return totalLenght() - 3; @@ -321,7 +321,7 @@ void CemiFrame::destinationAddress(uint16_t value) { pushWord(value, _ctrl1 + 4); } -#ifdef USE_RF +#ifndef KNX_NO_RF uint8_t* CemiFrame::rfSerialOrDoA() const { return _rfSerialOrDoA; diff --git a/src/knx/cemi_frame.h b/src/knx/cemi_frame.h index 0b1d787..8ed60de 100644 --- a/src/knx/cemi_frame.h +++ b/src/knx/cemi_frame.h @@ -80,7 +80,7 @@ class CemiFrame TPDU _tpdu; APDU _apdu; uint16_t _length = 0; // only set if created from byte array -#ifdef USE_RF +#ifndef KNX_NO_RF // FIXME: integrate this propery in _data // only for RF medium uint8_t* _rfSerialOrDoA = 0; diff --git a/src/knx/cemi_server.cpp b/src/knx/cemi_server.cpp index c5dfedb..c5ad731 100644 --- a/src/knx/cemi_server.cpp +++ b/src/knx/cemi_server.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#ifdef USE_CEMI_SERVER - #include "cemi_server.h" #include "cemi_frame.h" #include "bau_systemB.h" @@ -425,5 +422,3 @@ void CemiServer::loop() _usbTunnelInterface.loop(); #endif } - -#endif diff --git a/src/knx/cemi_server.h b/src/knx/cemi_server.h index 2d2dd2d..796cec1 100644 --- a/src/knx/cemi_server.h +++ b/src/knx/cemi_server.h @@ -1,8 +1,5 @@ #pragma once -#include "config.h" -#ifdef USE_CEMI_SERVER - #include #include "knx_types.h" #include "usb_tunnel_interface.h" @@ -56,9 +53,7 @@ class CemiServer DataLinkLayer* _dataLinkLayer = nullptr; DataLinkLayer* _dataLinkLayerPrimary = nullptr; BauSystemB& _bau; -#ifdef USE_USB +#ifdef USE_USB UsbTunnelInterface _usbTunnelInterface; #endif }; - -#endif \ No newline at end of file diff --git a/src/knx/cemi_server_object.cpp b/src/knx/cemi_server_object.cpp index 30ef39d..2a9486c 100644 --- a/src/knx/cemi_server_object.cpp +++ b/src/knx/cemi_server_object.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#ifdef USE_CEMI_SERVER - #include #include "cemi_server_object.h" #include "bits.h" @@ -56,6 +53,3 @@ void CemiServerObject::clearSupportedMediaTypes() // We also set the medium as not available too property(PID_MEDIUM_AVAILABILITY)->write((uint16_t) 0); } - -#endif - diff --git a/src/knx/cemi_server_object.h b/src/knx/cemi_server_object.h index 143c7d7..799d479 100644 --- a/src/knx/cemi_server_object.h +++ b/src/knx/cemi_server_object.h @@ -1,8 +1,5 @@ #pragma once -#include "config.h" -#ifdef USE_CEMI_SERVER - #include "interface_object.h" class CemiServerObject: public InterfaceObject @@ -13,5 +10,3 @@ class CemiServerObject: public InterfaceObject void setMediumTypeAsSupported(DptMedium dptMedium); void clearSupportedMediaTypes(); }; - -#endif diff --git a/src/knx/config.h b/src/knx/config.h index 83b6ae1..858b3e0 100644 --- a/src/knx/config.h +++ b/src/knx/config.h @@ -27,41 +27,6 @@ //#define MASK_VERSION 0x2920 // Data Linklayer Driver Options - #if MASK_VERSION == 0x07B0 - #ifndef USE_IP - #define USE_IP - #endif - #endif - - #if MASK_VERSION == 0x27B0 - #ifndef USE_RF - #define USE_RF - #endif - #endif - - #if MASK_VERSION == 0x57B0 - #ifndef USE_IP - #define USE_IP - #endif - #endif - - #if MASK_VERSION == 0x091A - #ifndef USE_TP - #define USE_TP - #endif - #ifndef USE_IP - #define USE_IP - #endif - #endif - - #if MASK_VERSION == 0x2920 - #ifndef USE_TP - #define USE_TP - #endif - #ifndef USE_RF - #define USE_RF - #endif - #endif // cEMI options //#define USE_USB @@ -72,12 +37,6 @@ #endif #endif - #if defined(KNX_TUNNELING) - #ifndef USE_IP - #define USE_IP - #endif - #endif - // KNX Data Secure Options // Define via a compiler -D flag if required // #define USE_DATASECURE diff --git a/src/knx/data_link_layer.cpp b/src/knx/data_link_layer.cpp index f2a88c6..3eb159d 100644 --- a/src/knx/data_link_layer.cpp +++ b/src/knx/data_link_layer.cpp @@ -258,7 +258,7 @@ bool DataLinkLayer::sendTelegram(NPDU& npdu, AckType ack, uint16_t destinationAd // We can just copy the pointer for rfSerialOrDoA as sendFrame() sets // a pointer to const uint8_t data in either device object (serial) or // RF medium object (domain address) -#ifdef USE_RF +#ifndef KNX_NO_RF tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA()); tmpFrame.rfInfo(frame.rfInfo()); tmpFrame.rfLfn(frame.rfLfn()); diff --git a/src/knx/data_link_layer.h b/src/knx/data_link_layer.h index 2c1f37f..5e610ba 100644 --- a/src/knx/data_link_layer.h +++ b/src/knx/data_link_layer.h @@ -32,17 +32,15 @@ class DataLinkLayer DataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity, Platform& platform); -#ifdef USE_CEMI_SERVER // from tunnel - void cemiServer(CemiServer& cemiServer); void dataRequestFromTunnel(CemiFrame& frame); + void cemiServer(CemiServer& cemiServer); #ifdef KNX_TUNNELING virtual void dataRequestToTunnel(CemiFrame& frame); virtual void dataConfirmationToTunnel(CemiFrame& frame); virtual void dataIndicationToTunnel(CemiFrame& frame); virtual bool isTunnelAddress(uint16_t addr); void ipParameterObject(IpParameterObject* object); -#endif #endif // from network layer diff --git a/src/knx/device_object.cpp b/src/knx/device_object.cpp index b6138f7..4397bdc 100644 --- a/src/knx/device_object.cpp +++ b/src/knx/device_object.cpp @@ -88,7 +88,7 @@ DeviceObject::DeviceObject() new DataProperty(PID_IO_LIST, false, PDT_UNSIGNED_INT, 8, ReadLv3 | WriteLv0), new DataProperty(PID_HARDWARE_TYPE, true, PDT_GENERIC_06, 1, ReadLv3 | WriteLv3, hardwareType), new DataProperty(PID_DEVICE_DESCRIPTOR, false, PDT_GENERIC_02, 1, ReadLv3 | WriteLv0), -#ifdef USE_RF +#ifndef KNX_NO_RF new DataProperty(PID_RF_DOMAIN_ADDRESS_CEMI_SERVER, true, PDT_GENERIC_06, 1, ReadLv3 | WriteLv3), #endif }; diff --git a/src/knx/ip/ip_data_link_layer.cpp b/src/knx/ip/ip_data_link_layer.cpp index 92a91b6..8b27ddd 100644 --- a/src/knx/ip/ip_data_link_layer.cpp +++ b/src/knx/ip/ip_data_link_layer.cpp @@ -1,6 +1,3 @@ -#include "../config.h" -#ifdef USE_IP - #include "ip_data_link_layer.h" #include "../bits.h" @@ -1187,4 +1184,3 @@ bool IpDataLinkLayer::isSendLimitReached() return false; } } -#endif \ No newline at end of file diff --git a/src/knx/ip/ip_host_protocol_address_information.cpp b/src/knx/ip/ip_host_protocol_address_information.cpp index 4ae42e4..67c930f 100644 --- a/src/knx/ip/ip_host_protocol_address_information.cpp +++ b/src/knx/ip/ip_host_protocol_address_information.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "ip_host_protocol_address_information.h" #include "../bits.h" @@ -47,4 +45,3 @@ void IpHostProtocolAddressInformation::ipPortNumber(uint16_t value) { pushWord(value, _data + 6); } -#endif \ No newline at end of file diff --git a/src/knx/ip/ip_parameter_object.cpp b/src/knx/ip/ip_parameter_object.cpp index 0a112cb..885adc8 100644 --- a/src/knx/ip/ip_parameter_object.cpp +++ b/src/knx/ip/ip_parameter_object.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "ip_parameter_object.h" #include "../bits.h" @@ -139,4 +137,3 @@ uint16_t* IpParameterObject::additionalIndivualAddresses(uint8_t& numAddresses) #endif return (uint16_t*) propertyData(PID_ADDITIONAL_INDIVIDUAL_ADDRESSES); } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_ch.cpp b/src/knx/ip/knx_ip_ch.cpp index cd3b604..29dd932 100644 --- a/src/knx/ip/knx_ip_ch.cpp +++ b/src/knx/ip/knx_ip_ch.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_ch.h" KnxIpCH::KnxIpCH(uint8_t* data) : _data(data) @@ -47,4 +45,3 @@ uint8_t KnxIpCH::status() const { return _data[3]; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_config_dib.cpp b/src/knx/ip/knx_ip_config_dib.cpp index bda9ecf..0a56f06 100644 --- a/src/knx/ip/knx_ip_config_dib.cpp +++ b/src/knx/ip/knx_ip_config_dib.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_config_dib.h" KnxIpConfigDIB::KnxIpConfigDIB(uint8_t* data, bool isCurrent) : KnxIpDIB(data) @@ -92,4 +90,3 @@ void KnxIpConfigDIB::info2(uint8_t addr) else _data[19] = addr; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_config_request.cpp b/src/knx/ip/knx_ip_config_request.cpp index 727ee68..eb9651e 100644 --- a/src/knx/ip/knx_ip_config_request.cpp +++ b/src/knx/ip/knx_ip_config_request.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_config_request.h" KnxIpConfigRequest::KnxIpConfigRequest(uint8_t* data, uint16_t length) @@ -16,4 +14,3 @@ KnxIpCH& KnxIpConfigRequest::connectionHeader() { return _ch; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_connect_request.cpp b/src/knx/ip/knx_ip_connect_request.cpp index 9068149..9bfa436 100644 --- a/src/knx/ip/knx_ip_connect_request.cpp +++ b/src/knx/ip/knx_ip_connect_request.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_connect_request.h" KnxIpConnectRequest::KnxIpConnectRequest(uint8_t* data, uint16_t length) @@ -20,4 +18,3 @@ KnxIpCRI& KnxIpConnectRequest::cri() { return _cri; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_connect_response.cpp b/src/knx/ip/knx_ip_connect_response.cpp index cbaefdb..6d59480 100644 --- a/src/knx/ip/knx_ip_connect_response.cpp +++ b/src/knx/ip/knx_ip_connect_response.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_connect_response.h" KnxIpConnectResponse::KnxIpConnectResponse(IpParameterObject& parameters, uint16_t address, uint16_t port, uint8_t channel, uint8_t type) @@ -42,4 +40,3 @@ KnxIpCRD& KnxIpConnectResponse::crd() { return _crd; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_crd.cpp b/src/knx/ip/knx_ip_crd.cpp index f4157df..044a6ad 100644 --- a/src/knx/ip/knx_ip_crd.cpp +++ b/src/knx/ip/knx_ip_crd.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_crd.h" KnxIpCRD::KnxIpCRD(uint8_t* data) : _data(data) @@ -40,4 +38,3 @@ void KnxIpCRD::address(uint16_t value) _data[2] = value >> 8; _data[3] = value & 0xFF; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_cri.cpp b/src/knx/ip/knx_ip_cri.cpp index 7cb287f..6f2903e 100644 --- a/src/knx/ip/knx_ip_cri.cpp +++ b/src/knx/ip/knx_ip_cri.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_cri.h" KnxIpCRI::KnxIpCRI(uint8_t* data) : _data(data) @@ -37,4 +35,3 @@ void KnxIpCRI::layer(uint8_t value) { _data[2] = value; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_description_request.cpp b/src/knx/ip/knx_ip_description_request.cpp index eb22ea3..69d79eb 100644 --- a/src/knx/ip/knx_ip_description_request.cpp +++ b/src/knx/ip/knx_ip_description_request.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_description_request.h" KnxIpDescriptionRequest::KnxIpDescriptionRequest(uint8_t* data, uint16_t length) @@ -12,4 +10,3 @@ IpHostProtocolAddressInformation& KnxIpDescriptionRequest::hpaiCtrl() { return _hpaiCtrl; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_description_response.cpp b/src/knx/ip/knx_ip_description_response.cpp index 473d1b5..a59041d 100644 --- a/src/knx/ip/knx_ip_description_response.cpp +++ b/src/knx/ip/knx_ip_description_response.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_description_response.h" #define LEN_SERVICE_FAMILIES 2 @@ -70,4 +68,3 @@ KnxIpSupportedServiceDIB& KnxIpDescriptionResponse::supportedServices() { return _supportedServices; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_device_information_dib.cpp b/src/knx/ip/knx_ip_device_information_dib.cpp index ccabf42..e8d2996 100644 --- a/src/knx/ip/knx_ip_device_information_dib.cpp +++ b/src/knx/ip/knx_ip_device_information_dib.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_device_information_dib.h" #include "../bits.h" @@ -100,4 +98,3 @@ void KnxIpDeviceInformationDIB::friendlyName(const uint8_t* value) { pushByteArray(value, LEN_FRIENDLY_NAME, _data + 24); } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_dib.cpp b/src/knx/ip/knx_ip_dib.cpp index cd33567..e469e2b 100644 --- a/src/knx/ip/knx_ip_dib.cpp +++ b/src/knx/ip/knx_ip_dib.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_dib.h" KnxIpDIB::KnxIpDIB(uint8_t* data) : _data(data) @@ -27,4 +25,3 @@ void KnxIpDIB::code(DescriptionTypeCode value) { _data[1] = value; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_disconnect_request.cpp b/src/knx/ip/knx_ip_disconnect_request.cpp index b59c5bd..c990830 100644 --- a/src/knx/ip/knx_ip_disconnect_request.cpp +++ b/src/knx/ip/knx_ip_disconnect_request.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_disconnect_request.h" KnxIpDisconnectRequest::KnxIpDisconnectRequest(uint8_t* data, uint16_t length) @@ -25,4 +23,3 @@ void KnxIpDisconnectRequest::channelId(uint8_t channelId) { _data[LEN_KNXIP_HEADER] = channelId; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_disconnect_response.cpp b/src/knx/ip/knx_ip_disconnect_response.cpp index 858f907..6121c7d 100644 --- a/src/knx/ip/knx_ip_disconnect_response.cpp +++ b/src/knx/ip/knx_ip_disconnect_response.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_disconnect_response.h" KnxIpDisconnectResponse::KnxIpDisconnectResponse(uint8_t channel, uint8_t status) @@ -10,4 +8,3 @@ KnxIpDisconnectResponse::KnxIpDisconnectResponse(uint8_t channel, uint8_t status _data[LEN_KNXIP_HEADER] = channel; _data[LEN_KNXIP_HEADER + 1] = status; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_extended_device_information_dib.cpp b/src/knx/ip/knx_ip_extended_device_information_dib.cpp index 50bcd4e..40de5a7 100644 --- a/src/knx/ip/knx_ip_extended_device_information_dib.cpp +++ b/src/knx/ip/knx_ip_extended_device_information_dib.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_extended_device_information_dib.h" #include "../bits.h" @@ -40,4 +38,3 @@ void KnxIpExtendedDeviceInformationDIB::deviceDescriptor(uint16_t value) { pushWord(value, _data + 6); } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_frame.cpp b/src/knx/ip/knx_ip_frame.cpp index 09643f1..352901f 100644 --- a/src/knx/ip/knx_ip_frame.cpp +++ b/src/knx/ip/knx_ip_frame.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_frame.h" #include @@ -78,4 +76,3 @@ KnxIpFrame::KnxIpFrame(uint16_t length) protocolVersion(KnxIp1_0); totalLength(length); } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_knx_addresses_dib.cpp b/src/knx/ip/knx_ip_knx_addresses_dib.cpp index fb1c32e..8e55394 100644 --- a/src/knx/ip/knx_ip_knx_addresses_dib.cpp +++ b/src/knx/ip/knx_ip_knx_addresses_dib.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_knx_addresses_dib.h" KnxIpKnxAddressesDIB::KnxIpKnxAddressesDIB(uint8_t* data) : KnxIpDIB(data) @@ -25,4 +23,3 @@ void KnxIpKnxAddressesDIB::additional(uint16_t addr) currentPos += 2; length(currentPos - _data); } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_routing_indication.cpp b/src/knx/ip/knx_ip_routing_indication.cpp index 3c0666b..f9d2776 100644 --- a/src/knx/ip/knx_ip_routing_indication.cpp +++ b/src/knx/ip/knx_ip_routing_indication.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_routing_indication.h" #include @@ -20,4 +18,3 @@ KnxIpRoutingIndication::KnxIpRoutingIndication(CemiFrame frame) serviceTypeIdentifier(RoutingIndication); memcpy(_data + LEN_KNXIP_HEADER, frame.data(), frame.totalLenght()); } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_search_request.cpp b/src/knx/ip/knx_ip_search_request.cpp index 9f5b5a9..7478c92 100644 --- a/src/knx/ip/knx_ip_search_request.cpp +++ b/src/knx/ip/knx_ip_search_request.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_search_request.h" KnxIpSearchRequest::KnxIpSearchRequest(uint8_t* data, uint16_t length) @@ -12,4 +10,3 @@ IpHostProtocolAddressInformation& KnxIpSearchRequest::hpai() { return _hpai; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_search_request_extended.cpp b/src/knx/ip/knx_ip_search_request_extended.cpp index 35a037c..7c7e80b 100644 --- a/src/knx/ip/knx_ip_search_request_extended.cpp +++ b/src/knx/ip/knx_ip_search_request_extended.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_search_request_extended.h" #include "../bits.h" #include "service_families.h" @@ -66,4 +64,3 @@ bool KnxIpSearchRequestExtended::requestedDIB(uint8_t code) return requestedDIBs[code]; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_search_response.cpp b/src/knx/ip/knx_ip_search_response.cpp index 5f24cb8..6d91460 100644 --- a/src/knx/ip/knx_ip_search_response.cpp +++ b/src/knx/ip/knx_ip_search_response.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_search_response.h" #define LEN_SERVICE_FAMILIES 2 @@ -82,4 +80,3 @@ KnxIpSupportedServiceDIB& KnxIpSearchResponse::supportedServices() { return _supportedServices; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_search_response_extended.cpp b/src/knx/ip/knx_ip_search_response_extended.cpp index 878cd6e..db83559 100644 --- a/src/knx/ip/knx_ip_search_response_extended.cpp +++ b/src/knx/ip/knx_ip_search_response_extended.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_search_response_extended.h" #include "service_families.h" @@ -226,4 +224,3 @@ uint8_t* KnxIpSearchResponseExtended::DIBs() { return _data + LEN_KNXIP_HEADER + LEN_IPHPAI; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_state_request.cpp b/src/knx/ip/knx_ip_state_request.cpp index 6ed6302..816955c 100644 --- a/src/knx/ip/knx_ip_state_request.cpp +++ b/src/knx/ip/knx_ip_state_request.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_state_request.h" KnxIpStateRequest::KnxIpStateRequest(uint8_t* data, uint16_t length) @@ -15,4 +13,3 @@ uint8_t KnxIpStateRequest::channelId() { return _data[LEN_KNXIP_HEADER]; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_state_response.cpp b/src/knx/ip/knx_ip_state_response.cpp index cacae34..1006880 100644 --- a/src/knx/ip/knx_ip_state_response.cpp +++ b/src/knx/ip/knx_ip_state_response.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_state_response.h" #define LEN_SERVICE_FAMILIES 2 @@ -24,4 +22,3 @@ KnxIpStateResponse::KnxIpStateResponse(uint8_t channelId, uint8_t errorCode) _data[LEN_KNXIP_HEADER] = channelId; _data[LEN_KNXIP_HEADER + 1] = errorCode; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_supported_service_dib.cpp b/src/knx/ip/knx_ip_supported_service_dib.cpp index 8c1e165..901964b 100644 --- a/src/knx/ip/knx_ip_supported_service_dib.cpp +++ b/src/knx/ip/knx_ip_supported_service_dib.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_supported_service_dib.h" KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB(uint8_t* data) : KnxIpDIB(data) @@ -42,4 +40,3 @@ void KnxIpSupportedServiceDIB::serviceVersion(ServiceFamily family, uint8_t ver } } } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_tunnel_connection.cpp b/src/knx/ip/knx_ip_tunnel_connection.cpp index fb9f342..9d4fe2a 100644 --- a/src/knx/ip/knx_ip_tunnel_connection.cpp +++ b/src/knx/ip/knx_ip_tunnel_connection.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_tunnel_connection.h" KnxIpTunnelConnection::KnxIpTunnelConnection() @@ -19,4 +17,3 @@ void KnxIpTunnelConnection::Reset() IndividualAddress = 0; IsConfig = false; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_tunneling_ack.cpp b/src/knx/ip/knx_ip_tunneling_ack.cpp index 31c67d4..f29add1 100644 --- a/src/knx/ip/knx_ip_tunneling_ack.cpp +++ b/src/knx/ip/knx_ip_tunneling_ack.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_tunneling_ack.h" #include @@ -18,4 +16,3 @@ KnxIpCH& KnxIpTunnelingAck::connectionHeader() { return _ch; } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_tunneling_info_dib.cpp b/src/knx/ip/knx_ip_tunneling_info_dib.cpp index e824db3..9b0197a 100644 --- a/src/knx/ip/knx_ip_tunneling_info_dib.cpp +++ b/src/knx/ip/knx_ip_tunneling_info_dib.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_tunneling_info_dib.h" #include "service_families.h" @@ -27,4 +25,3 @@ void KnxIpTunnelingInfoDIB::tunnelingSlot(uint16_t addr, uint16_t state) currentPos += 4; length(currentPos - _data); } -#endif \ No newline at end of file diff --git a/src/knx/ip/knx_ip_tunneling_request.cpp b/src/knx/ip/knx_ip_tunneling_request.cpp index 31ed692..8beb249 100644 --- a/src/knx/ip/knx_ip_tunneling_request.cpp +++ b/src/knx/ip/knx_ip_tunneling_request.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_IP #include "knx_ip_tunneling_request.h" #include @@ -24,4 +22,3 @@ KnxIpCH& KnxIpTunnelingRequest::connectionHeader() { return _ch; } -#endif \ No newline at end of file diff --git a/src/knx/network_layer_coupler.cpp b/src/knx/network_layer_coupler.cpp index 1a9727a..6583e83 100644 --- a/src/knx/network_layer_coupler.cpp +++ b/src/knx/network_layer_coupler.cpp @@ -1,4 +1,3 @@ -#if ((MASK_VERSION != 0x07B0) && (MASK_VERSION != 0x27B0) && (MASK_VERSION != 0x57B0)) || defined(ALL_MASKS) #include "network_layer_coupler.h" #include "data_link_layer.h" #include "device_object.h" @@ -654,5 +653,4 @@ bool NetworkLayerCoupler::isTunnelAddress(uint16_t destination) // tunnels are managed within the IpDataLinkLayer - kPrimaryIfIndex return _netLayerEntities[kPrimaryIfIndex].dataLinkLayer().isTunnelAddress(destination); } -#endif #endif \ No newline at end of file diff --git a/src/knx/network_layer_device.cpp b/src/knx/network_layer_device.cpp index a24316f..105003e 100644 --- a/src/knx/network_layer_device.cpp +++ b/src/knx/network_layer_device.cpp @@ -1,4 +1,3 @@ -#if (MASK_VERSION == 0x07B0) || (MASK_VERSION == 0x27B0) || (MASK_VERSION == 0x57B0) || defined(ALL_MASKS) #include "network_layer_device.h" #include "device_object.h" #include "tpdu.h" @@ -149,4 +148,3 @@ void NetworkLayerDevice::systemBroadcastConfirm(AckType ack, FrameFormat format, HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter; _transportLayer.dataSystemBroadcastConfirm(ack, hopType, npdu.tpdu(), priority, status); } -#endif \ No newline at end of file diff --git a/src/knx/rf/rf_data_link_layer.cpp b/src/knx/rf/rf_data_link_layer.cpp index 22c0c9f..7ea2d23 100644 --- a/src/knx/rf/rf_data_link_layer.cpp +++ b/src/knx/rf/rf_data_link_layer.cpp @@ -1,6 +1,3 @@ -#include "../config.h" -#ifdef USE_RF - #if defined(DeviceFamily_CC13X0) #include "rf_physical_layer_cc1310.h" #else @@ -380,5 +377,4 @@ void RfDataLinkLayer::loadNextTxFrame(uint8_t** sendBuffer, uint16_t* sendBuffer } delete tx_frame; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/rf/rf_medium_object.cpp b/src/knx/rf/rf_medium_object.cpp index 94c5cde..54d431b 100644 --- a/src/knx/rf/rf_medium_object.cpp +++ b/src/knx/rf/rf_medium_object.cpp @@ -1,6 +1,3 @@ -#include "../config.h" -#ifdef USE_RF - #include #include "rf_medium_object.h" #include "../bits.h" @@ -57,4 +54,3 @@ void RfMediumObject::rfDomainAddress(const uint8_t* value) Property* prop = property(PID_RF_DOMAIN_ADDRESS); prop->write(value); } -#endif \ No newline at end of file diff --git a/src/knx/rf/rf_physical_layer_cc1101.cpp b/src/knx/rf/rf_physical_layer_cc1101.cpp index 94608ba..381adc0 100644 --- a/src/knx/rf/rf_physical_layer_cc1101.cpp +++ b/src/knx/rf/rf_physical_layer_cc1101.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_RF #ifndef DeviceFamily_CC13X0 #include "rf_physical_layer_cc1101.h" @@ -779,5 +777,4 @@ void RfPhysicalLayerCC1101::loop() } } -#endif // DeviceFamily_CC13X0 -#endif \ No newline at end of file +#endif // DeviceFamily_CC13X0 \ No newline at end of file diff --git a/src/knx/rf/rf_physical_layer_cc1310.cpp b/src/knx/rf/rf_physical_layer_cc1310.cpp index a7ec6bb..f39dfb2 100644 --- a/src/knx/rf/rf_physical_layer_cc1310.cpp +++ b/src/knx/rf/rf_physical_layer_cc1310.cpp @@ -1,5 +1,3 @@ -#include "../config.h" -#ifdef USE_RF #ifdef DeviceFamily_CC13X0 @@ -372,5 +370,4 @@ void RfPhysicalLayerCC1310::loop() } } -#endif // DeviceFamily_CC13X0 -#endif \ No newline at end of file +#endif // DeviceFamily_CC13X0 \ No newline at end of file diff --git a/src/knx/router_object.cpp b/src/knx/router_object.cpp index 00e46c6..2a5b2ba 100644 --- a/src/knx/router_object.cpp +++ b/src/knx/router_object.cpp @@ -1,5 +1,4 @@ #include "config.h" -#if ((MASK_VERSION != 0x07B0) && (MASK_VERSION != 0x27B0) && (MASK_VERSION != 0x57B0)) || defined(ALL_MASKS) #include #include "router_object.h" @@ -601,5 +600,4 @@ bool RouterObject::isGroupAddressInFilterTable(uint16_t groupAddress) } return false; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/src/knx/usb_tunnel_interface.cpp b/src/knx/usb_tunnel_interface.cpp index 3eb02c0..09772ca 100644 --- a/src/knx/usb_tunnel_interface.cpp +++ b/src/knx/usb_tunnel_interface.cpp @@ -1,6 +1,3 @@ -#include "config.h" -#ifdef USE_USB - #include "bits.h" #include "usb_tunnel_interface.h" #include "cemi_server.h" @@ -561,5 +558,3 @@ uint16_t UsbTunnelInterface::getHidReportDescriptorLength() { return sizeof(descHidReport); } - -#endif diff --git a/src/knx/usb_tunnel_interface.h b/src/knx/usb_tunnel_interface.h index 0395b02..a8919db 100644 --- a/src/knx/usb_tunnel_interface.h +++ b/src/knx/usb_tunnel_interface.h @@ -1,7 +1,5 @@ #pragma once -#include "config.h" -#ifdef USE_USB #include class CemiServer; @@ -93,4 +91,3 @@ class UsbTunnelInterface void handleBusAccessServerProtocol(ServiceIdType servId, const uint8_t* requestData, uint16_t packetLength); void sendKnxHidReport(ProtocolIdType protId, ServiceIdType servId, uint8_t* data, uint16_t length); }; -#endif \ No newline at end of file