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 RTOSgeneric mbed Ethernet driverhigh performance NXP LPC1768 specific Ethernet driverMulti-threading support for mbed RTOSBerkeley sockets and integration with the New Socket APIFork of the apps running on top of the New Socket APIScheduling 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.
Diff: include/pico_constants.h
- Revision:
- 131:4758606c9316
- Parent:
- 128:ae39e6e81531
- Child:
- 133:5b075f5e141a
--- a/include/pico_constants.h Wed Dec 11 07:20:17 2013 +0000 +++ b/include/pico_constants.h Mon Dec 16 11:25:54 2013 +0100 @@ -1,8 +1,8 @@ /********************************************************************* -PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. -See LICENSE and COPYING for usage. + PicoTCP. Copyright (c) 2012 TASS Belgium NV. Some rights reserved. + See LICENSE and COPYING for usage. -*********************************************************************/ + *********************************************************************/ #ifndef _INCLUDE_PICO_CONST #define _INCLUDE_PICO_CONST /* Included from pico_config.h */ @@ -26,48 +26,48 @@ static inline uint16_t short_from(void *_p) { - unsigned char *p = (unsigned char *)_p; - uint16_t r, p0, p1; - p0 = p[0]; - p1 = p[1]; - r = (p0 << 8) + p1; - return r; + unsigned char *p = (unsigned char *)_p; + uint16_t r, p0, p1; + p0 = p[0]; + p1 = p[1]; + r = (p0 << 8) + p1; + return r; } static inline uint32_t long_from(void *_p) { - unsigned char *p = (unsigned char *)_p; - uint32_t r, p0, p1, p2, p3; - p0 = p[0]; - p1 = p[1]; - p2 = p[2]; - p3 = p[3]; - r = (p0 << 24) + (p1 << 16) + (p2 << 8) + p3; - return r; + unsigned char *p = (unsigned char *)_p; + uint32_t r, p0, p1, p2, p3; + p0 = p[0]; + p1 = p[1]; + p2 = p[2]; + p3 = p[3]; + r = (p0 << 24) + (p1 << 16) + (p2 << 8) + p3; + return r; } #else static inline uint16_t short_from(void *_p) { - unsigned char *p = (unsigned char *)_p; - uint16_t r, _p0, _p1; - _p0 = p[0]; - _p1 = p[1]; - r = (uint16_t)((_p1 << 8u) + _p0); - return r; + unsigned char *p = (unsigned char *)_p; + uint16_t r, _p0, _p1; + _p0 = p[0]; + _p1 = p[1]; + r = (uint16_t)((_p1 << 8u) + _p0); + return r; } static inline uint32_t long_from(void *_p) { - unsigned char *p = (unsigned char *)_p; - uint32_t r, _p0, _p1, _p2, _p3; - _p0 = p[0]; - _p1 = p[1]; - _p2 = p[2]; - _p3 = p[3]; - r = (_p3 << 24) + (_p2 << 16) + (_p1 << 8) + _p0; - return r; + unsigned char *p = (unsigned char *)_p; + uint32_t r, _p0, _p1, _p2, _p3; + _p0 = p[0]; + _p1 = p[1]; + _p2 = p[2]; + _p3 = p[3]; + r = (_p3 << 24) + (_p2 << 16) + (_p1 << 8) + _p0; + return r; } @@ -81,34 +81,34 @@ static inline uint16_t short_be(uint16_t le) { - return (uint16_t)(((le & 0xFFu) << 8) | ((le >> 8u) & 0xFFu)); + return (uint16_t)(((le & 0xFFu) << 8) | ((le >> 8u) & 0xFFu)); } static inline uint32_t long_be(uint32_t le) { - uint8_t *b = (uint8_t *)≤ - uint32_t be = 0; - uint32_t b0, b1, b2; - b0 = b[0]; - b1 = b[1]; - b2 = b[2]; - be = b[3] + (b2 << 8) + (b1 << 16) + (b0 << 24); - return be; + uint8_t *b = (uint8_t *)≤ + uint32_t be = 0; + uint32_t b0, b1, b2; + b0 = b[0]; + b1 = b[1]; + b2 = b[2]; + be = b[3] + (b2 << 8) + (b1 << 16) + (b0 << 24); + return be; } static inline uint64_t long_long_be(uint64_t le) { - uint8_t *b = (uint8_t *)≤ - uint64_t be = 0; - uint64_t b0, b1, b2, b3, b4, b5, b6; - b0 = b[0]; - b1 = b[1]; - b2 = b[2]; - b3 = b[3]; - b4 = b[4]; - b5 = b[5]; - b6 = b[6]; - be = b[7] + (b6 << 8) + (b5 << 16) + (b4 << 24) + (b3 << 32) + (b2 << 40) + (b1 << 48) + (b0 << 56); - return be; + uint8_t *b = (uint8_t *)≤ + uint64_t be = 0; + uint64_t b0, b1, b2, b3, b4, b5, b6; + b0 = b[0]; + b1 = b[1]; + b2 = b[2]; + b3 = b[3]; + b4 = b[4]; + b5 = b[5]; + b6 = b[6]; + be = b[7] + (b6 << 8) + (b5 << 16) + (b4 << 24) + (b3 << 32) + (b2 << 40) + (b1 << 48) + (b0 << 56); + return be; } #endif @@ -124,14 +124,14 @@ static inline uint32_t pico_hash(const char *name) { - uint32_t hash = 5381; - uint8_t c; - while ((c = (uint8_t)*name++)) - hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ - return hash; + uint32_t hash = 5381; + uint8_t c; + while ((c = (uint8_t)*name++)) + hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ + return hash; } /* Debug */ -//#define PICO_SUPPORT_DEBUG_MEMORY -//#define PICO_SUPPORT_DEBUG_TOOLS +/* #define PICO_SUPPORT_DEBUG_MEMORY */ +/* #define PICO_SUPPORT_DEBUG_TOOLS */ #endif