mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
examples/gnrc_networking_mac: resync udp.c with gnrc_networking
`examples/gnrc_networking_mac/udp.c` is a duplicate of the file in `gnrc_networking`. However, while the latter moved along in code style and static analysis, the first was left a bit at the wayside. This change resyncs the two files.
This commit is contained in:
parent
cee1b7296d
commit
8c54589c6a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Freie Universität Berlin
|
||||
* Copyright (C) 2015-17 Freie Universität Berlin
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
@ -14,6 +14,7 @@
|
||||
* @brief Demonstrating the sending and receiving of UDP data
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
* @author Martine Lenders <m.lenders@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
@ -57,7 +58,7 @@ static void send(char *addr_str, char *port_str, char *data, unsigned int num,
|
||||
return;
|
||||
}
|
||||
/* parse port */
|
||||
port = (uint16_t)atoi(port_str);
|
||||
port = atoi(port_str);
|
||||
if (port == 0) {
|
||||
puts("Error: unable to parse destination port");
|
||||
return;
|
||||
@ -120,7 +121,7 @@ static void start_server(char *port_str)
|
||||
return;
|
||||
}
|
||||
/* parse port */
|
||||
port = (uint16_t)atoi(port_str);
|
||||
port = atoi(port_str);
|
||||
if (port == 0) {
|
||||
puts("Error: invalid port specified");
|
||||
return;
|
||||
@ -161,10 +162,10 @@ int udp_cmd(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
if (argc > 5) {
|
||||
num = (uint32_t)atoi(argv[5]);
|
||||
num = atoi(argv[5]);
|
||||
}
|
||||
if (argc > 6) {
|
||||
delay = (uint32_t)atoi(argv[6]);
|
||||
delay = atoi(argv[6]);
|
||||
}
|
||||
send(argv[2], argv[3], argv[4], num, delay);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user