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.

ethernet communication

Hi,

I am using OMAP L138 (only C6748) EVM and in my application I have to receive data from Ethernet and perform some operation on received data (Say addition of all the numbers ) and the transmit the sum through UART port.

I am using CCS V5.1, NSP1.10.00.03 and NDK V2.21. I am planning to use HelloWorld example application (document SPRU523H) as my base program and above it I am planning to write my code for addition of received data through ethernet and the sending the sum value through UART(rs-232).

I have gone through SPRU523H and some more documents  but it is too exhaustive and I am not getting the answers directly. Hence I seek your help for direct reply  of  following query:

1)      HelloWorld application receives and transmit data through which port number and in which function /file it is mentioned?

2)      In what array received data from ethernet is stored and it is in which file.

3)      In what array transmit data for Ethernet is to be stored and it has to be done in which file.

4)      If I want to add the Ethernet data and then transmit it through UART then it has to be done in which file.

 

I again request to reply to my query directly as I am fully exhausted after reading so many documents.

                                                                Regards,

Kumar

  • Hi Kumar,

    Thanks for your post.

    When you receive UDP packets, you shall chek the function UdpInput() and it will copy the each packet fragment for each socket and will validate with a matching PCB thru. the call SockPcbResolveChain() and will get the handle for the next match. You will get to know the Src & Dst port through UDP header pointer pUdpHdr->DstPort & pUdpHdr->SrcPort and likewisem IPSrc & IPDst. The Received udp packets would be stored by default thru. packet buffer pPkt->pDataBuffer.

    Similarly, inorder to transmit the UDP packets out, you need to look into the function UdpOutput() thereby, you will get the UDP socket route thru. SockGetRoute(), create the udp packet and encapsulate appropriate IP & UDP headers into it and append the UDP Src & Dst port numbers invoking thru. UDP socket API calls as follows:

    pUdpHdr->SrcPort = SockGetLPort(hSock);

    pUdpHdr->DstPort = SockGetFPort(hSock);

    pUdpHdr->Length = HNC16( length );

    & Likewise it invokes for IPSrc & IPDst as below:

    upseudo.IPSrc = SockGetLIP(hSock);

    upseudo.IPDst = SockGetFIP(hSock);

    and thereafter, it will set the preferred route for the packet to send/transmit thru. IPTxPacket() and the data to send would usually reside in pPkt->pDataBuffer.

    PBM_setRoute( pPkt, hRoute );

    IPTxPacket(pPkt,SockGetOptionFlags(hSock)&FLG_IPTX_SOSUPPORTED):

    You shall check the functions UdpInput() & UdpOutput() from the below specified location:

    ~\ndk_2_20_06_35\packages\ti\ndk\src\stack\udp\udp.c

    Kindly walk through the above udp source code for more clarity.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------