Bluetooth: Samples: Fix peripheral_iso print data

The sample would consequently try to print invalid data
the offset into the data was incorrect calculated to
always be at the end of the data, instead of at the
end of the data minus an offset.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2021-05-20 11:45:42 +02:00 committed by Carles Cufí
commit bbf63d364e

View file

@ -78,7 +78,7 @@ static void iso_print_data(uint8_t *data, size_t data_len)
str_len += strlen(dots);
}
str_len += bin2hex(data + max_octets + (data_len - max_octets),
str_len += bin2hex(data + (data_len - MIN(max_octets, data_len - max_octets)),
MIN(max_octets, data_len - max_octets),
data_str + str_len,
sizeof(data_str) - str_len);