do away with some feature #ifdefs add #ifndef KNX_NO_* if necessary

This commit is contained in:
Thomas Kunze 2024-08-17 12:51:31 +02:00
parent 32bd812ace
commit cd62a78eb4
62 changed files with 20 additions and 267 deletions

2
.gitignore vendored
View File

@ -23,7 +23,7 @@ bld/
[Ll]og/ [Ll]og/
out out
flash.bin flash.bin
build build*
dist dist
*.egg-info *.egg-info
doxyoutput doxyoutput

View File

@ -103,10 +103,5 @@ int main(int argc, char **argv)
// opens the "value" sysfs file to read or write the GPIO pin value. // 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 // The following calls will close the "value" sysfs fiel for the pin
// and unexport the GPIO 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"); printf("main() exit.\n");
} }

View File

@ -160,10 +160,5 @@ int main(int argc, char **argv)
// opens the "value" sysfs file to read or write the GPIO pin value. // 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 // The following calls will close the "value" sysfs fiel for the pin
// and unexport the GPIO 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"); printf("main() exit.\n");
} }

View File

@ -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]

View File

@ -187,5 +187,5 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -
add_library(knx SHARED ${SOURCES}) add_library(knx SHARED ${SOURCES})
target_include_directories(knx PUBLIC .) target_include_directories(knx PUBLIC .)
set_property(TARGET knx PROPERTY CXX_STANDARD 11) 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 target_compile_definitions(knx PUBLIC -DUSE_USB -DUSE_CEMI_SERVER
-DKNX_TUNNELING=1 -DUSE_DATASECURE -DALL_MASKS) -DKNX_TUNNELING=1 -DUSE_DATASECURE)

View File

@ -1,6 +1,3 @@
#include "config.h"
#if (MASK_VERSION == 0x07B0) || defined(ALL_MASKS)
#include "bau07B0.h" #include "bau07B0.h"
#include "bits.h" #include "bits.h"
#include <string.h> #include <string.h>
@ -175,4 +172,3 @@ TpUartDataLinkLayer* Bau07B0::getDataLinkLayer()
{ {
return (TpUartDataLinkLayer*)&_dlLayer; return (TpUartDataLinkLayer*)&_dlLayer;
} }
#endif

View File

@ -1,6 +1,3 @@
#include "config.h"
#if MASK_VERSION == 0x091A || defined(ALL_MASKS)
#include "bau091A.h" #include "bau091A.h"
#include "bits.h" #include "bits.h"
#include <string.h> #include <string.h>
@ -254,4 +251,3 @@ TpUartDataLinkLayer* Bau091A::getSecondaryDataLinkLayer()
{ {
return (TpUartDataLinkLayer*)&_dlLayerSecondary; return (TpUartDataLinkLayer*)&_dlLayerSecondary;
} }
#endif

View File

@ -1,6 +1,3 @@
#include "config.h"
#if MASK_VERSION == 0x27B0 || defined(ALL_MASKS)
#include "bau27B0.h" #include "bau27B0.h"
#include "bits.h" #include "bits.h"
#include <string.h> #include <string.h>
@ -204,4 +201,3 @@ RfDataLinkLayer* Bau27B0::getDataLinkLayer()
{ {
return (RfDataLinkLayer*)&_dlLayer; return (RfDataLinkLayer*)&_dlLayer;
} }
#endif

View File

@ -1,6 +1,3 @@
#include "config.h"
#if MASK_VERSION == 0x2920 || defined(ALL_MASKS)
#include "bau2920.h" #include "bau2920.h"
#include "bits.h" #include "bits.h"
#include <string.h> #include <string.h>
@ -178,4 +175,3 @@ RfDataLinkLayer* Bau2920::getSecondaryDataLinkLayer()
{ {
return (RfDataLinkLayer*)&_dlLayerSecondary; return (RfDataLinkLayer*)&_dlLayerSecondary;
} }
#endif

View File

@ -1,6 +1,3 @@
#include "config.h"
#if MASK_VERSION == 0x57B0 || defined(ALL_MASKS)
#include "bau57B0.h" #include "bau57B0.h"
#include "bits.h" #include "bits.h"
#include <string.h> #include <string.h>
@ -166,4 +163,3 @@ IpDataLinkLayer* Bau57B0::getDataLinkLayer()
{ {
return (IpDataLinkLayer*)&_dlLayer; return (IpDataLinkLayer*)&_dlLayer;
} }
#endif

View File

@ -1,4 +1,3 @@
#if ((MASK_VERSION != 0x07B0) && (MASK_VERSION != 0x27B0) && (MASK_VERSION != 0x57B0)) || defined(ALL_MASKS)
#include "bau_systemB_coupler.h" #include "bau_systemB_coupler.h"
#include "bits.h" #include "bits.h"
#include <string.h> #include <string.h>
@ -59,4 +58,3 @@ void BauSystemBCoupler::doMasterReset(EraseCode eraseCode, uint8_t channel)
_secIfObj.masterReset(eraseCode, channel); _secIfObj.masterReset(eraseCode, channel);
#endif #endif
} }
#endif

View File

@ -1,4 +1,3 @@
#if (MASK_VERSION == 0x07B0) || (MASK_VERSION == 0x27B0) || (MASK_VERSION == 0x57B0) || defined(ALL_MASKS)
#include "bau_systemB_device.h" #include "bau_systemB_device.h"
#include "bits.h" #include "bits.h"
#include <string.h> #include <string.h>
@ -260,4 +259,3 @@ void BauSystemBDevice::groupValueWriteIndication(uint16_t asap, Priority priorit
updateGroupObject(go, data, dataLength); updateGroupObject(go, data, dataLength);
} }
#endif

View File

@ -165,7 +165,7 @@ void CemiFrame::fillTelegramTP(uint8_t* data)
data[len - 1] = calcCrcTP(data, len - 1); data[len - 1] = calcCrcTP(data, len - 1);
} }
#ifdef USE_RF #ifndef KNX_NO_RF
uint16_t CemiFrame::telegramLengthtRF() const uint16_t CemiFrame::telegramLengthtRF() const
{ {
return totalLenght() - 3; return totalLenght() - 3;
@ -321,7 +321,7 @@ void CemiFrame::destinationAddress(uint16_t value)
{ {
pushWord(value, _ctrl1 + 4); pushWord(value, _ctrl1 + 4);
} }
#ifdef USE_RF #ifndef KNX_NO_RF
uint8_t* CemiFrame::rfSerialOrDoA() const uint8_t* CemiFrame::rfSerialOrDoA() const
{ {
return _rfSerialOrDoA; return _rfSerialOrDoA;

View File

@ -80,7 +80,7 @@ class CemiFrame
TPDU _tpdu; TPDU _tpdu;
APDU _apdu; APDU _apdu;
uint16_t _length = 0; // only set if created from byte array uint16_t _length = 0; // only set if created from byte array
#ifdef USE_RF #ifndef KNX_NO_RF
// FIXME: integrate this propery in _data // FIXME: integrate this propery in _data
// only for RF medium // only for RF medium
uint8_t* _rfSerialOrDoA = 0; uint8_t* _rfSerialOrDoA = 0;

View File

@ -1,6 +1,3 @@
#include "config.h"
#ifdef USE_CEMI_SERVER
#include "cemi_server.h" #include "cemi_server.h"
#include "cemi_frame.h" #include "cemi_frame.h"
#include "bau_systemB.h" #include "bau_systemB.h"
@ -425,5 +422,3 @@ void CemiServer::loop()
_usbTunnelInterface.loop(); _usbTunnelInterface.loop();
#endif #endif
} }
#endif

View File

@ -1,8 +1,5 @@
#pragma once #pragma once
#include "config.h"
#ifdef USE_CEMI_SERVER
#include <stdint.h> #include <stdint.h>
#include "knx_types.h" #include "knx_types.h"
#include "usb_tunnel_interface.h" #include "usb_tunnel_interface.h"
@ -60,5 +57,3 @@ class CemiServer
UsbTunnelInterface _usbTunnelInterface; UsbTunnelInterface _usbTunnelInterface;
#endif #endif
}; };
#endif

View File

@ -1,6 +1,3 @@
#include "config.h"
#ifdef USE_CEMI_SERVER
#include <cstring> #include <cstring>
#include "cemi_server_object.h" #include "cemi_server_object.h"
#include "bits.h" #include "bits.h"
@ -56,6 +53,3 @@ void CemiServerObject::clearSupportedMediaTypes()
// We also set the medium as not available too // We also set the medium as not available too
property(PID_MEDIUM_AVAILABILITY)->write((uint16_t) 0); property(PID_MEDIUM_AVAILABILITY)->write((uint16_t) 0);
} }
#endif

View File

@ -1,8 +1,5 @@
#pragma once #pragma once
#include "config.h"
#ifdef USE_CEMI_SERVER
#include "interface_object.h" #include "interface_object.h"
class CemiServerObject: public InterfaceObject class CemiServerObject: public InterfaceObject
@ -13,5 +10,3 @@ class CemiServerObject: public InterfaceObject
void setMediumTypeAsSupported(DptMedium dptMedium); void setMediumTypeAsSupported(DptMedium dptMedium);
void clearSupportedMediaTypes(); void clearSupportedMediaTypes();
}; };
#endif

View File

@ -27,41 +27,6 @@
//#define MASK_VERSION 0x2920 //#define MASK_VERSION 0x2920
// Data Linklayer Driver Options // 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 // cEMI options
//#define USE_USB //#define USE_USB
@ -72,12 +37,6 @@
#endif #endif
#endif #endif
#if defined(KNX_TUNNELING)
#ifndef USE_IP
#define USE_IP
#endif
#endif
// KNX Data Secure Options // KNX Data Secure Options
// Define via a compiler -D flag if required // Define via a compiler -D flag if required
// #define USE_DATASECURE // #define USE_DATASECURE

View File

@ -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 // We can just copy the pointer for rfSerialOrDoA as sendFrame() sets
// a pointer to const uint8_t data in either device object (serial) or // a pointer to const uint8_t data in either device object (serial) or
// RF medium object (domain address) // RF medium object (domain address)
#ifdef USE_RF #ifndef KNX_NO_RF
tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA()); tmpFrame.rfSerialOrDoA(frame.rfSerialOrDoA());
tmpFrame.rfInfo(frame.rfInfo()); tmpFrame.rfInfo(frame.rfInfo());
tmpFrame.rfLfn(frame.rfLfn()); tmpFrame.rfLfn(frame.rfLfn());

View File

@ -32,17 +32,15 @@ class DataLinkLayer
DataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity, DataLinkLayer(DeviceObject& devObj, NetworkLayerEntity& netLayerEntity,
Platform& platform); Platform& platform);
#ifdef USE_CEMI_SERVER
// from tunnel // from tunnel
void cemiServer(CemiServer& cemiServer);
void dataRequestFromTunnel(CemiFrame& frame); void dataRequestFromTunnel(CemiFrame& frame);
void cemiServer(CemiServer& cemiServer);
#ifdef KNX_TUNNELING #ifdef KNX_TUNNELING
virtual void dataRequestToTunnel(CemiFrame& frame); virtual void dataRequestToTunnel(CemiFrame& frame);
virtual void dataConfirmationToTunnel(CemiFrame& frame); virtual void dataConfirmationToTunnel(CemiFrame& frame);
virtual void dataIndicationToTunnel(CemiFrame& frame); virtual void dataIndicationToTunnel(CemiFrame& frame);
virtual bool isTunnelAddress(uint16_t addr); virtual bool isTunnelAddress(uint16_t addr);
void ipParameterObject(IpParameterObject* object); void ipParameterObject(IpParameterObject* object);
#endif
#endif #endif
// from network layer // from network layer

View File

@ -88,7 +88,7 @@ DeviceObject::DeviceObject()
new DataProperty(PID_IO_LIST, false, PDT_UNSIGNED_INT, 8, ReadLv3 | WriteLv0), 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_HARDWARE_TYPE, true, PDT_GENERIC_06, 1, ReadLv3 | WriteLv3, hardwareType),
new DataProperty(PID_DEVICE_DESCRIPTOR, false, PDT_GENERIC_02, 1, ReadLv3 | WriteLv0), 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), new DataProperty(PID_RF_DOMAIN_ADDRESS_CEMI_SERVER, true, PDT_GENERIC_06, 1, ReadLv3 | WriteLv3),
#endif #endif
}; };

View File

@ -1,6 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "ip_data_link_layer.h" #include "ip_data_link_layer.h"
#include "../bits.h" #include "../bits.h"
@ -1187,4 +1184,3 @@ bool IpDataLinkLayer::isSendLimitReached()
return false; return false;
} }
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "ip_host_protocol_address_information.h" #include "ip_host_protocol_address_information.h"
#include "../bits.h" #include "../bits.h"
@ -47,4 +45,3 @@ void IpHostProtocolAddressInformation::ipPortNumber(uint16_t value)
{ {
pushWord(value, _data + 6); pushWord(value, _data + 6);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "ip_parameter_object.h" #include "ip_parameter_object.h"
#include "../bits.h" #include "../bits.h"
@ -139,4 +137,3 @@ uint16_t* IpParameterObject::additionalIndivualAddresses(uint8_t& numAddresses)
#endif #endif
return (uint16_t*) propertyData(PID_ADDITIONAL_INDIVIDUAL_ADDRESSES); return (uint16_t*) propertyData(PID_ADDITIONAL_INDIVIDUAL_ADDRESSES);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_ch.h" #include "knx_ip_ch.h"
KnxIpCH::KnxIpCH(uint8_t* data) : _data(data) KnxIpCH::KnxIpCH(uint8_t* data) : _data(data)
@ -47,4 +45,3 @@ uint8_t KnxIpCH::status() const
{ {
return _data[3]; return _data[3];
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_config_dib.h" #include "knx_ip_config_dib.h"
KnxIpConfigDIB::KnxIpConfigDIB(uint8_t* data, bool isCurrent) : KnxIpDIB(data) KnxIpConfigDIB::KnxIpConfigDIB(uint8_t* data, bool isCurrent) : KnxIpDIB(data)
@ -92,4 +90,3 @@ void KnxIpConfigDIB::info2(uint8_t addr)
else else
_data[19] = addr; _data[19] = addr;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_config_request.h" #include "knx_ip_config_request.h"
KnxIpConfigRequest::KnxIpConfigRequest(uint8_t* data, uint16_t length) KnxIpConfigRequest::KnxIpConfigRequest(uint8_t* data, uint16_t length)
@ -16,4 +14,3 @@ KnxIpCH& KnxIpConfigRequest::connectionHeader()
{ {
return _ch; return _ch;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_connect_request.h" #include "knx_ip_connect_request.h"
KnxIpConnectRequest::KnxIpConnectRequest(uint8_t* data, uint16_t length) KnxIpConnectRequest::KnxIpConnectRequest(uint8_t* data, uint16_t length)
@ -20,4 +18,3 @@ KnxIpCRI& KnxIpConnectRequest::cri()
{ {
return _cri; return _cri;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_connect_response.h" #include "knx_ip_connect_response.h"
KnxIpConnectResponse::KnxIpConnectResponse(IpParameterObject& parameters, uint16_t address, uint16_t port, uint8_t channel, uint8_t type) 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; return _crd;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_crd.h" #include "knx_ip_crd.h"
KnxIpCRD::KnxIpCRD(uint8_t* data) : _data(data) KnxIpCRD::KnxIpCRD(uint8_t* data) : _data(data)
@ -40,4 +38,3 @@ void KnxIpCRD::address(uint16_t value)
_data[2] = value >> 8; _data[2] = value >> 8;
_data[3] = value & 0xFF; _data[3] = value & 0xFF;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_cri.h" #include "knx_ip_cri.h"
KnxIpCRI::KnxIpCRI(uint8_t* data) : _data(data) KnxIpCRI::KnxIpCRI(uint8_t* data) : _data(data)
@ -37,4 +35,3 @@ void KnxIpCRI::layer(uint8_t value)
{ {
_data[2] = value; _data[2] = value;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_description_request.h" #include "knx_ip_description_request.h"
KnxIpDescriptionRequest::KnxIpDescriptionRequest(uint8_t* data, uint16_t length) KnxIpDescriptionRequest::KnxIpDescriptionRequest(uint8_t* data, uint16_t length)
@ -12,4 +10,3 @@ IpHostProtocolAddressInformation& KnxIpDescriptionRequest::hpaiCtrl()
{ {
return _hpaiCtrl; return _hpaiCtrl;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_description_response.h" #include "knx_ip_description_response.h"
#define LEN_SERVICE_FAMILIES 2 #define LEN_SERVICE_FAMILIES 2
@ -70,4 +68,3 @@ KnxIpSupportedServiceDIB& KnxIpDescriptionResponse::supportedServices()
{ {
return _supportedServices; return _supportedServices;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_device_information_dib.h" #include "knx_ip_device_information_dib.h"
#include "../bits.h" #include "../bits.h"
@ -100,4 +98,3 @@ void KnxIpDeviceInformationDIB::friendlyName(const uint8_t* value)
{ {
pushByteArray(value, LEN_FRIENDLY_NAME, _data + 24); pushByteArray(value, LEN_FRIENDLY_NAME, _data + 24);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_dib.h" #include "knx_ip_dib.h"
KnxIpDIB::KnxIpDIB(uint8_t* data) : _data(data) KnxIpDIB::KnxIpDIB(uint8_t* data) : _data(data)
@ -27,4 +25,3 @@ void KnxIpDIB::code(DescriptionTypeCode value)
{ {
_data[1] = value; _data[1] = value;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_disconnect_request.h" #include "knx_ip_disconnect_request.h"
KnxIpDisconnectRequest::KnxIpDisconnectRequest(uint8_t* data, uint16_t length) KnxIpDisconnectRequest::KnxIpDisconnectRequest(uint8_t* data, uint16_t length)
@ -25,4 +23,3 @@ void KnxIpDisconnectRequest::channelId(uint8_t channelId)
{ {
_data[LEN_KNXIP_HEADER] = channelId; _data[LEN_KNXIP_HEADER] = channelId;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_disconnect_response.h" #include "knx_ip_disconnect_response.h"
KnxIpDisconnectResponse::KnxIpDisconnectResponse(uint8_t channel, uint8_t status) 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] = channel;
_data[LEN_KNXIP_HEADER + 1] = status; _data[LEN_KNXIP_HEADER + 1] = status;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_extended_device_information_dib.h" #include "knx_ip_extended_device_information_dib.h"
#include "../bits.h" #include "../bits.h"
@ -40,4 +38,3 @@ void KnxIpExtendedDeviceInformationDIB::deviceDescriptor(uint16_t value)
{ {
pushWord(value, _data + 6); pushWord(value, _data + 6);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_frame.h" #include "knx_ip_frame.h"
#include <cstring> #include <cstring>
@ -78,4 +76,3 @@ KnxIpFrame::KnxIpFrame(uint16_t length)
protocolVersion(KnxIp1_0); protocolVersion(KnxIp1_0);
totalLength(length); totalLength(length);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_knx_addresses_dib.h" #include "knx_ip_knx_addresses_dib.h"
KnxIpKnxAddressesDIB::KnxIpKnxAddressesDIB(uint8_t* data) : KnxIpDIB(data) KnxIpKnxAddressesDIB::KnxIpKnxAddressesDIB(uint8_t* data) : KnxIpDIB(data)
@ -25,4 +23,3 @@ void KnxIpKnxAddressesDIB::additional(uint16_t addr)
currentPos += 2; currentPos += 2;
length(currentPos - _data); length(currentPos - _data);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_routing_indication.h" #include "knx_ip_routing_indication.h"
#include <cstring> #include <cstring>
@ -20,4 +18,3 @@ KnxIpRoutingIndication::KnxIpRoutingIndication(CemiFrame frame)
serviceTypeIdentifier(RoutingIndication); serviceTypeIdentifier(RoutingIndication);
memcpy(_data + LEN_KNXIP_HEADER, frame.data(), frame.totalLenght()); memcpy(_data + LEN_KNXIP_HEADER, frame.data(), frame.totalLenght());
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_search_request.h" #include "knx_ip_search_request.h"
KnxIpSearchRequest::KnxIpSearchRequest(uint8_t* data, uint16_t length) KnxIpSearchRequest::KnxIpSearchRequest(uint8_t* data, uint16_t length)
@ -12,4 +10,3 @@ IpHostProtocolAddressInformation& KnxIpSearchRequest::hpai()
{ {
return _hpai; return _hpai;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_search_request_extended.h" #include "knx_ip_search_request_extended.h"
#include "../bits.h" #include "../bits.h"
#include "service_families.h" #include "service_families.h"
@ -66,4 +64,3 @@ bool KnxIpSearchRequestExtended::requestedDIB(uint8_t code)
return requestedDIBs[code]; return requestedDIBs[code];
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_search_response.h" #include "knx_ip_search_response.h"
#define LEN_SERVICE_FAMILIES 2 #define LEN_SERVICE_FAMILIES 2
@ -82,4 +80,3 @@ KnxIpSupportedServiceDIB& KnxIpSearchResponse::supportedServices()
{ {
return _supportedServices; return _supportedServices;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_search_response_extended.h" #include "knx_ip_search_response_extended.h"
#include "service_families.h" #include "service_families.h"
@ -226,4 +224,3 @@ uint8_t* KnxIpSearchResponseExtended::DIBs()
{ {
return _data + LEN_KNXIP_HEADER + LEN_IPHPAI; return _data + LEN_KNXIP_HEADER + LEN_IPHPAI;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_state_request.h" #include "knx_ip_state_request.h"
KnxIpStateRequest::KnxIpStateRequest(uint8_t* data, uint16_t length) KnxIpStateRequest::KnxIpStateRequest(uint8_t* data, uint16_t length)
@ -15,4 +13,3 @@ uint8_t KnxIpStateRequest::channelId()
{ {
return _data[LEN_KNXIP_HEADER]; return _data[LEN_KNXIP_HEADER];
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_state_response.h" #include "knx_ip_state_response.h"
#define LEN_SERVICE_FAMILIES 2 #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] = channelId;
_data[LEN_KNXIP_HEADER + 1] = errorCode; _data[LEN_KNXIP_HEADER + 1] = errorCode;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_supported_service_dib.h" #include "knx_ip_supported_service_dib.h"
KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB(uint8_t* data) : KnxIpDIB(data) KnxIpSupportedServiceDIB::KnxIpSupportedServiceDIB(uint8_t* data) : KnxIpDIB(data)
@ -42,4 +40,3 @@ void KnxIpSupportedServiceDIB::serviceVersion(ServiceFamily family, uint8_t ver
} }
} }
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_tunnel_connection.h" #include "knx_ip_tunnel_connection.h"
KnxIpTunnelConnection::KnxIpTunnelConnection() KnxIpTunnelConnection::KnxIpTunnelConnection()
@ -19,4 +17,3 @@ void KnxIpTunnelConnection::Reset()
IndividualAddress = 0; IndividualAddress = 0;
IsConfig = false; IsConfig = false;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_tunneling_ack.h" #include "knx_ip_tunneling_ack.h"
#include <cstring> #include <cstring>
@ -18,4 +16,3 @@ KnxIpCH& KnxIpTunnelingAck::connectionHeader()
{ {
return _ch; return _ch;
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_tunneling_info_dib.h" #include "knx_ip_tunneling_info_dib.h"
#include "service_families.h" #include "service_families.h"
@ -27,4 +25,3 @@ void KnxIpTunnelingInfoDIB::tunnelingSlot(uint16_t addr, uint16_t state)
currentPos += 4; currentPos += 4;
length(currentPos - _data); length(currentPos - _data);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_IP
#include "knx_ip_tunneling_request.h" #include "knx_ip_tunneling_request.h"
#include <cstring> #include <cstring>
@ -24,4 +22,3 @@ KnxIpCH& KnxIpTunnelingRequest::connectionHeader()
{ {
return _ch; return _ch;
} }
#endif

View File

@ -1,4 +1,3 @@
#if ((MASK_VERSION != 0x07B0) && (MASK_VERSION != 0x27B0) && (MASK_VERSION != 0x57B0)) || defined(ALL_MASKS)
#include "network_layer_coupler.h" #include "network_layer_coupler.h"
#include "data_link_layer.h" #include "data_link_layer.h"
#include "device_object.h" #include "device_object.h"
@ -655,4 +654,3 @@ bool NetworkLayerCoupler::isTunnelAddress(uint16_t destination)
return _netLayerEntities[kPrimaryIfIndex].dataLinkLayer().isTunnelAddress(destination); return _netLayerEntities[kPrimaryIfIndex].dataLinkLayer().isTunnelAddress(destination);
} }
#endif #endif
#endif

View File

@ -1,4 +1,3 @@
#if (MASK_VERSION == 0x07B0) || (MASK_VERSION == 0x27B0) || (MASK_VERSION == 0x57B0) || defined(ALL_MASKS)
#include "network_layer_device.h" #include "network_layer_device.h"
#include "device_object.h" #include "device_object.h"
#include "tpdu.h" #include "tpdu.h"
@ -149,4 +148,3 @@ void NetworkLayerDevice::systemBroadcastConfirm(AckType ack, FrameFormat format,
HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter; HopCountType hopType = npdu.hopCount() == 7 ? UnlimitedRouting : NetworkLayerParameter;
_transportLayer.dataSystemBroadcastConfirm(ack, hopType, npdu.tpdu(), priority, status); _transportLayer.dataSystemBroadcastConfirm(ack, hopType, npdu.tpdu(), priority, status);
} }
#endif

View File

@ -1,6 +1,3 @@
#include "../config.h"
#ifdef USE_RF
#if defined(DeviceFamily_CC13X0) #if defined(DeviceFamily_CC13X0)
#include "rf_physical_layer_cc1310.h" #include "rf_physical_layer_cc1310.h"
#else #else
@ -381,4 +378,3 @@ void RfDataLinkLayer::loadNextTxFrame(uint8_t** sendBuffer, uint16_t* sendBuffer
delete tx_frame; delete tx_frame;
} }
#endif

View File

@ -1,6 +1,3 @@
#include "../config.h"
#ifdef USE_RF
#include <cstring> #include <cstring>
#include "rf_medium_object.h" #include "rf_medium_object.h"
#include "../bits.h" #include "../bits.h"
@ -57,4 +54,3 @@ void RfMediumObject::rfDomainAddress(const uint8_t* value)
Property* prop = property(PID_RF_DOMAIN_ADDRESS); Property* prop = property(PID_RF_DOMAIN_ADDRESS);
prop->write(value); prop->write(value);
} }
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_RF
#ifndef DeviceFamily_CC13X0 #ifndef DeviceFamily_CC13X0
#include "rf_physical_layer_cc1101.h" #include "rf_physical_layer_cc1101.h"
@ -780,4 +778,3 @@ void RfPhysicalLayerCC1101::loop()
} }
#endif // DeviceFamily_CC13X0 #endif // DeviceFamily_CC13X0
#endif

View File

@ -1,5 +1,3 @@
#include "../config.h"
#ifdef USE_RF
#ifdef DeviceFamily_CC13X0 #ifdef DeviceFamily_CC13X0
@ -373,4 +371,3 @@ void RfPhysicalLayerCC1310::loop()
} }
#endif // DeviceFamily_CC13X0 #endif // DeviceFamily_CC13X0
#endif

View File

@ -1,5 +1,4 @@
#include "config.h" #include "config.h"
#if ((MASK_VERSION != 0x07B0) && (MASK_VERSION != 0x27B0) && (MASK_VERSION != 0x57B0)) || defined(ALL_MASKS)
#include <cstring> #include <cstring>
#include "router_object.h" #include "router_object.h"
@ -602,4 +601,3 @@ bool RouterObject::isGroupAddressInFilterTable(uint16_t groupAddress)
return false; return false;
} }
#endif

View File

@ -1,6 +1,3 @@
#include "config.h"
#ifdef USE_USB
#include "bits.h" #include "bits.h"
#include "usb_tunnel_interface.h" #include "usb_tunnel_interface.h"
#include "cemi_server.h" #include "cemi_server.h"
@ -561,5 +558,3 @@ uint16_t UsbTunnelInterface::getHidReportDescriptorLength()
{ {
return sizeof(descHidReport); return sizeof(descHidReport);
} }
#endif

View File

@ -1,7 +1,5 @@
#pragma once #pragma once
#include "config.h"
#ifdef USE_USB
#include <stdint.h> #include <stdint.h>
class CemiServer; class CemiServer;
@ -93,4 +91,3 @@ class UsbTunnelInterface
void handleBusAccessServerProtocol(ServiceIdType servId, const uint8_t* requestData, uint16_t packetLength); void handleBusAccessServerProtocol(ServiceIdType servId, const uint8_t* requestData, uint16_t packetLength);
void sendKnxHidReport(ProtocolIdType protId, ServiceIdType servId, uint8_t* data, uint16_t length); void sendKnxHidReport(ProtocolIdType protId, ServiceIdType servId, uint8_t* data, uint16_t length);
}; };
#endif