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.

Basic NDK UDP Client Example, please

Hi,

I am looking for an example of a simple UDP client to run under NDK.  I just need the simplest possible implementation, equivalent to the winapps/helloWorld.exe client that comes with NDK.  

I have been trying with TaskCreate() in NetworkOpen() as per ndkbenchmark.c, but have just gone around in circles for days, and can't find example code in the forum or documentation

Regards,

Bernard

 

  • Hi Bernard,

    Which version of the NDK are you using?  Which hardware platform are you on?

    Have you seen the NDK "client" example?  This example contains exactly what you want; it should be sitting right next to your helloWorld example.

    The client example has a UDP server daemon that runs and waits for incoming UDP packets.  You can then run the PC side application called "testudp.exe" which will send data to the board over UDP.

    Steve

  • Steve,

    I am using ndk_2_20_04_26 on an EVM6678.

    I can get the network to work on a server using DaemonNew() to create a task thread, and I can respond, and the NDK client example uses DaemonNew() the same way. But I need to ab-initio send a UDP message from the EVM client, just as winapps/helloWorld.exe does from the PC.   

    I think that UDP_Perform_Send() in ndkbenchmark.c (part of hua demo) is close to what I want, but I must be stuffing up the socket configuration somehow.

    Regards,

    Bernard

  • Hi Bernard,

    Please have a look at the attached C files.  These are from some other benchmarks which send data over UDP from one EVM board to another EVM board.  I think your EVM client would have code similar to sendclient() fxn in copyUDPTester.c.

    Steve

    7587.temp.zip

  • Steve,

    Thanks. I have things working now.

    Best Regards,

    Bernard

  • Hi Bernhard....

    did you get your project working? I'm currently facing the problem, that I'm not able to send UDP packets to a host PC without receiving packets from this PC before. The helloWorld demo works fine, in the daemon call back fkt I can echo the packets back to the PC... but now I want to set up a socket anywhere in my program code and send packets to the PC! I see traffic on the ethernet switch, but the packets do not appear in my wireshark session.... can you please help me with this?

    I've already created a separate post, where you can see the code witch sets up my socket: http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/239220.aspx

  • I solved my problem by deactivating my antivir firewall... thank you anyway ;)

  • hi, I'm facing a problem. Now I'm dubugging the helloworld project. However, it doesn't work as it should be.

    I've found that the main problem is the "NetworkOpen()"function can't work well. When debugging, it doen't execute the dtask_udp_hello funtion after the NerworkOpen(). however, It comes to the NS_BootTask, which I don't know what it is.

    Have you faced this problem before? can you help me?

    Looking forward to your answer.

  • Which version of NDK and BIOS are you using?

    Which hardware platform?

    user4201149 said:
    It comes to the NS_BootTask, which I don't know what it is.



    The NS_BootTask runs as part of the NDK startup (boot up).  It is a normal part of the NDK bring up.

    user4201149 said:
    When debugging, it doen't execute the dtask_udp_hello funtion after the NerworkOpen()

    The code in the network open hook creates a daemon, which will listen for incoming connections on the port specified and then run a certain function when a client connects to that port.  In this case, the function is 'dtask_udp_hello'.  But, the daemon is a server - you must connect to it using a client app on another network host.


    The app you need for helloWorld example is called helloWorld.exe and can be found in your NDK installation at 'packages/ti/ndk/winapps' (depending on your NDK version).

    Please try running the helloWorld.exe client app and then you should see the 'dtask_udp_hello' function run.

    Steve

  • I tried, but it doesn't work.

    [C66xx_0] QMSS successfully initialized CPPI successfully initialized PA successfully initialized

    TCP/IP Stack 'Hello World!' Application

    TCP/IP Stack 'Hello World!' Application

    PASS successfully initialized Ethernet subsystem successfully initialized Ethernet eventId : 48 and vectId (Interrupt) : 7 Registration of the EMAC Successful, waiting for link up .. Service Status: DHCPC    : Enabled  :          : 000 Service Status: DHCPC    : Enabled  : Running  : 000 Service Status: DHCPC    : Enabled  : Fault    : 002

    the cosole show the information above,and no more others. I can' t get the IP. I use the arp -a on the computer, however, I can't find any information of the EVM.

    do you know why?

    looking forward to you answer.