diff --git a/examples/ipv6/rpl-udp/Makefile b/examples/ipv6/rpl-udp/Makefile index 77d33d7f4..270ccff11 100644 --- a/examples/ipv6/rpl-udp/Makefile +++ b/examples/ipv6/rpl-udp/Makefile @@ -6,4 +6,11 @@ WITH_UIP6=1 UIP_CONF_IPV6=1 CFLAGS+= -DUIP_CONF_IPV6_RPL +ifdef SERVER_REPLY +CFLAGS+=-DSERVER_REPLY=$(SERVER_REPLY) +endif +ifdef PERIOD +CFLAGS+=-DPERIOD=$(PERIOD) +endif + include $(CONTIKI)/Makefile.include diff --git a/examples/ipv6/rpl-udp/udp-client.c b/examples/ipv6/rpl-udp/udp-client.c index e5b27f832..2490399bb 100644 --- a/examples/ipv6/rpl-udp/udp-client.c +++ b/examples/ipv6/rpl-udp/udp-client.c @@ -46,8 +46,12 @@ #define DEBUG DEBUG_PRINT #include "net/uip-debug.h" +#ifndef PERIOD +#define PERIOD 60 +#endif + #define START_INTERVAL (15 * CLOCK_SECOND) -#define SEND_INTERVAL (60 * CLOCK_SECOND) +#define SEND_INTERVAL (PERIOD * CLOCK_SECOND) #define SEND_TIME (random_rand() % (SEND_INTERVAL)) #define MAX_PAYLOAD_LEN 30 diff --git a/examples/ipv6/rpl-udp/udp-server.c b/examples/ipv6/rpl-udp/udp-server.c index 2ce2a046d..cbafb0da3 100644 --- a/examples/ipv6/rpl-udp/udp-server.c +++ b/examples/ipv6/rpl-udp/udp-server.c @@ -68,6 +68,7 @@ tcpip_handler(void) UIP_IP_BUF->srcipaddr.u8[sizeof(UIP_IP_BUF->srcipaddr.u8) - 1]); PRINTF("\n"); #if SERVER_REPLY + PRINTF("DATA sending reply\n"); uip_ipaddr_copy(&server_conn->ripaddr, &UIP_IP_BUF->srcipaddr); uip_udp_packet_send(server_conn, "Reply", sizeof("Reply")); uip_create_unspecified(&server_conn->ripaddr);