CANFD_SUPPORT optional
diff --git a/README.md b/README.md
index e626961..b651dc1 100644
--- a/README.md
+++ b/README.md
@@ -76,18 +76,13 @@
-CAN RAW:
CAN and CANFD has been implemented and tested.
- Depending on the availability of the C-code #define "CAN_FD_FRAME"
- in /usr/include/linux/can/bcm.h, CAN-FD support is enabled at compile time.
- If you kernel does not have CANFD support comment out the #define "CAN_FD_FRAME
+ Depending on the availability of the C-code #define CANFD_SUPPORT
+ in src/SocketCAN_PT.cc CAN-FD support is enabled at compile time.
+ If you kernel does not have CANFD support comment out the #define CANFD_SUPPORT
the file "src/SocketCAN_PT.cc"
- The RAW setsockopt has path coverage. However no test coverage that insures
- the setsockopt functionality provided by the kernel is working correctly.
- For this purpose in the future might be added additional test cases.
-CAN BCM:
TX_SETUP, TX_DELETE have been tested, TX_READ is known to fail test cases.
- Some tests have indicated, that that SocketCAN BCM does not support concurrently
- active BCM channels.
The BCM has test coverage for TX_SETUP and TX_DELETE.
Return values other than the error code by the BCM are not yet supported.
diff --git a/src/SocketCAN_PT.cc b/src/SocketCAN_PT.cc
index 752db17..40cfaf8 100644
--- a/src/SocketCAN_PT.cc
+++ b/src/SocketCAN_PT.cc
@@ -69,23 +69,27 @@
#define CAN_MTU (sizeof(struct can_frame))
#endif //CAN_MTU
+// comment out the following define, if your kernel does not have CANFD support
+#define CANFD_SUPPORT
+#ifdef CANFD_SUPPORT
+
+// make sure CANFD_MTU is defined, as not defined in some older kernel versions.
#ifndef CANFD_MTU
#define CANFD_MTU (sizeof(struct canfd_frame))
#endif //CANFD_MTU
-// workaround, as canfd not defined in some older kernel versions
+// make sure CAN_FD_FRAME is defined, as not defined in some older kernel versions
// and thus canfd frames can not be used for data transfer between
-// kernel module and userspace.
-#ifdef CANFD_MTU
-#define CANFD_FRAME_STRUCT_DEFINED true
-#define RAW_CANFD_SUPPORT true
-#endif //CANFD_MTU
+// kernel module and userspace
+#ifndef CAN_FD_FRAME
+#define CAN_FD_FRAME 0x0800
+#endif //CAN_FD_FRAME
-// has to be defined in later kernel versions in bcm.h as #define CAN_FD_FRAME 0x0800
-#ifdef CAN_FD_FRAME
-#define BCM_CANFD_SUPPORT true
-#endif
+#define CANFD_FRAME_STRUCT_DEFINED
+#define RAW_CANFD_SUPPORT
+#define BCM_CANFD_SUPPORT
+#endif //CANFD_SUPPORT
namespace SocketCAN__PortType {
SocketCAN__PT_PROVIDER::SocketCAN__PT_PROVIDER(const char *par_port_name) :