aboutsummaryrefslogtreecommitdiffstats
path: root/low-can-binding/binding
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-11-26 16:19:14 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-11-28 16:11:47 +0100
commit5174772b69e56b671fb149e8acdc4f2a35e354d9 (patch)
tree31b40a59ace7a25de7d3358ed5502ab16fc9182e /low-can-binding/binding
parentaeeb786722b5cdeabff5568b40f7075dc23140b9 (diff)
Add many frames in a subscription in the function tx_send.
This commit convert the message to a vector of canfd_frame. If there are several canfd frames then we add all of them to the subscription. Bug-AGL : SPEC-2779 Bug-AGL: SPEC-2976 Change-Id: I876aaf5ab7fed2fedb79367f77b987ba4745cdfc 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')
-rw-r--r--low-can-binding/binding/low-can-subscription.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/low-can-binding/binding/low-can-subscription.cpp b/low-can-binding/binding/low-can-subscription.cpp
index 736e034a..a1187edd 100644
--- a/low-can-binding/binding/low-can-subscription.cpp
+++ b/low-can-binding/binding/low-can-subscription.cpp
@@ -490,9 +490,12 @@ int low_can_subscription_t::tx_send(low_can_subscription_t &subscription, messag
{
can_message_t *cm = static_cast<can_message_t*>(message);
- struct bcm_msg bcm_msg = subscription.make_bcm_head(TX_SEND, cm->get_id(),cm->get_flags());
- canfd_frame cfd = cm->convert_to_canfd_frame();
- subscription.add_one_bcm_frame(cfd, bcm_msg);
+ struct bcm_msg bcm_msg = subscription.make_bcm_head(TX_SEND, cm->get_id(),cm->get_flags() | TX_CP_CAN_ID); // TX_CP_CAN_ID -> copy in cfd the id of bcm
+ std::vector<canfd_frame> cfd_vect = cm->convert_to_canfd_frame_vector();
+ for(auto cfd: cfd_vect)
+ {
+ subscription.add_one_bcm_frame(cfd, bcm_msg);
+ }
if(subscription.open_socket(subscription, bus_name,socket_type::BCM) < 0)
{