knx-linux: use default MEDIUM_TYPE IP

This commit is contained in:
nanosonde 2019-10-28 18:26:24 +01:00
parent eb87ec1fe9
commit ddea3eab99
2 changed files with 15 additions and 5 deletions

View File

@ -78,4 +78,4 @@ include_directories(../src)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -Wno-switch -g -O0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -Wno-switch -g -O0")
set_property(TARGET knx-linux PROPERTY CXX_STANDARD 11)
add_definitions(-DMEDIUM_TYPE=0)
add_definitions(-DMEDIUM_TYPE=5)

View File

@ -1,14 +1,24 @@
#include "knx_facade.h"
//#include "knx/bau57B0.h"
#if MEDIUM_TYPE == 5
#include "knx/bau57B0.h"
#elif MEDIUM_TYPE == 2
#include "knx/bau27B0.h"
#else
#error Only MEDIUM_TYPE IP and RF supported
#endif
#include "knx/group_object_table_object.h"
#include "knx/bits.h"
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
//KnxFacade<LinuxPlatform, Bau57B0> knx;
#if MEDIUM_TYPE == 5
KnxFacade<LinuxPlatform, Bau57B0> knx;
#elif MEDIUM_TYPE == 2
KnxFacade<LinuxPlatform, Bau27B0> knx;
#else
#error Only MEDIUM_TYPE IP and RF supported
#endif
long lastsend = 0;
@ -96,6 +106,6 @@ int main(int argc, char **argv)
knx.loop();
if(knx.configured())
appLoop();
delayMicroseconds(1000);
delayMicroseconds(100);
}
}
}