Remove deprecated macro (ipconfigRAND32) references (#781)

* Remove ipconfigRAND32 referances from demos

* Fix license header
pull/783/head
Aniruddha Kanhere 3 years ago committed by GitHub
parent 4629138a42
commit 07c7ba7aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -231,6 +231,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -245,7 +246,12 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ulRandomNumbers[ 0 ], ulRandomNumbers[ 1 ], ulRandomNumbers[ 2 ], ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -313,8 +319,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -230,6 +230,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -244,7 +245,12 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ulRandomNumbers[ 0 ], ulRandomNumbers[ 1 ], ulRandomNumbers[ 2 ], ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -312,8 +318,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -227,6 +227,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -241,7 +242,12 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ulRandomNumbers[ 0 ], ulRandomNumbers[ 1 ], ulRandomNumbers[ 2 ], ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -309,8 +315,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -226,6 +226,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -240,7 +241,12 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ulRandomNumbers[ 0 ], ulRandomNumbers[ 1 ], ulRandomNumbers[ 2 ], ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -308,8 +314,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -225,6 +225,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -239,7 +240,16 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n",
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -307,8 +317,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -226,6 +226,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -240,7 +241,16 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n",
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -308,8 +318,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -278,8 +278,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -313,12 +313,14 @@ missing data. */
BaseType_t lCharactersToAdd, lCharacter;
char cChar = '0';
const BaseType_t lMinimumLength = 60;
uint32_t ulRandomNumber;
/* Randomise the number of characters that will be sent in the echo
request. */
do
{
lCharactersToAdd = ipconfigRAND32() % ( ulBufferLength - 20UL );
( void ) xApplicationGetRandomNumber( &ulRandomNumber );
lCharactersToAdd = ulRandomNumber % ( ulBufferLength - 20UL );
} while( ( lCharactersToAdd == 0 ) || ( lCharactersToAdd < lMinimumLength ) ); /* Must be at least enough to add the unique text to the start of the string later. */
/* Fill the buffer. */

@ -236,16 +236,21 @@ static void prvSRand( UBaseType_t ulSeed )
static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulRandomNumbers[ 4 ];
/* Seed the random number generator. */
time( &xTimeNow );
FreeRTOS_debug_printf( ( "Seed for randomiser: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\n",
ipconfigRAND32(),
ipconfigRAND32(),
ipconfigRAND32(),
ipconfigRAND32() ) );
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/

@ -318,12 +318,14 @@ missing data. */
BaseType_t lCharactersToAdd, lCharacter;
char cChar = '0';
const BaseType_t lMinimumLength = 60;
uint32_t ulRandomNumber;
/* Randomise the number of characters that will be sent in the echo
request. */
do
{
lCharactersToAdd = ipconfigRAND32() % ( ulBufferLength - 20UL );
( void ) xApplicationGetRandomNumber( &ulRandomNumber );
lCharactersToAdd = ulRandomNumber % ( ulBufferLength - 20UL );
} while( ( lCharactersToAdd == 0 ) || ( lCharactersToAdd < lMinimumLength ) ); /* Must be at least enough to add the unique text to the start of the string later. */
/* Fill the buffer. */

@ -257,16 +257,22 @@ static void prvSRand( UBaseType_t ulSeed )
static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulRandomNumbers[ 4 ];
/* Seed the random number generator. */
time( &xTimeNow );
FreeRTOS_debug_printf( ( "Seed for randomiser: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\n",
ipconfigRAND32(),
ipconfigRAND32(),
ipconfigRAND32(),
ipconfigRAND32() ) );
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/

@ -298,12 +298,14 @@ static BaseType_t prvCreateTxData( char *cBuffer, uint32_t ulBufferLength )
BaseType_t lCharactersToAdd, lCharacter;
char cChar = '0';
const BaseType_t lMinimumLength = 60;
uint32_t ulRandomNumber;
/* Randomise the number of characters that will be sent in the echo
request. */
do
{
lCharactersToAdd = ipconfigRAND32() % ( ulBufferLength - 20UL );
( void ) xApplicationGetRandomNumber( &ulRandomNumber );
lCharactersToAdd = ulRandomNumber % ( ulBufferLength - 20UL );
} while ( ( lCharactersToAdd == 0 ) || ( lCharactersToAdd < lMinimumLength ) ); /* Must be at least enough to add the unique text to the start of the string later. */
/* Fill the buffer. */

@ -1,6 +1,6 @@
/*
* FreeRTOS V202112.00
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@ -20,7 +20,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://aws.amazon.com/freertos
* https://github.com/FreeRTOS
*
*/
@ -300,6 +300,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configECHO_SERVER_ADDR0, configECHO_SERVER_ADDR1, configECHO_SERVER_ADDR2, configECHO_SERVER_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -308,7 +309,16 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
FreeRTOS_debug_printf( ( "Seed for randomiser: %lu\r\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\r\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
FreeRTOS_debug_printf( ( "Random numbers: %08X %08X %08X %08X\r\n",
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/

@ -226,6 +226,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -240,7 +241,16 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n",
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -308,8 +318,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -262,6 +262,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -276,7 +277,16 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n",
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -344,8 +354,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -220,6 +220,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumbers[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -234,7 +235,16 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumbers[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n",
ulRandomNumbers[ 0 ],
ulRandomNumbers[ 1 ],
ulRandomNumbers[ 2 ],
ulRandomNumbers[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -302,8 +312,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

@ -273,6 +273,7 @@ static void prvMiscInitialisation( void )
{
time_t xTimeNow;
uint32_t ulLoggingIPAddress;
uint32_t ulRandomNumber[ 4 ];
ulLoggingIPAddress = FreeRTOS_inet_addr_quick( configUDP_LOGGING_ADDR0, configUDP_LOGGING_ADDR1, configUDP_LOGGING_ADDR2, configUDP_LOGGING_ADDR3 );
vLoggingInit( xLogToStdout, xLogToFile, xLogToUDP, ulLoggingIPAddress, configPRINT_PORT );
@ -287,7 +288,16 @@ static void prvMiscInitialisation( void )
time( &xTimeNow );
LogDebug( ( "Seed for randomizer: %lu\n", xTimeNow ) );
prvSRand( ( uint32_t ) xTimeNow );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n", ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32(), ipconfigRAND32() ) );
( void ) xApplicationGetRandomNumber( &ulRandomNumber[ 0 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumber[ 1 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumber[ 2 ] );
( void ) xApplicationGetRandomNumber( &ulRandomNumber[ 3 ] );
LogDebug( ( "Random numbers: %08X %08X %08X %08X\n",
ulRandomNumber[ 0 ],
ulRandomNumber[ 1 ],
ulRandomNumber[ 2 ],
ulRandomNumber[ 3 ] ) );
}
/*-----------------------------------------------------------*/
@ -355,8 +365,6 @@ extern uint32_t ulApplicationGetNextSequenceNumber( uint32_t ulSourceAddress,
/*
* Set *pulNumber to a random number, and return pdTRUE. When the random number
* generator is broken, it shall return pdFALSE.
* The macros ipconfigRAND32() and configRAND32() are not in use
* anymore in FreeRTOS+TCP.
*
* THIS IS ONLY A DUMMY IMPLEMENTATION THAT RETURNS A PSEUDO RANDOM NUMBER SO IS
* NOT INTENDED FOR USE IN PRODUCTION SYSTEMS.

Loading…
Cancel
Save