From 23e7f242f68e678af2e352ae69a0132988fd53f4 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Thu, 29 Mar 2012 12:57:56 +0100 Subject: [PATCH] Changes to the ping part of the cc2530 and Sensinode udp-ipv6 examples - Remove obsolete variable declarations - prettier printf output - cc2530 example turns on printfs --- examples/cc2530dk/udp-ipv6/ping6.c | 7 +++---- examples/sensinode/udp-ipv6/ping6.c | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/cc2530dk/udp-ipv6/ping6.c b/examples/cc2530dk/udp-ipv6/ping6.c index ca4213c61..bab5db911 100644 --- a/examples/cc2530dk/udp-ipv6/ping6.c +++ b/examples/cc2530dk/udp-ipv6/ping6.c @@ -36,7 +36,7 @@ #include "dev/button-sensor.h" #include "debug.h" -#define DEBUG DEBUG_NONE +#define DEBUG DEBUG_PRINT #include "net/uip-debug.h" #define PING6_NB 5 @@ -47,7 +47,6 @@ static struct etimer ping6_periodic_timer; static uint8_t count = 0; -static uint16_t addr[8]; static uip_ipaddr_t dest_addr; PROCESS(ping6_process, "PING6 process"); @@ -81,9 +80,9 @@ ping6handler() UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum(); - PRINTF("Echo Request to"); + PRINTF("Echo Request to "); PRINT6ADDR(&UIP_IP_BUF->destipaddr); - PRINTF("from"); + PRINTF(" from "); PRINT6ADDR(&UIP_IP_BUF->srcipaddr); PRINTF("\n"); UIP_STAT(++uip_stat.icmp.sent); diff --git a/examples/sensinode/udp-ipv6/ping6.c b/examples/sensinode/udp-ipv6/ping6.c index 6c8d4450c..48ec952f9 100644 --- a/examples/sensinode/udp-ipv6/ping6.c +++ b/examples/sensinode/udp-ipv6/ping6.c @@ -49,7 +49,6 @@ static struct etimer ping6_periodic_timer; static uint8_t count = 0; -static uint16_t addr[8]; static uip_ipaddr_t dest_addr; PROCESS(ping6_process, "PING6 process"); @@ -83,9 +82,9 @@ ping6handler() UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum(); - PRINTF("Echo Request to"); + PRINTF("Echo Request to "); PRINT6ADDR(&UIP_IP_BUF->destipaddr); - PRINTF("from"); + PRINTF(" from "); PRINT6ADDR(&UIP_IP_BUF->srcipaddr); PRINTF("\n"); UIP_STAT(++uip_stat.icmp.sent);