FreeRTOS+UDP was removed from the FreeRTOS kernel download from FreeRTOS V10.1.0. See the FreeRTOS+TCP stack, which can be configured for UDP only use, as an alternative. |
![]() |
FreeRTOS_gethostbyname()
FreeRTOS_sockets.h
|
pcHostName | A standard NULL terminated string containing the name of the host being looked up.
|
If the lookup is successful then the IP address of the host is returned in network byte order.
If the lookup fails then 0 is returned.
Example usage:
/* FreeRTOS+UDP sockets include */ #include "FreeRTOS_sockets.h" void aFunction( void ) { uint32_t ulIPAddress; int8_t cBuffer[ 16 ]; /* Lookup the IP address of the FreeRTOS.org website. */ ulIPAddress = FreeRTOS_gethostbyname( "www.freertos.org" ); if( ulIPAddress != 0 ) { /* Convert the IP address to a string. */ FreeRTOS_inet_ntoa( ulIPAddress, ( char * ) cBuffer ); /* Print out the IP address. */ printf( "www.FreeRTOS.org is at IP address %s\r\n", cBuffer ); } else { printf( "DNS lookup failed. " ); } } Example use of the FreeRTOS_gethostbyname() API function
|