1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

shell/sc_gnrc_udp: don't add delay after last packet

This commit is contained in:
Benjamin Valentin 2022-02-14 17:53:21 +01:00
parent e22698f9cd
commit d5dee30368

View File

@ -60,7 +60,7 @@ static void _send(const char *addr_str, const char *port_str,
return;
}
for (unsigned int i = 0; i < num; i++) {
while (num--) {
gnrc_pktsnip_t *payload, *udp, *ip;
unsigned payload_size;
/* allocate payload */
@ -105,11 +105,13 @@ static void _send(const char *addr_str, const char *port_str,
* => use temporary variable for output */
printf("Success: sent %u byte(s) to [%s]:%u\n", payload_size, addr_str,
port);
if (num) {
#if IS_USED(MODULE_ZTIMER_MSEC)
ztimer_sleep(ZTIMER_MSEC, delay);
ztimer_sleep(ZTIMER_MSEC, delay);
#else
xtimer_usleep(delay);
xtimer_usleep(delay);
#endif
}
}
}