Update FreeRTOS+ more demos that use FreeRTOS+CLI to remove casting to int8_t * from strings.

This commit is contained in:
Richard Barry 2013-12-30 19:32:29 +00:00
parent 31609c7c3e
commit 38e7554138
32 changed files with 304 additions and 297 deletions

View file

@ -5,11 +5,11 @@
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license
* terms are different to the FreeRTOS license terms.
*
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* Details of both license options follow:
*
* - Open source licensing -
@ -21,9 +21,9 @@
*
* - Commercial licensing -
* Businesses and individuals that for commercial or other reasons cannot comply
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* and do not require any source files to be changed.
*
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot
@ -99,7 +99,7 @@ static xSocket_t prvCreateDNSSocket( void );
/*
* Create the DNS message in the zero copy buffer passed in the first parameter.
*/
static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier );
static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const char *pcHostName, uint16_t usIdentifier );
/*
* Simple routine that jumps over the NAME field of a resource record.
@ -128,7 +128,7 @@ typedef struct xDNSMessage xDNSMessage_t;
/*-----------------------------------------------------------*/
uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName )
uint32_t FreeRTOS_gethostbyname( const char *pcHostName )
{
static uint16_t usIdentifier = 0;
struct freertos_sockaddr xAddress;
@ -139,7 +139,7 @@ static uint32_t ulAddressLength;
portBASE_TYPE xAttempt;
int32_t lBytes;
size_t xPayloadLength;
const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( ( const char * const ) pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */
const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */
if( xDNSSocket == NULL )
{
@ -207,7 +207,7 @@ const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( ( const
}
/*-----------------------------------------------------------*/
static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier )
static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const char *pcHostName, uint16_t usIdentifier )
{
xDNSMessage_t *pxDNSMessageHeader;
uint8_t *pucStart, *pucByte;
@ -237,10 +237,10 @@ static const xDNSMessage_t xDefaultPartDNSHeader =
pucByte = pucStart + 1;
/* Copy in the host name. */
strcpy( ( char * ) pucByte, ( const char * ) pcHostName );
strcpy( ( char * ) pucByte, pcHostName );
/* Mark the end of the string. */
pucByte += strlen( ( const char * ) pcHostName );
pucByte += strlen( pcHostName );
*pucByte = 0x00;
/* Walk the string to replace the '.' characters with byte counts.

View file

@ -5,11 +5,11 @@
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license
* terms are different to the FreeRTOS license terms.
*
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* Details of both license options follow:
*
* - Open source licensing -
@ -21,9 +21,9 @@
*
* - Commercial licensing -
* Businesses and individuals that for commercial or other reasons cannot comply
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* and do not require any source files to be changed.
*
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot
@ -230,7 +230,7 @@ xFreeRTOS_Socket_t *pxSocket;
#if ipconfigSUPPORT_SELECT_FUNCTION == 1
portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet )
portBASE_TYPE FreeRTOS_FD_CLR( xSocket_t xSocket, xSocketSet_t xSocketSet )
{
xFreeRTOS_Socket_t *pxSocket = ( xFreeRTOS_Socket_t * ) xSocket;
portBASE_TYPE xReturn;
@ -881,29 +881,29 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* Is the socket a member of a select() group? */
if( pxSocket->xSelectQueue != NULL )
{
/* Can the select group be notified that the socket is
/* Can the select group be notified that the socket is
ready to be read? */
if( xQueueSendFromISR( pxSocket->xSelectQueue, &pxSocket, &xHigherPriorityTaskWoken ) != pdPASS )
{
/* Could not notify the select group. */
xReturn = pdFAIL;
iptraceFAILED_TO_NOTIFY_SELECT_GROUP( pxSocket );
}
}
}
}
#endif
#endif
if( xReturn == pdPASS )
{
taskENTER_CRITICAL();
{
/* Add the network packet to the list of packets to be
/* Add the network packet to the list of packets to be
processed by the socket. */
vListInsertEnd( &( pxSocket->xWaitingPacketsList ), &( pxNetworkBuffer->xBufferListItem ) );
}
taskEXIT_CRITICAL();
/* The socket's counting semaphore records how many packets are
/* The socket's counting semaphore records how many packets are
waiting to be processed by the socket. */
xSemaphoreGiveFromISR( pxSocket->xWaitingPacketSemaphore, &xHigherPriorityTaskWoken );
}
@ -972,34 +972,34 @@ xListItem *pxIterator, *pxReturn;
#if ipconfigINCLUDE_FULL_INET_ADDR == 1
uint32_t FreeRTOS_inet_addr( const uint8_t * pucIPAddress )
uint32_t FreeRTOS_inet_addr( const char *pcIPAddress )
{
const uint8_t ucDecimalBase = 10;
uint8_t ucOctet[ socketMAX_IP_ADDRESS_OCTETS ];
const uint8_t *pucPointerOnEntering;
const char *pcPointerOnEntering;
uint32_t ulReturn = 0UL, ulOctetNumber, ulValue;
portBASE_TYPE xResult = pdPASS;
for( ulOctetNumber = 0; ulOctetNumber < socketMAX_IP_ADDRESS_OCTETS; ulOctetNumber++ )
{
ulValue = 0;
pucPointerOnEntering = pucIPAddress;
pcPointerOnEntering = pcIPAddress;
while( ( *pucIPAddress >= ( uint8_t ) '0' ) && ( *pucIPAddress <= ( uint8_t ) '9' ) )
while( ( *pcIPAddress >= ( uint8_t ) '0' ) && ( *pcIPAddress <= ( uint8_t ) '9' ) )
{
/* Move previous read characters into the next decimal
position. */
ulValue *= ucDecimalBase;
/* Add the binary value of the ascii character. */
ulValue += ( *pucIPAddress - ( uint8_t ) '0' );
ulValue += ( *pcIPAddress - ( uint8_t ) '0' );
/* Move to next character in the string. */
pucIPAddress++;
pcIPAddress++;
}
/* Check characters were read. */
if( pucIPAddress == pucPointerOnEntering )
if( pcIPAddress == pcPointerOnEntering )
{
xResult = pdFAIL;
}
@ -1016,14 +1016,14 @@ xListItem *pxIterator, *pxReturn;
/* Check the next character is as expected. */
if( ulOctetNumber < ( socketMAX_IP_ADDRESS_OCTETS - 1 ) )
{
if( *pucIPAddress != ( uint8_t ) '.' )
if( *pcIPAddress != ( uint8_t ) '.' )
{
xResult = pdFAIL;
}
else
{
/* Move past the dot. */
pucIPAddress++;
pcIPAddress++;
}
}
}
@ -1035,7 +1035,7 @@ xListItem *pxIterator, *pxReturn;
}
}
if( *pucIPAddress != ( uint8_t ) 0x00 )
if( *pcIPAddress != ( uint8_t ) 0x00 )
{
/* Expected the end of the string. */
xResult = pdFAIL;

View file

@ -5,11 +5,11 @@
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license
* terms are different to the FreeRTOS license terms.
*
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* Details of both license options follow:
*
* - Open source licensing -
@ -21,9 +21,9 @@
*
* - Commercial licensing -
* Businesses and individuals that for commercial or other reasons cannot comply
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* and do not require any source files to be changed.
*
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot
@ -52,7 +52,7 @@
* FUNCTIONS IS AVAILABLE ON THE FOLLOWING URL:
* http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/FreeRTOS_UDP_API_Functions.shtml
*/
uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName );
uint32_t FreeRTOS_gethostbyname( const char *pcHostName );
#endif /* FREERTOS_DNS_H */

View file

@ -5,11 +5,11 @@
* This file is part of the FreeRTOS+UDP distribution. The FreeRTOS+UDP license
* terms are different to the FreeRTOS license terms.
*
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* FreeRTOS+UDP uses a dual license model that allows the software to be used
* under a standard GPL open source license, or a commercial license. The
* standard GPL license (unlike the modified GPL license under which FreeRTOS
* itself is distributed) requires that all software statically linked with
* FreeRTOS+UDP is also distributed under the same GPL V2 license terms.
* Details of both license options follow:
*
* - Open source licensing -
@ -21,9 +21,9 @@
*
* - Commercial licensing -
* Businesses and individuals that for commercial or other reasons cannot comply
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* with the terms of the GPL V2 license must obtain a commercial license before
* incorporating FreeRTOS+UDP into proprietary software for distribution in any
* form. Commercial licenses can be purchased from http://shop.freertos.org/udp
* and do not require any source files to be changed.
*
* FreeRTOS+UDP is distributed in the hope that it will be useful. You cannot
@ -139,7 +139,7 @@ struct freertos_sockaddr
/* The socket type itself. */
typedef void *xSocket_t;
/* The xSocketSet_t type is the equivalent to the fd_set type used by the
/* The xSocketSet_t type is the equivalent to the fd_set type used by the
Berkeley API. */
typedef void *xSocketSet_t;
@ -154,8 +154,8 @@ int32_t FreeRTOS_sendto( xSocket_t xSocket, const void *pvBuffer, size_t xTotalD
portBASE_TYPE FreeRTOS_bind( xSocket_t xSocket, struct freertos_sockaddr *pxAddress, socklen_t xAddressLength );
portBASE_TYPE FreeRTOS_setsockopt( xSocket_t xSocket, int32_t lLevel, int32_t lOptionName, const void *pvOptionValue, size_t xOptionLength );
portBASE_TYPE FreeRTOS_closesocket( xSocket_t xSocket );
uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName );
uint32_t FreeRTOS_inet_addr( const uint8_t * pucIPAddress );
uint32_t FreeRTOS_gethostbyname( const char *pcHostName );
uint32_t FreeRTOS_inet_addr( const char *pcIPAddress );
#if ipconfigSUPPORT_SELECT_FUNCTION == 1
xSocketSet_t FreeRTOS_CreateSocketSet( unsigned portBASE_TYPE uxEventQueueLength );