diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-26 16:19:17 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-28 16:11:47 +0100 |
commit | b37ea4acd86941e587b6eefe1dca262e3bf21f12 (patch) | |
tree | 05798417da28f88d1bfeafa66dcd23a386d4497f /low-can-binding/binding/low-can-subscription.cpp | |
parent | 5174772b69e56b671fb149e8acdc4f2a35e354d9 (diff) |
Add function remove last bcm frame
This commit creates the function remove_last_bcm_frame.
This function removes the last bcm frame of the subscription.
Bug-AGL : SPEC-2779
Bug-AGL: SPEC-2976
Change-Id: I5bb6f07a8d677c4aa882549fc1950f00a0b1da04
Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'low-can-binding/binding/low-can-subscription.cpp')
-rw-r--r-- | low-can-binding/binding/low-can-subscription.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/low-can-binding/binding/low-can-subscription.cpp b/low-can-binding/binding/low-can-subscription.cpp index a1187edd..bec3ad63 100644 --- a/low-can-binding/binding/low-can-subscription.cpp +++ b/low-can-binding/binding/low-can-subscription.cpp @@ -353,6 +353,17 @@ void low_can_subscription_t::add_one_bcm_frame(struct canfd_frame& cfd, struct b bcm_msg.msg_head.nframes++; } +/// @brief Take an existing bcm_msg struct and add a can_frame. +/// Currently only 1 uniq can_frame can be added, it's not possible to build +/// a multiplexed message with several can_frame. +void low_can_subscription_t::remove_last_bcm_frame(struct bcm_msg& bcm_msg) +{ + struct canfd_frame cf; + memset(&cf,0,sizeof(cf)); + bcm_msg.fd_frames[bcm_msg.msg_head.nframes] = cf; + bcm_msg.msg_head.nframes--; +} + #ifdef USE_FEATURE_J1939 int low_can_subscription_t::create_rx_filter_j1939(low_can_subscription_t &subscription, std::shared_ptr<signal_t> sig) { |