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.

Committer:
tass
Date:
Thu Jan 28 15:12:00 2016 +0100
Revision:
155:a70f34550c34
Parent:
151:dbbb7e41f583
Adding TCP flag for FIN.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tass 6:55b47464d5bc 1 #include <mbed.h>
tass 6:55b47464d5bc 2 #include <rtos.h>
tass 6:55b47464d5bc 3
tass 6:55b47464d5bc 4 extern "C" {
tass 89:49ca05d9a19e 5 #include "pico_config.h"
tass 128:ae39e6e81531 6
tass picotcp@tass.be 142:35da43068894 7 pico_time local_time;
tass 128:ae39e6e81531 8 uint32_t last_os_time;
tass 128:ae39e6e81531 9
tass 6:55b47464d5bc 10 void *pico_mutex_init(void)
tass 6:55b47464d5bc 11 {
tass 6:55b47464d5bc 12 return new Mutex();
tass 6:55b47464d5bc 13 }
tass 6:55b47464d5bc 14
tass 6:55b47464d5bc 15 void pico_mutex_lock(void *_m)
tass 6:55b47464d5bc 16 {
tass 6:55b47464d5bc 17 Mutex *m = (Mutex *)_m;
tass 6:55b47464d5bc 18 m->lock();
tass 6:55b47464d5bc 19 }
tass 6:55b47464d5bc 20
tass 6:55b47464d5bc 21 void pico_mutex_unlock(void *_m)
tass 6:55b47464d5bc 22 {
tass 6:55b47464d5bc 23 Mutex *m = (Mutex *)_m;
tass 6:55b47464d5bc 24 m->unlock();
tass 6:55b47464d5bc 25 }
tass picotcp@tass.be 151:dbbb7e41f583 26
tass picotcp@tass.be 151:dbbb7e41f583 27 void pico_mutex_deinit(void *_m)
tass picotcp@tass.be 151:dbbb7e41f583 28 {
tass picotcp@tass.be 151:dbbb7e41f583 29 Mutex *m = (Mutex *)_m;
tass picotcp@tass.be 151:dbbb7e41f583 30 delete m;
tass picotcp@tass.be 151:dbbb7e41f583 31 }
tass 89:49ca05d9a19e 32
tass 89:49ca05d9a19e 33 #ifdef PICO_MEASURE_STACK
tass 113:f2f9b678d3fe 34 int freeStack = STACK_TOTAL_WORDS;
tass 89:49ca05d9a19e 35 void stack_fill_pattern(void * ptr)
tass 89:49ca05d9a19e 36 {
tass picotcp@tass.be 144:f41646b5531e 37 int * movingPtr = (int *)ptr;
tass picotcp@tass.be 144:f41646b5531e 38 int * finalPtr = movingPtr - STACK_TOTAL_WORDS;
tass 108:1377967f703e 39 while(movingPtr >= finalPtr)
tass 89:49ca05d9a19e 40 {
tass 89:49ca05d9a19e 41 *movingPtr = STACK_PATTERN;
tass 89:49ca05d9a19e 42 movingPtr--;
tass 89:49ca05d9a19e 43 }
tass 6:55b47464d5bc 44 }
tass 89:49ca05d9a19e 45
tass 89:49ca05d9a19e 46 void stack_count_free_words(void *ptr)
tass 89:49ca05d9a19e 47 {
tass picotcp@tass.be 144:f41646b5531e 48 int * movingPtr = (int *)ptr;
tass picotcp@tass.be 144:f41646b5531e 49 int * finalPtr = movingPtr - STACK_TOTAL_WORDS;
tass 114:36bdc244be23 50 int tmpFreeStack = 0;
tass 89:49ca05d9a19e 51
tass 89:49ca05d9a19e 52 while(finalPtr != movingPtr)
tass 89:49ca05d9a19e 53 {
tass 89:49ca05d9a19e 54 if(*finalPtr != STACK_PATTERN)
tass 89:49ca05d9a19e 55 break;
tass 114:36bdc244be23 56 tmpFreeStack++;
tass 89:49ca05d9a19e 57 finalPtr++;
tass 89:49ca05d9a19e 58 }
tass 114:36bdc244be23 59 freeStack = tmpFreeStack;
tass 89:49ca05d9a19e 60 }
tass 89:49ca05d9a19e 61
tass 89:49ca05d9a19e 62 int stack_get_free_words(void)
tass 89:49ca05d9a19e 63 {
tass 89:49ca05d9a19e 64 return freeStack;
tass 89:49ca05d9a19e 65 }
tass 89:49ca05d9a19e 66
tass 89:49ca05d9a19e 67 #endif
tass 89:49ca05d9a19e 68
tass 89:49ca05d9a19e 69 }