`ret` is the amount sent from the current buffer. `sent` contains the total amount that was transferred in the while loop. Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>