+++ /dev/null
-[{000214A0-0000-0000-C000-000000000046}]\r
-Prop3=19,2\r
-[InternetShortcut]\r
-URL=http://www.freertos.org/labs\r
-IDList=\r
--- /dev/null
+[{000214A0-0000-0000-C000-000000000046}]\r
+Prop3=19,2\r
+[InternetShortcut]\r
+URL=http://www.freertos.org/labs\r
+IDList=\r
results in the wired network being used, while setting\r
configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being\r
used. */\r
-#define configNETWORK_INTERFACE_TO_USE 4L\r
+#define configNETWORK_INTERFACE_TO_USE 2L\r
\r
/* The address of an echo server that will be used by the two demo echo client\r
tasks.\r
case FREERTOS_SO_SET_SEMAPHORE:\r
{\r
pxSocket->pxUserSemaphore = *( ( SemaphoreHandle_t * ) pvOptionValue );\r
+ xReturn = 0;\r
}\r
- xReturn = 0;\r
break;\r
#endif /* ipconfigSOCKET_HAS_USER_SEMAPHORE */\r
+\r
+ #if( ipconfigSOCKET_HAS_USER_WAKE_CALLBACK != 0 )\r
+ case FREERTOS_SO_WAKEUP_CALLBACK:\r
+ {\r
+ /* Each socket can have a callback function that is executed\r
+ when there is an event the socket's owner might want to\r
+ process. */\r
+ pxSocket->pxUserWakeCallback = ( SocketWakeupCallback_t ) pvOptionValue;\r
+ xReturn = 0;\r
+ }\r
+ break;\r
+ #endif /* ipconfigSOCKET_HAS_USER_WAKE_CALLBACK */\r
+\r
case FREERTOS_SO_SNDBUF: /* Set the size of the send buffer, in units of MSS (TCP only) */\r
case FREERTOS_SO_RCVBUF: /* Set the size of the receive buffer, in units of MSS (TCP only) */\r
{\r
}\r
#endif /* ipconfigSOCKET_HAS_USER_SEMAPHORE */\r
\r
+ #if( ipconfigSOCKET_HAS_USER_WAKE_CALLBACK == 1 )\r
+ {\r
+ if( pxSocket->pxUserWakeCallback != NULL )\r
+ {\r
+ pxSocket->pxUserWakeCallback( pxSocket );\r
+ }\r
+ }\r
+ #endif /* ipconfigSOCKET_HAS_USER_SEMAPHORE */\r
+\r
#if( ipconfigSUPPORT_SELECT_FUNCTION == 1 )\r
{\r
if( pxSocket->pxSocketSet != NULL )\r
\r
#if( ipconfigUSE_TCP == 1 )\r
\r
- static StreamBuffer_t *prvTCPCreateStream ( FreeRTOS_Socket_t *pxSocket, BaseType_t xIsInputStream )\r
+ static StreamBuffer_t *prvTCPCreateStream( FreeRTOS_Socket_t *pxSocket, BaseType_t xIsInputStream )\r
{\r
StreamBuffer_t *pxBuffer;\r
size_t uxLength;\r
if( pxSocket->u.xTCP.uxLittleSpace == 0ul )\r
{\r
pxSocket->u.xTCP.uxLittleSpace = ( 1ul * pxSocket->u.xTCP.uxRxStreamSize ) / 5u; /*_RB_ Why divide by 5? Can this be changed to a #define? */\r
- if( (pxSocket->u.xTCP.uxLittleSpace < pxSocket->u.xTCP.usCurMSS ) && ( pxSocket->u.xTCP.uxRxStreamSize >= 2 * pxSocket->u.xTCP.usCurMSS ) )\r
+ if( ( pxSocket->u.xTCP.uxLittleSpace < pxSocket->u.xTCP.usCurMSS ) && ( pxSocket->u.xTCP.uxRxStreamSize >= 2u * pxSocket->u.xTCP.usCurMSS ) )\r
{\r
pxSocket->u.xTCP.uxLittleSpace = pxSocket->u.xTCP.usCurMSS;\r
}\r
-Changes since the 160112 release\r
-\r
-FTP : now has ipconfigFTP_HAS_USER_PROPERTIES_HOOK\r
-Each user can be assigned a different root directory and different access rights.\r
-Read-only access for FTP is now possible.\r
-\r
-Adapted to comply a bit more to MISRA rules.\r
-The introduction of unsigned true/false, e.g. pdTRUE_UNSIGNED.\r
-\r
-'ipBUFFER_PADDING' now configurable (expert option).\r
-\r
-Added ipconfigFTP_HAS_USER_PROPERTIES_HOOK.\r
-ipconfigHAS_TX_CRC_OFFLOADING\r
-Improve support for read only file systems in the FTP server.\r
-\r
-Depending on priorities: FreeRTOS_accept() could fail if the priority of the application task is higher than the priority of the IP-task. Now with a higher priority FreeRTOS_accept() will still work correctly.\r
-\r
-Depending on the tick rate: A TCP socket could freeze (stop working) when the FreeRTOS tick rate was lower than 1,000 Hz. Now also tested with 100 Hz.\r
-\r
-When "ipconfigZERO_COPY_TX_DRIVER = 0", sometime xNetworkInterfaceOutput() was called to send out a small TCP ACK. The network buffer would refer to space on the TCP socket ("lastPacket"), which was not 8-byte aligned. Repaired: from now on the buffer will have a proper 8-byte alignment.\r
-\r
-"#if __cplusplus" is been replaced with the more proper test "#ifdef __cplusplus".\r
-\r
-\r
-\r
-These are the recent commits:\r
-565 Initial check-in of +TCP/multi\r
-566 LPC18xx : updated and re-tested the TCP and FAT drivers\r
-569 +TCP : protocols: Added an installable application hook: "CheckDrivesHook"\r
-570 +TCP : will now work properly when configTICK_RATE_HZ < 1000\r
-571 +TCP : will now work properly when configTICK_RATE_HZ < 1000\r
-572 +TCP : FreeRTOS_recvfrom now recognises "FREERTOS_MSG_PEEK"\r
-573 +FAT : Zynq : writing may fail if it goes too fast. Introduced pauses but not yet satisfied\r
-\r
+Changes since V2.0.0 release\r
+\r
+ + Added FREERTOS_SO_WAKEUP_CALLBACK option so a callback can be executed\r
+ when data arrives.\r
+ + Improve print output when using WinPCap to assist in selecting the\r
+ correct network interface.\r
+\r
+Changes between 160908 and 160919 releases:\r
+\r
+ + Add a NULL check before attempting to close the DHCP socket. [Prior to\r
+ 160823 the IP task closed the DHCP socket by calling a public API function\r
+ - which checked for the socket being NULL. This was changed to call a\r
+ local private function, which did not have a NULL check, in place of the\r
+ public API function.]\r
+ + Various [internal only] naming changes to better comply with the FreeRTOS\r
+ naming conventions.\r
+ + Improvements to the Zynq network driver. DMA transmission buffers now use\r
+ a counting semaphore. When all TX-buffers are in-use, the IP-task will\r
+ block momentarily until a TX-buffer becomes available.\r
+ + Experimental implementation of the TCP window scaling protocol. The\r
+ scaling option will always be offered, at least with a factor 1. If the\r
+ TCP sliding window size becomes more than 64KB, the factor will increase\r
+ automatically.\r
+ + ipconfigETHERNET_MINIMUM_PACKET_BYTES is now applied for every protocol:\r
+ TCP, UDP, and ARP.\r
+ + Updated the Zynq project to use BufferAllocation_1.c rather than\r
+ BufferAllocation_2.c - which is a requirement with its current\r
+ configuration (due to the alignment requirements on the combined cache and\r
+ DMA configuration).\r
+\r
+Changes between 160823 and 160908 releases:\r
+\r
+ + Use ipconfigZERO_COPY_TX_DRIVER as the xReleaseAfterSend() parameter where\r
+ prvTCPReturnPacket() is called in prvSendData() to prevent unnecessary\r
+ copying of data.\r
+ + Remove the use of the uxGetRxEventCount variable, which was used to give\r
+ priority to incoming messages, but could result in the IP task starving\r
+ application tasks of processing time.\r
+\r
+Changes between 160112 and 160823 releases\r
+\r
+ NOTE: The 160908 release is a maintenance release for the 160112 single\r
+ interface labs release - not a release of the current development branch.\r
+\r
+ + Various minor stability enhancements, including the ability to work with\r
+ configTICK_RATE_HZ set to less than 1KHz, closing DHCP sockets directly\r
+ rather than via FreeRTOS_closesocket(), and better handling of unknown\r
+ TCP packets before an IP address has been assigned.\r
+ + ipBUFFER_PADDING is now configurable through the ipconfigBUFFER_PADDING\r
+ constant to improve network buffer alignment handling capabilities (expert\r
+ users/driver writers only).\r
+ + Multiple improvements to the FTP server, including to how read only and\r
+ zero length files are handled.\r
+ + ipconfigFTP_HAS_USER_PROPERTIES_HOOK (to allow each user to have a\r
+ different root directory and access rights) and\r
+ ipconfigHTTP_HAS_HANDLE_REQUEST_HOOK (to handle AJAX style data)\r
+ introduced, although these are not yet fully tested and the constant names\r
+ are likely to change.\r
+ + Introduce ipconfigHAS_TX_CRC_OFFLOADING.\r
+ + ipconfigUSE_DHCP_HOOK is now called ipconfigUSE_DHCP_HOOK, and the name\r
+ of the callback function has also changed. See the web documentation for\r
+ details.\r
+ + ipconfigTCP_RX_BUF_LEN is now ipconfigTCP_RX_BUFFER_LENGTH, and\r
+ ipconfigTCP_TX_BUF_LEN is now ipconfigTCP_TX_BUFFER_LENGTH, which is\r
+ actually how they have always been documented.\r
+ + Added example TFTP server capable of receiving (not sending) files.\r
+ Intended for bootloader type functionality.\r
+ + Various variable name changes for consistency (mainly ensuring UDP, TCP,\r
+ DNS, etc. always use the same case letters, and type prefixes are correct).\r
+ + Various minor edits to improve types used by internal variables.\r
+ + Simplified mapping of standard library functions to their Visual Studio\r
+ equivalents.\r
+ + Improve robustness of network drivers.\r
+ + Introduce pxResizeNetworkBufferWithDescriptor().\r
+ + Removed obsolete FreeRTOSIPConfig.h constants from\r
+ FreeRTOSIPConfigDefaults.h.\r
+ + Added additional asserts() - predominantly to catch incorrect structure\r
+ packing.\r
\r
Changes between 160112 and 160111 releases\r
\r
#define ipconfigSOCKET_HAS_USER_SEMAPHORE 0\r
#endif\r
\r
+#ifndef ipconfigSOCKET_HAS_USER_WAKE_CALLBACK\r
+ #define ipconfigSOCKET_HAS_USER_WAKE_CALLBACK 0\r
+#endif\r
+\r
#ifndef ipconfigSUPPORT_SELECT_FUNCTION\r
#define ipconfigSUPPORT_SELECT_FUNCTION 0\r
#endif\r
#define FREERTOS_SO_RCVBUF ( 5 ) /* Set the size of the receive buffer (TCP only) */\r
\r
#if ipconfigUSE_CALLBACKS == 1\r
-#define FREERTOS_SO_TCP_CONN_HANDLER ( 6 ) /* Install a callback for (dis) connection events. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-#define FREERTOS_SO_TCP_RECV_HANDLER ( 7 ) /* Install a callback for receiving TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-#define FREERTOS_SO_TCP_SENT_HANDLER ( 8 ) /* Install a callback for sending TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-#define FREERTOS_SO_UDP_RECV_HANDLER ( 9 ) /* Install a callback for receiving UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
-#define FREERTOS_SO_UDP_SENT_HANDLER ( 10 ) /* Install a callback for sending UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
+ #define FREERTOS_SO_TCP_CONN_HANDLER ( 6 ) /* Install a callback for (dis) connection events. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
+ #define FREERTOS_SO_TCP_RECV_HANDLER ( 7 ) /* Install a callback for receiving TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
+ #define FREERTOS_SO_TCP_SENT_HANDLER ( 8 ) /* Install a callback for sending TCP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
+ #define FREERTOS_SO_UDP_RECV_HANDLER ( 9 ) /* Install a callback for receiving UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
+ #define FREERTOS_SO_UDP_SENT_HANDLER ( 10 ) /* Install a callback for sending UDP data. Supply pointer to 'F_TCP_UDP_Handler_t' (see below) */\r
#endif /* ipconfigUSE_CALLBACKS */\r
\r
#define FREERTOS_SO_REUSE_LISTEN_SOCKET ( 11 ) /* When a listening socket gets connected, do not create a new one but re-use it */\r
#define FREERTOS_SO_WIN_PROPERTIES ( 13 ) /* Set all buffer and window properties in one call, parameter is pointer to WinProperties_t */\r
#define FREERTOS_SO_SET_FULL_SIZE ( 14 ) /* Refuse to send packets smaller than MSS */\r
\r
-#define FREERTOS_SO_STOP_RX ( 15 ) /* Tempoarily hold up reception, used by streaming client */\r
+#define FREERTOS_SO_STOP_RX ( 15 ) /* Temporarily hold up reception, used by streaming client */\r
\r
#if( ipconfigUDP_MAX_RX_PACKETS > 0 )\r
#define FREERTOS_SO_UDP_MAX_RX_PACKETS ( 16 ) /* This option helps to limit the maximum number of packets a UDP socket will buffer */\r
pcap_if_t * pxAllNetworkInterfaces = NULL, *xInterface;\r
int32_t lInterfaceNumber = 1;\r
char cBuffer[ 512 ];\r
+static BaseType_t xInvalidInterfaceDetected = pdFALSE;\r
\r
- if( pcap_findalldevs_ex( PCAP_SRC_IF_STRING, NULL, &pxAllNetworkInterfaces, cErrorBuffer ) == -1 )\r
+ if( xInvalidInterfaceDetected == pdFALSE )\r
{\r
- printf( "Could not obtain a list of network interfaces\n%s\n", cErrorBuffer );\r
- pxAllNetworkInterfaces = NULL;\r
- }\r
+ if( pcap_findalldevs_ex( PCAP_SRC_IF_STRING, NULL, &pxAllNetworkInterfaces, cErrorBuffer ) == -1 )\r
+ {\r
+ printf( "Could not obtain a list of network interfaces\n%s\n", cErrorBuffer );\r
+ pxAllNetworkInterfaces = NULL;\r
+ }\r
+ else\r
+ {\r
+ printf( "\r\n\r\nThe following network interfaces are available:\r\n\r\n" );\r
+ }\r
\r
- if( pxAllNetworkInterfaces != NULL )\r
- {\r
- /* Print out the list of network interfaces. The first in the list\r
- is interface '1', not interface '0'. */\r
- for( xInterface = pxAllNetworkInterfaces; xInterface != NULL; xInterface = xInterface->next )\r
+ if( pxAllNetworkInterfaces != NULL )\r
{\r
- /* The descriptions of the devices can be full of spaces, clean them\r
- a little. printf() can only be used here because the network is not\r
- up yet - so no other network tasks will be running. */\r
- printf( "%d. %s\n", lInterfaceNumber, prvRemoveSpaces( cBuffer, sizeof( cBuffer ), xInterface->name ) );\r
- printf( " (%s)\n", prvRemoveSpaces(cBuffer, sizeof( cBuffer ), xInterface->description ? xInterface->description : "No description" ) );\r
- printf( "\n" );\r
- lInterfaceNumber++;\r
+ /* Print out the list of network interfaces. The first in the list\r
+ is interface '1', not interface '0'. */\r
+ for( xInterface = pxAllNetworkInterfaces; xInterface != NULL; xInterface = xInterface->next )\r
+ {\r
+ /* The descriptions of the devices can be full of spaces, clean them\r
+ a little. printf() can only be used here because the network is not\r
+ up yet - so no other network tasks will be running. */\r
+ printf( "Interface %d - %s\n", lInterfaceNumber, prvRemoveSpaces( cBuffer, sizeof( cBuffer ), xInterface->name ) );\r
+ printf( " (%s)\n", prvRemoveSpaces(cBuffer, sizeof( cBuffer ), xInterface->description ? xInterface->description : "No description" ) );\r
+ printf( "\n" );\r
+ lInterfaceNumber++;\r
+ }\r
}\r
- }\r
\r
- if( lInterfaceNumber == 1 )\r
- {\r
- /* The interface number was never incremented, so the above for() loop\r
- did not execute meaning no interfaces were found. */\r
- printf( " \nNo network interfaces were found.\n" );\r
- pxAllNetworkInterfaces = NULL;\r
- }\r
+ if( lInterfaceNumber == 1 )\r
+ {\r
+ /* The interface number was never incremented, so the above for() loop\r
+ did not execute meaning no interfaces were found. */\r
+ printf( " \nNo network interfaces were found.\n" );\r
+ pxAllNetworkInterfaces = NULL;\r
+ }\r
\r
- printf( "The interface that will be opened is set by\n" );\r
- printf( "\"configNETWORK_INTERFACE_TO_USE\" which should be defined in FreeRTOSConfig.h\n" );\r
- printf( "Attempting to open interface number %d.\n", xConfigNextworkInterfaceToUse );\r
+ printf( "\r\nThe interface that will be opened is set by " );\r
+ printf( "\"configNETWORK_INTERFACE_TO_USE\", which\r\nshould be defined in FreeRTOSConfig.h\r\n" );\r
\r
- if( ( xConfigNextworkInterfaceToUse < 1L ) || ( xConfigNextworkInterfaceToUse > lInterfaceNumber ) )\r
- {\r
- printf( "configNETWORK_INTERFACE_TO_USE is not in the valid range.\n" );\r
+ if( ( xConfigNextworkInterfaceToUse < 1L ) || ( xConfigNextworkInterfaceToUse >= lInterfaceNumber ) )\r
+ {\r
+ printf( "\r\nERROR: configNETWORK_INTERFACE_TO_USE is set to %d, which is an invalid value.\r\n", xConfigNextworkInterfaceToUse );\r
+ printf( "Please set configNETWORK_INTERFACE_TO_USE to one of the interface numbers listed above,\r\n" );\r
+ printf( "then re-compile and re-start the application. Only Ethernet (as opposed to WiFi)\r\n" );\r
+ printf( "interfaces are supported.\r\n\r\nHALTING\r\n\r\n\r\n" );\r
+ xInvalidInterfaceDetected = pdTRUE;\r
\r
- if( pxAllNetworkInterfaces != NULL )\r
+ if( pxAllNetworkInterfaces != NULL )\r
+ {\r
+ /* Free the device list, as no devices are going to be opened. */\r
+ pcap_freealldevs( pxAllNetworkInterfaces );\r
+ pxAllNetworkInterfaces = NULL;\r
+ }\r
+ }\r
+ else\r
{\r
- /* Free the device list, as no devices are going to be opened. */\r
- pcap_freealldevs( pxAllNetworkInterfaces );\r
- pxAllNetworkInterfaces = NULL;\r
+ printf( "Attempting to open interface number %d.\n", xConfigNextworkInterfaceToUse );\r
}\r
}\r
\r
#ifndef STREAM_BUFFER_H\r
#define STREAM_BUFFER_H\r
\r
+#if defined( __cplusplus )\r
+extern "C" {\r
+#endif\r
+\r
/**\r
* Type by which stream buffers are referenced. For example, a call to\r
* xStreamBufferCreate() returns an StreamBufferHandle_t variable that can\r
#endif\r
\r
#if defined( __cplusplus )\r
-extern "C" {\r
+}\r
#endif\r
\r
#endif /* !defined( STREAM_BUFFER_H ) */\r
* MACROS AND DEFINITIONS\r
*----------------------------------------------------------*/\r
\r
-#define tskKERNEL_VERSION_NUMBER "V9.0.0"\r
-#define tskKERNEL_VERSION_MAJOR 9\r
+#define tskKERNEL_VERSION_NUMBER "V10.0.0"\r
+#define tskKERNEL_VERSION_MAJOR 10\r
#define tskKERNEL_VERSION_MINOR 0\r
#define tskKERNEL_VERSION_BUILD 0\r
\r
/*\r
* Macros used by vListTask to indicate which state a task is in.\r
*/\r
+#define tskRUNNING_CHAR ( 'X' )\r
#define tskBLOCKED_CHAR ( 'B' )\r
#define tskREADY_CHAR ( 'R' )\r
#define tskDELETED_CHAR ( 'D' )\r
{\r
switch( pxTaskStatusArray[ x ].eCurrentState )\r
{\r
+ case eRunning: cStatus = tskRUNNING_CHAR;\r
+ break;\r
+\r
case eReady: cStatus = tskREADY_CHAR;\r
break;\r
\r