Free (GPLv2) TCP/IP stack developed by TASS Belgium

Dependents:   lpc1768-picotcp-demo ZeroMQ_PicoTCP_Publisher_demo TCPSocket_HelloWorld_PicoTCP Pico_TCP_UDP_Test ... more

PicoTCP. Copyright (c) 2013 TASS Belgium NV.

Released under the GNU General Public License, version 2.

Different licensing models may exist, at the sole discretion of the Copyright holders.

Official homepage: http://www.picotcp.com

Bug tracker: https://github.com/tass-belgium/picotcp/issues

Development steps:

  • initial integration with mbed RTOS
  • generic mbed Ethernet driver
  • high performance NXP LPC1768 specific Ethernet driver
  • Multi-threading support for mbed RTOS
  • Berkeley sockets and integration with the New Socket API
  • Fork of the apps running on top of the New Socket API
  • Scheduling optimizations
  • Debugging/benchmarking/testing

Demo application (measuring TCP sender performance):

Import programlpc1768-picotcp-demo

A PicoTCP demo app testing the ethernet throughput on the lpc1768 mbed board.

Files at this revision

API Documentation at this revision

Comitter:
tass
Date:
Thu Dec 05 12:38:26 2013 +0000
Parent:
128:ae39e6e81531
Child:
130:0cee8bdac6d0
Commit message:
Integrated SLAACv4 to repo.; If DHCP fails, the ip address is auto configured.

Changed in this revision

EthernetInterface/EthernetInterface.cpp Show annotated file Show diff for this revision Revisions of this file
include/pico_config.h Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface/EthernetInterface.cpp	Thu Dec 05 08:31:32 2013 +0000
+++ b/EthernetInterface/EthernetInterface.cpp	Thu Dec 05 12:38:26 2013 +0000
@@ -41,6 +41,7 @@
 #include "pico_dhcp_client.h"
 #include "pico_dns_client.h"
 #include "pico_ipfilter.h"
+#include "pico_slaacv4.h"
 //#define eth_dbg mbed_dbg
 #define eth_dbg(...)
 
@@ -62,6 +63,23 @@
 static bool use_dhcp = false;
 static bool is_initialized = false;
 
+void slaacv4_cb(struct pico_ip4 *ip, uint8_t code)
+{
+    struct pico_ip4 nm_ip4;
+    if(code == 0 && ip)
+    {
+        dhcp_retval = 0;
+        
+        pico_ipv4_to_string(ip_addr, ip->addr);
+        nm_ip4.addr = long_be(0xFFFF0000);
+        pico_ipv4_to_string(nm_addr,nm_ip4.addr);
+    }
+    else
+        dhcp_retval = -1;
+        
+    dhcp_mx.unlock();
+}
+
 static void dhcp_cb(void *cli, int code)
 {
     void *id = NULL;
@@ -99,9 +117,7 @@
     return;
     
 fail:
-    eth_dbg("DHCP request failed!\n");
-    dhcp_retval = -1;
-    dhcp_mx.unlock();
+    pico_slaacv4_claimip(lpc_eth,slaacv4_cb);
     
 reset:
      eth_dbg("DHCP reset!\n");
--- a/include/pico_config.h	Thu Dec 05 08:31:32 2013 +0000
+++ b/include/pico_config.h	Thu Dec 05 12:38:26 2013 +0000
@@ -30,5 +30,7 @@
 #define PICO_SUPPORT_NAT
 #define PICO_SUPPORT_TCP
 #define PICO_SUPPORT_UDP
+#define PICO_SUPPORT_SLAACV4
+
 # include "arch/pico_mbed.h"
 #endif