From 45479c7ba1c2208df1ed19236b290689dfd84418 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Tue, 11 Aug 2015 14:18:52 +0200
Subject: [PATCH] Do not use a power of two as test packet size as other values
give more interesting results.
---
test/w5100_peer.c | 10 +++++-----
test/w5100_tcp_main.c | 8 ++++----
test/w5100_udp_main.c | 20 ++++++++++----------
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/test/w5100_peer.c b/test/w5100_peer.c
index 907254b..ed456bd 100644
--- a/test/w5100_peer.c
+++ b/test/w5100_peer.c
@@ -99,14 +99,14 @@ void main(void)
{
unsigned i;
- len = 512;
+ len = 500;
for (i = 0; i < len; ++i)
{
buf[i] = i;
}
if (tcp == INVALID_SOCKET)
{
- printf("Send Len $%04X To %s", len, inet_ntoa(remote.sin_addr));
+ printf("Send Len %d To %s", len, inet_ntoa(remote.sin_addr));
if (sendto(udp, buf, len, 0, (SOCKADDR *)&remote, sizeof(remote)) == SOCKET_ERROR)
{
return;
@@ -114,7 +114,7 @@ void main(void)
}
else
{
- printf("Send Len $%04X", len);
+ printf("Send Len %d", len);
if (send(tcp, buf, len, 0) == SOCKET_ERROR)
{
return;
@@ -135,7 +135,7 @@ void main(void)
}
else if (len)
{
- printf("Recv Len $%04X From %s", len, inet_ntoa(remote.sin_addr));
+ printf("Recv Len %d From %s", len, inet_ntoa(remote.sin_addr));
dump(buf, len);
}
@@ -174,7 +174,7 @@ void main(void)
}
else if (len)
{
- printf("Recv Len $%04X", len);
+ printf("Recv Len %d", len);
dump(buf, len);
}
else
diff --git a/test/w5100_tcp_main.c b/test/w5100_tcp_main.c
index 30e92fd..06ecd16 100644
--- a/test/w5100_tcp_main.c
+++ b/test/w5100_tcp_main.c
@@ -21,7 +21,7 @@ struct
}
parms =
{
- {192, 168, 0, 2},
+ {192, 168, 0, 2}, // IP addr of machine running w5100_peer.c
{192, 168, 0, 123},
{255, 255, 255, 0},
{192, 168, 0, 1}
@@ -64,8 +64,8 @@ void main(void)
{
unsigned i;
- len = 512;
- printf("Send Len $%04X", len);
+ len = 500;
+ printf("Send Len %d", len);
while (!w5100_send_init(len))
{
printf("!");
@@ -88,7 +88,7 @@ void main(void)
{
unsigned i;
- printf("Recv Len $%04X", len);
+ printf("Recv Len %d", len);
for (i = 0; i < len; ++i)
{
if ((i % 24) == 0)
diff --git a/test/w5100_udp_main.c b/test/w5100_udp_main.c
index 014d730..f723840 100644
--- a/test/w5100_udp_main.c
+++ b/test/w5100_udp_main.c
@@ -20,7 +20,7 @@ struct
}
parms =
{
- {192, 168, 0, 2},
+ {192, 168, 0, 2}, // IP addr of machine running w5100_peer.c
{192, 168, 0, 123},
{255, 255, 255, 0},
{192, 168, 0, 1}
@@ -52,11 +52,11 @@ void main(void)
{
unsigned i;
- len = 512;
- printf("Send Len $%04X To %d.%d.%d.%d", len, parms.serverip[0],
- parms.serverip[1],
- parms.serverip[2],
- parms.serverip[3]);
+ len = 500;
+ printf("Send Len %d To %d.%d.%d.%d", len, parms.serverip[0],
+ parms.serverip[1],
+ parms.serverip[2],
+ parms.serverip[3]);
while (!w5100_send_init(len))
{
printf("!");
@@ -74,10 +74,10 @@ void main(void)
{
unsigned i;
- printf("Recv Len $%04X From %d.%d.%d.%d", len, parms.serverip[0],
- parms.serverip[1],
- parms.serverip[2],
- parms.serverip[3]);
+ printf("Recv Len %d From %d.%d.%d.%d", len, parms.serverip[0],
+ parms.serverip[1],
+ parms.serverip[2],
+ parms.serverip[3]);
for (i = 0; i < len; ++i)
{
if ((i % 24) == 0)