summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhduffddybz <[email protected]>2014-08-18 00:41:03 -0800
committerhduffddybz <[email protected]>2014-08-18 00:41:03 -0800
commita8804d350319c71269c752fa927d5e4c7ce3bd8b (patch)
tree519705cfd6346d03fe023ad62d3b37511a55bec8 /examples
parenta8fadf15b1828569e7684049d983cc6cb7fda2c9 (diff)
correct netconn API usage
Diffstat (limited to 'examples')
-rw-r--r--examples/test/net_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/test/net_test.c b/examples/test/net_test.c
index e4961622c7..b9a5717b16 100644
--- a/examples/test/net_test.c
+++ b/examples/test/net_test.c
@@ -23,7 +23,7 @@ void udpecho_entry(void *parameter)
while(1)
{
/* received data to buffer */
- buf = netconn_recv(conn);
+ netconn_recv(conn, &buf);
addr = netbuf_fromaddr(buf);
port = netbuf_fromport(buf);
@@ -32,7 +32,7 @@ void udpecho_entry(void *parameter)
netconn_connect(conn, addr, port);
/* reset address, and send to client */
- buf->addr = RT_NULL;
+ buf->addr = *IP_ADDR_ANY;
netconn_send(conn, buf);
/* release buffer */
@@ -122,15 +122,15 @@ void tcpecho_entry(void *parameter)
while(1)
{
/* Grab new connection. */
- newconn = netconn_accept(conn);
+ err = netconn_accept(conn, &newconn);
/* Process the new connection. */
- if(newconn != NULL)
+ if(err == ERR_OK)
{
struct netbuf *buf;
void *data;
u16_t len;
- while((buf = netconn_recv(newconn)) != NULL)
+ while((err = netconn_recv(newconn, buf)) == ERR_OK)
{
do
{