Print out sender IPv6 address when receiving data. When sending data, include a counter in the message.
This commit is contained in:
parent
6220e231a2
commit
722b6e0b96
2 changed files with 6 additions and 2 deletions
|
@ -118,12 +118,14 @@ PROCESS_THREAD(unicast_sender_process, ev, data)
|
|||
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&send_timer));
|
||||
addr = servreg_hack_lookup(SERVICE_ID);
|
||||
if(addr != NULL) {
|
||||
static unsigned int message_number;
|
||||
char buf[20];
|
||||
|
||||
printf("Sending unicast to ");
|
||||
uip_debug_ipaddr_print(addr);
|
||||
printf("\n");
|
||||
sprintf(buf, "From %d", node_id);
|
||||
sprintf(buf, "Message %d", message_number);
|
||||
message_number++;
|
||||
simple_udp_sendto(&unicast_connection, buf, strlen(buf) + 1, addr);
|
||||
} else {
|
||||
printf("Service %d not found\n", SERVICE_ID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue