From 15de266fce952f11f0e4daf9d4a293d0351c9a13 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 26 Apr 2017 15:48:07 +0200 Subject: Don't use FD frame with BCM socket. Seems not working... Change-Id: I4f1d5cd489011675cf55914647b57c7332dec1b9 Signed-off-by: Romain Forlot --- CAN-binder/low-can-binding/can/can-bus-dev.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'CAN-binder') diff --git a/CAN-binder/low-can-binding/can/can-bus-dev.cpp b/CAN-binder/low-can-binding/can/can-bus-dev.cpp index 955e617d..1837f491 100644 --- a/CAN-binder/low-can-binding/can/can-bus-dev.cpp +++ b/CAN-binder/low-can-binding/can/can-bus-dev.cpp @@ -126,15 +126,27 @@ int can_bus_dev_t::create_rx_filter(const can_signal_t& s) { uint32_t can_id = s.get_message().get_id(); - struct utils::canfd_bcm_msg bcm_msg; + struct utils::basic_bcm_msg bcm_msg; + struct can_frame cfd; + memset(&cfd, 0, sizeof(cfd)); + memset(&bcm_msg.msg_head, 0, sizeof(bcm_msg.msg_head)); uint8_t bit_size = s.get_bit_size(); float val = (float)exp2(bit_size)-1; bcm_msg.msg_head.opcode = RX_SETUP; bcm_msg.msg_head.can_id = can_id; + bcm_msg.msg_head.flags = 0; bcm_msg.msg_head.nframes = 1; - bitfield_encode_float(val, s.get_bit_position(), bit_size, s.get_factor(), s.get_offset(), bcm_msg.frames[0].data, CANFD_MAX_DLEN); + bitfield_encode_float(val, + s.get_bit_position(), + bit_size, + s.get_factor(), + s.get_offset(), + cfd.data, + CAN_MAX_DLEN); + + bcm_msg.frames.push_back(cfd); if(can_socket_ << bcm_msg) return 0; -- cgit 1.2.3-korg