+}
+
+void can_message_t::set_data(const __u8* new_data)
+{
+ int i;
+
+ /* maxdlen_ is now set at CAN_MAX_DLEN or CANFD_MAX_DLEN, respectively 8 and 64 bytes*/
+ for(i=0;i<maxdlen_;i++)
+ {
+ data_.push_back(new_data[i]);
+ }
+}
+
+void can_message_t::convert_from_canfd_frame(const std::pair<struct canfd_frame&, size_t>args)
+{
+ // May be it's overkill to assign member of the pair... May be it will change...
+ struct canfd_frame frame = args.first;
+ size_t nbytes = args.second;
+ set_max_data_length(nbytes);
+ set_length(frame.len);
+ set_id_and_format(frame.can_id);
+
+ /* Overwrite lenght_ if RTR flags is detected.
+ * standard CAN frames may have RTR enabled. There are no ERR frames with RTR */
+ if (frame.can_id & CAN_RTR_FLAG)