This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432E401Y: Ping to server

Part Number: MSP432E401Y
Other Parts Discussed in Thread: MSP-EXP432E401Y

Hi,

I am using MSP-EXP432E401Y launchpad. I can not find any code for ping to server in SDK. can any one help me to get ping code?

I am using sdk version 2.30.00.14.

Dinkar

  • I will ask my colleague to comment. In the mean time, can you provide any more information regarding the context(protocol) of this ping?

    Regards,
    Chris
  • Hi Chris,

    I want to ping server(ex. www.google.com) for check my internet connection is available or not.

    Dinkar
  • Hello Dinkar,

    This is possible but the process is a little bit involved.

    The file ./source/ti/ndk/tools/console/conping.c has the necessary functions to replicate "ping" functionality.

    I followed the steps below and was able to successfully ping my laptop.

    • Copy the file ./source/ti/ndk/tools/console/conping.c into project folder.
    • Update the header paths as below:
    #include <ti/ndk/inc/netmain.h>
    #include <ti/ndk/inc/_stack.h>
    • Remove the header
    #include "console.h"
    • Add the following header and the global variable to enable printing over UART
    #include <ti/display/Display.h>
    
    extern Display_Handle display;
    • Replace the API ConPrintf with Display_printf
    • Remove the function ConCmdPing 
    • Call the function Ping from an existing task or create a new task and pass the following parameters:
      • IPAddr should be a 32-bit integer in network format.
        • For example 192.168.128.9 should be 0x0980A8C0
      • rrop can be '0'

    Note that the above steps allows only entering the IP address. You could resolve the IP address of the URL (www.google.com in this case) using the "ping" utility on your PC (for example by typing "ping <URL>" on Windows command prompt) and using that IP address to pass as a parameter to the Ping function mentioned above.

    Thanks,

    Sai

**Attention** This is a public forum