mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-29 14:38:32 -04:00
FreeRTOS+TCP: Added ipconfigSOCKET_HAS_USER_WAKE_CALLBACK configuration option so the user can specify a callback to execute when data arrives.
FreeRTOS+TCP: Improve print output when using WinPCap to assist in selecting the correct network interface. FreeRTOS kernel: Fix extern "C" { in stream_buffer.h. FreeRTOS kernel: Correct tskKERNEL_VERSION_NUMBER and tskKERNEL_VERSION_MAJOR constants for V10. Ensure the currently executing task is printed correctly in vTaskList().
This commit is contained in:
parent
cfc268814a
commit
0d903cf2d6
10 changed files with 168 additions and 75 deletions
|
@ -1438,10 +1438,23 @@ FreeRTOS_Socket_t *pxSocket;
|
|||
case FREERTOS_SO_SET_SEMAPHORE:
|
||||
{
|
||||
pxSocket->pxUserSemaphore = *( ( SemaphoreHandle_t * ) pvOptionValue );
|
||||
xReturn = 0;
|
||||
}
|
||||
xReturn = 0;
|
||||
break;
|
||||
#endif /* ipconfigSOCKET_HAS_USER_SEMAPHORE */
|
||||
|
||||
#if( ipconfigSOCKET_HAS_USER_WAKE_CALLBACK != 0 )
|
||||
case FREERTOS_SO_WAKEUP_CALLBACK:
|
||||
{
|
||||
/* Each socket can have a callback function that is executed
|
||||
when there is an event the socket's owner might want to
|
||||
process. */
|
||||
pxSocket->pxUserWakeCallback = ( SocketWakeupCallback_t ) pvOptionValue;
|
||||
xReturn = 0;
|
||||
}
|
||||
break;
|
||||
#endif /* ipconfigSOCKET_HAS_USER_WAKE_CALLBACK */
|
||||
|
||||
case FREERTOS_SO_SNDBUF: /* Set the size of the send buffer, in units of MSS (TCP only) */
|
||||
case FREERTOS_SO_RCVBUF: /* Set the size of the receive buffer, in units of MSS (TCP only) */
|
||||
{
|
||||
|
@ -1839,6 +1852,15 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t *pxSocket )
|
|||
}
|
||||
#endif /* ipconfigSOCKET_HAS_USER_SEMAPHORE */
|
||||
|
||||
#if( ipconfigSOCKET_HAS_USER_WAKE_CALLBACK == 1 )
|
||||
{
|
||||
if( pxSocket->pxUserWakeCallback != NULL )
|
||||
{
|
||||
pxSocket->pxUserWakeCallback( pxSocket );
|
||||
}
|
||||
}
|
||||
#endif /* ipconfigSOCKET_HAS_USER_SEMAPHORE */
|
||||
|
||||
#if( ipconfigSUPPORT_SELECT_FUNCTION == 1 )
|
||||
{
|
||||
if( pxSocket->pxSocketSet != NULL )
|
||||
|
@ -2854,7 +2876,7 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t *pxSocket )
|
|||
|
||||
#if( ipconfigUSE_TCP == 1 )
|
||||
|
||||
static StreamBuffer_t *prvTCPCreateStream ( FreeRTOS_Socket_t *pxSocket, BaseType_t xIsInputStream )
|
||||
static StreamBuffer_t *prvTCPCreateStream( FreeRTOS_Socket_t *pxSocket, BaseType_t xIsInputStream )
|
||||
{
|
||||
StreamBuffer_t *pxBuffer;
|
||||
size_t uxLength;
|
||||
|
@ -2880,7 +2902,7 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t *pxSocket )
|
|||
if( pxSocket->u.xTCP.uxLittleSpace == 0ul )
|
||||
{
|
||||
pxSocket->u.xTCP.uxLittleSpace = ( 1ul * pxSocket->u.xTCP.uxRxStreamSize ) / 5u; /*_RB_ Why divide by 5? Can this be changed to a #define? */
|
||||
if( (pxSocket->u.xTCP.uxLittleSpace < pxSocket->u.xTCP.usCurMSS ) && ( pxSocket->u.xTCP.uxRxStreamSize >= 2 * pxSocket->u.xTCP.usCurMSS ) )
|
||||
if( ( pxSocket->u.xTCP.uxLittleSpace < pxSocket->u.xTCP.usCurMSS ) && ( pxSocket->u.xTCP.uxRxStreamSize >= 2u * pxSocket->u.xTCP.usCurMSS ) )
|
||||
{
|
||||
pxSocket->u.xTCP.uxLittleSpace = pxSocket->u.xTCP.usCurMSS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue