diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-26 15:48:07 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-04-27 01:03:34 +0200 |
commit | 15de266fce952f11f0e4daf9d4a293d0351c9a13 (patch) | |
tree | e52debac6c5ec926069bfb4f900039c23114c183 /CAN-binder/low-can-binding/can/can-bus-dev.cpp | |
parent | 55a206228d575484e97a231c95a9944eb27a2601 (diff) |
Don't use FD frame with BCM socket. Seems not working...
Change-Id: I4f1d5cd489011675cf55914647b57c7332dec1b9
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'CAN-binder/low-can-binding/can/can-bus-dev.cpp')
-rw-r--r-- | CAN-binder/low-can-binding/can/can-bus-dev.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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<struct can_frame> 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; |