Jump to main content

##

# TCPIP_ICMP_EchoRequestSend Function

## C

    ICMP_ECHO_RESULT TCPIP_ICMP_EchoRequestSend(
        TCPIP_NET_HANDLE netH,
        IPV4_ADDR * targetAddr,
        uint16_t sequenceNumber,
        uint16_t identifier
    );

## Description

This function allows a stack client to send an ICMP query message to a remote host. The supplied sequence number and identifier will be used in the query message. The user will be notified by the result of the query using a notification handle registered by using the TCPIP_ICMP_CallbackRegister() function.

## Preconditions

The TCP/IP Stack must be initialized and up and running.

## Returns

- ICMP_ECHO_OK - Indicates the query request was successfully sent.
- ICMP_ECHO_RESULT - The query request was unsuccessfully sent, which results in an error code (interface not ready for transmission, allocation error, etc.).

## Remarks

This function does not allow the user to specify a data buffer to be sent as part of the request. The preferred function to use is TCPIP_ICMP_EchoRequest().

This function will eventually be obsoleted.

## Example

    IPV4_ADDR remoteAddress = 0xc0a00101;
    uint16_t mySequenceNumber = 1;
    uint16_t myId = 0x1234;

    if(TCPIP_ICMP_EchoRequestSend(0, &remoteAddress, mySequenceNumber, myId) == ICMP_ECHO_OK )
    {
        // successfully sent the ICMP request
        //
    }
    else
    {
        // process the error
    }