If a ping request is successfully sent then the sequence number sent in the ping message is returned to allow the application writer to match ping requests transmitted with ping replies received. See the example below.
If a ping request could not be sent then pdFAIL is returned.
This example defines two functions. vSendPing() transmits 8 bytes to a remote IP address. vApplicationPingReplyHook() is the standard FreeRTOS+UDP ping reply callback function. vApplicationPingReplyHook() receives the ping reply, then sends the received sequence number to vSendPing() where it is compared to the sequence number from the ping request.
Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.