113 const auto &hex_digits = uppercase_hex ? detail::hex_digits_upper : detail::hex_digits_lower;
120 detail::format_unsigned<detail::radix::hex>(out, f.id, uppercase_hex, is_ext ? 8 : 3);
123 uint8_t fd_flags = 0;
130 RELOCO_BEGIN_UNSAFE_BUFFER_USAGE;
131 out.put(hex_digits[fd_flags]);
132 RELOCO_END_UNSAFE_BUFFER_USAGE;
136 detail::format_unsigned<detail::radix::decimal>(out, f.payload.size(),
false, 0);
142 for (uint8_t b : f.payload) {
143 RELOCO_BEGIN_UNSAFE_BUFFER_USAGE;
144 out.put(hex_digits[(b >> 4) & 0x0F]);
145 out.put(hex_digits[b & 0x0F]);
146 RELOCO_END_UNSAFE_BUFFER_USAGE;
154 out.write(
"CAN-FD [0x");
156 out.write(
"CAN [0x");
159 detail::format_unsigned<detail::radix::hex>(out, f.id, uppercase_hex, is_ext ? 8 : 3);
172 out.write(
" RTR (DLC=");
173 detail::format_unsigned<detail::radix::decimal>(out, f.payload.size(),
false, 0);
179 detail::format_unsigned<detail::radix::decimal>(out, f.payload.size(),
false, 0);
181 if (!f.payload.empty()) {
182 out.write(
" DATA: ");
183 for (
size_t i = 0; i < f.payload.size(); ++i) {
186 const uint8_t b = f.payload[i];
187 out.put(hex_digits[(b >> 4) & 0x0F]);
188 out.put(hex_digits[b & 0x0F]);