print node ids correctly

This commit is contained in:
Nicolas Tsiftes 2011-06-28 17:44:35 +02:00
parent b1fea35e47
commit ccfb30707a
2 changed files with 3 additions and 2 deletions

View file

@ -78,7 +78,7 @@ send_packet(void *ptr)
seq_id++;
PRINTF("DATA send to %d 'Hello %d'\n",
client_conn->ripaddr.u8[15], seq_id);
server_ipaddr.u8[sizeof(server_ipaddr.u8) - 1], seq_id);
sprintf(buf, "Hello %d from the client", seq_id);
uip_udp_packet_sendto(client_conn, buf, strlen(buf),
&server_ipaddr, UIP_HTONS(UDP_SERVER_PORT));

View file

@ -64,7 +64,8 @@ tcpip_handler(void)
appdata = (char *)uip_appdata;
appdata[uip_datalen()] = 0;
PRINTF("DATA recv '%s' from ", appdata);
PRINTF("%d", UIP_IP_BUF->srcipaddr.u8[15]);
PRINTF("%d",
UIP_IP_BUF->srcipaddr.u8[sizeof(UIP_IP_BUF->srcipaddr.u8) - 1]);
PRINTF("\n");
#if SERVER_REPLY
uip_ipaddr_copy(&server_conn->ripaddr, &UIP_IP_BUF->srcipaddr);