Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse Titan
titan.TestPorts.SocketCANasp
Commits
28e757ff
Commit
28e757ff
authored
Feb 23, 2017
by
Elemer Lelik
Browse files
CANFD_SUPPORT optional
parent
508048a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
28e757ff
...
...
@@ -76,18 +76,13 @@ Notes:
-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.
...
...
src/SocketCAN_PT.cc
View file @
28e757ff
...
...
@@ -69,23 +69,27 @@ struct canfd_frame;
#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
)
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment