From: Romain Forlot Date: Tue, 26 Nov 2019 15:19:08 +0000 (+0100) Subject: Add function get_data_vector with index X-Git-Tag: 8.0.4~24 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=dfc20c88b083f06aad5048f2facf4cbde1ea3de4;p=apps%2Fagl-service-can-low-level.git Add function get_data_vector with index This commit adds the function get_data_vector to get another vector between the index indicates. Bug-AGL : SPEC-2779 Bug-AGL: SPEC-2976 Change-Id: I704d78467839ee7f9a2fec397e9b0db8da43d79d Signed-off-by: Arthur Guyader Signed-off-by: Romain Forlot --- diff --git a/low-can-binding/can/message/message.cpp b/low-can-binding/can/message/message.cpp index 5384c021..b0a33f78 100644 --- a/low-can-binding/can/message/message.cpp +++ b/low-can-binding/can/message/message.cpp @@ -76,6 +76,40 @@ const uint8_t* message_t::get_data() const return data_.data(); } + +/// +/// @brief Retrieve data_ member value. +/// +/// @return pointer to the first element +/// of class member data_ +/// +const std::vector message_t::get_data_vector(int start,int end) const +{ + std::vector ret; + if(start >= 0) + { + if(end get_data_vector() const; + const std::vector get_data_vector(int start,int end) const; uint32_t get_length() const; uint64_t get_timestamp() const;