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: modules/pico_http_util.c
- Revision:
- 70:cd218dd180e5
- Parent:
- 68:0847e35d08a6
- Child:
- 131:4758606c9316
--- a/modules/pico_http_util.c Wed Sep 25 12:20:39 2013 +0000 +++ b/modules/pico_http_util.c Thu Sep 26 07:05:22 2013 +0000 @@ -27,7 +27,7 @@ // transform to from number to string [ in backwards ] while(port) { - ptr[size] = ((port & 0xF) < 10) ? ((port & 0xF) + '0') : ((port & 0xF) - 10 + 'a'); + ptr[size] = (char)(((port & 0xF) < 10) ? ((port & 0xF) + '0') : ((port & 0xF) - 10 + 'a')); port = port>>4u; //divide by 16 size++; } @@ -43,15 +43,15 @@ return size; } -int pico_itoa(uint16_t port, char * ptr) +uint16_t pico_itoa(uint16_t port, char * ptr) { - int size = 0; - int index; + uint16_t size = 0; + uint16_t index; // transform to from number to string [ in backwards ] while(port) { - ptr[size] = port%10 + '0'; + ptr[size] = (char)(port%10 + '0'); port = port/10; size++; } @@ -68,7 +68,7 @@ } -int pico_processURI(const char * uri, struct pico_http_uri * urikey) +int8_t pico_processURI(const char * uri, struct pico_http_uri * urikey) { uint16_t lastIndex = 0, index; @@ -111,14 +111,14 @@ else { // extract host - urikey->host = (char *)pico_zalloc(index-lastIndex+1); + urikey->host = (char *)pico_zalloc((uint32_t)(index-lastIndex+1)); if(!urikey->host) { // no memory goto error; } - memcpy(urikey->host,uri+lastIndex,index-lastIndex); + memcpy(urikey->host,uri+lastIndex,(size_t)(index-lastIndex)); } if(!uri[index]) @@ -140,7 +140,7 @@ while(uri[index] && uri[index]!='/') { // should check if every component is a digit - urikey->port = urikey->port*10 + (uri[index] - '0'); + urikey->port = (uint16_t)(urikey->port*10 + (uri[index] - '0')); index++; } } @@ -155,7 +155,7 @@ { lastIndex = index; while(uri[index] && uri[index]!='?' && uri[index]!='&' && uri[index]!='#') index++; - urikey->resource = (char *)pico_zalloc(index-lastIndex+1); + urikey->resource = (char *)pico_zalloc((size_t)(index-lastIndex+1)); if(!urikey->resource) { @@ -164,7 +164,7 @@ goto error; } - memcpy(urikey->resource,uri+lastIndex,index-lastIndex); + memcpy(urikey->resource,uri+lastIndex,(size_t)(index-lastIndex)); } return HTTP_RETURN_OK;